test and last fixes for previous commits (allocalte ints)

mostly just fixing the additional instructions
close #20
This commit is contained in:
Torsten Ruger
2018-11-24 22:40:22 +02:00
parent e6615d0a6a
commit 4d30727811
19 changed files with 308 additions and 233 deletions

View File

@ -25,19 +25,20 @@ module Risc
Branch, LoadConstant, OperatorInstruction, IsZero, SlotToReg, # 60
OperatorInstruction, IsZero, SlotToReg, Branch, Branch,
LoadConstant, OperatorInstruction, IsZero, SlotToReg, OperatorInstruction, # 70
IsZero, RegToSlot, LoadConstant, Branch, SlotToReg,
LoadConstant, SlotToReg, SlotToReg, RegToSlot, RegToSlot, # 80
IsZero, RegToSlot, LoadConstant, SlotToReg, LoadConstant,
Branch, SlotToReg, SlotToReg, RegToSlot, RegToSlot, # 80
RegToSlot, RegToSlot, SlotToReg, SlotToReg, SlotToReg,
RegToSlot, LoadConstant, Branch, SlotToReg, RegToSlot, # 90
SlotToReg, LoadConstant, SlotToReg, DynamicJump, SlotToReg,
SlotToReg, LoadData, OperatorInstruction, LoadConstant, SlotToReg, # 100
SlotToReg, RegToSlot, RegToSlot, RegToSlot, SlotToReg,
SlotToReg, RegToSlot, Branch, LoadConstant, SlotToReg, # 110
RegToSlot, RegToSlot, SlotToReg, SlotToReg, SlotToReg,
FunctionReturn, SlotToReg, SlotToReg, RegToSlot, SlotToReg, # 120
SlotToReg, RegToSlot, Branch, SlotToReg, SlotToReg,
RegToSlot, LoadConstant, SlotToReg, RegToSlot, RegToSlot, # 130
SlotToReg, SlotToReg, SlotToReg, FunctionReturn, Transfer,
RegToSlot, LoadConstant, SlotToReg, RegToSlot, Branch, # 90
SlotToReg, LoadConstant, SlotToReg, DynamicJump, LoadConstant,
SlotToReg, LoadConstant, OperatorInstruction, IsNotZero, SlotToReg, # 100
RegToSlot, SlotToReg, Branch, SlotToReg, LoadData,
OperatorInstruction, RegToSlot, RegToSlot, SlotToReg, SlotToReg, # 110
RegToSlot, LoadConstant, SlotToReg, RegToSlot, RegToSlot,
SlotToReg, Branch, SlotToReg, SlotToReg, FunctionReturn, # 120
SlotToReg, SlotToReg, RegToSlot, SlotToReg, SlotToReg,
RegToSlot, Branch, SlotToReg, SlotToReg, Branch, # 130
RegToSlot, LoadConstant, SlotToReg, RegToSlot, RegToSlot,
SlotToReg, SlotToReg, SlotToReg, FunctionReturn, Transfer, # 140
SlotToReg, SlotToReg, Syscall, NilClass, ]
assert_equal Fixnum , get_return.class
assert_equal 1 , get_return
@ -59,13 +60,13 @@ module Risc
assert_equal DynamicJump , cal.class
end
def test_return
ret = main_ticks(134)
ret = main_ticks(139)
assert_equal FunctionReturn , ret.class
link = @interpreter.get_register( ret.register )
assert_equal Fixnum , link.class
end
def test_sys
sys = main_ticks(138)
sys = main_ticks(143)
assert_equal Syscall , sys.class
end
end