Fixing ripples from previous
This commit is contained in:
parent
3ce6ed5263
commit
0ed5e74748
@ -20,7 +20,7 @@ module SlotMachine
|
||||
# Assumes int return value and extracts the fixnum for process exit code
|
||||
def self.exit_sequence(builder)
|
||||
save_message( builder )
|
||||
unix_return = Risc.syscall_reg(1)
|
||||
unix_return = Risc.syscall_reg(1).set_compiler(builder.compiler)
|
||||
builder.build do
|
||||
unix_return << message[:return_value].reduce_int(false) #hack, noo type check
|
||||
add_code Risc::Syscall.new("emit_syscall(exit)", :exit )
|
||||
|
@ -8,7 +8,7 @@ module Risc
|
||||
@right = RegisterValue.new(:right , :Integer)
|
||||
end
|
||||
def risc(i)
|
||||
@left.op :- , @right
|
||||
OperatorInstruction.new( "source" , :- , @left , @right )
|
||||
end
|
||||
def test_min
|
||||
assert_operator 1 , :- , :left , :right , "op_-_"
|
||||
|
@ -12,7 +12,7 @@ module Risc
|
||||
|
||||
def test_chain
|
||||
#show_main_ticks # get output of what is
|
||||
check_main_chain [LoadConstant, SlotToReg, RegToSlot, LoadConstant, SlotToReg, #5
|
||||
check_main_chain [LoadConstant, SlotToReg, RegToSlot, LoadConstant, SlotToReg, #5
|
||||
RegToSlot, LoadConstant, SlotToReg, RegToSlot, SlotToReg, #10
|
||||
FunctionCall, LoadConstant, LoadConstant, SlotToReg, OperatorInstruction, #15
|
||||
IsNotZero, SlotToReg, RegToSlot, RegToSlot, SlotToReg, #20
|
||||
@ -22,7 +22,7 @@ module Risc
|
||||
RegToSlot, SlotToReg, SlotToReg, FunctionReturn, SlotToReg, #40
|
||||
RegToSlot, Branch, SlotToReg, SlotToReg, RegToSlot, #45
|
||||
SlotToReg, SlotToReg, FunctionReturn, Transfer, SlotToReg, #50
|
||||
SlotToReg, Syscall, NilClass,] #55
|
||||
SlotToReg, Transfer, Syscall, NilClass,] #55
|
||||
assert_equal "Hello again" , @interpreter.stdout
|
||||
assert_equal Integer , get_return.class
|
||||
assert_equal 11 , get_return #bytes written
|
||||
|
@ -24,9 +24,9 @@ module SlotMachine
|
||||
a = Risc.allocate_length
|
||||
assert_reg_to_slot a + 1 , "id_factory_.next_object" , :message , 5
|
||||
assert_transfer a + 2 , :message , :saved_message
|
||||
assert_slot_to_reg a + 3 ,:message , 5 , :message
|
||||
assert_slot_to_reg a + 4 ,:message , 2 , "message.data_1"
|
||||
assert_transfer a + 5 , :"message.data_1" , :message
|
||||
assert_slot_to_reg a + 3 ,:message , 5 , :"message.return_value"
|
||||
assert_slot_to_reg a + 4 ,:"message.return_value" , 2 , "message.return_value.data_1"
|
||||
assert_transfer a + 5 , :"message.return_value.data_1" , :syscall_1
|
||||
assert_syscall a + 6 , :exit
|
||||
assert_slot_to_reg a + 7 ,:message , 5 , "message.return_value"
|
||||
assert_reg_to_slot a + 8 , "message.return_value" , :message , 5
|
||||
|
@ -34,9 +34,9 @@ module SlotMachine
|
||||
assert_function_call 13 , :main
|
||||
assert_label 14 , "Object.__init__"
|
||||
assert_transfer 15 , :message , :saved_message
|
||||
assert_slot_to_reg 16 ,:message , 5 , :message
|
||||
assert_slot_to_reg 17 ,:message , 2 , "message.data_1"
|
||||
assert_transfer 18 , "message.data_1" , :message
|
||||
assert_slot_to_reg 16 ,:message , 5 , :"message.return_value"
|
||||
assert_slot_to_reg 17 ,:"message.return_value" , 2 , "message.return_value.data_1"
|
||||
assert_transfer 18 , "message.return_value.data_1" , :syscall_1
|
||||
assert_syscall 19, :exit
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user