add an operator function

to be able to use the builder more
also add ability to load fixnums (for the int functions)
This commit is contained in:
Torsten Ruger
2018-08-07 20:48:36 +03:00
parent 554c2d3d73
commit c63e55c2bc
2 changed files with 16 additions and 1 deletions

View File

@ -46,6 +46,12 @@ module Risc
assert_equal FunctionReturn , ret.class
assert_equal @r0 , ret.register
end
def test_operator
ret = @r0.op :<< , @r1
assert_equal OperatorInstruction , ret.class
assert_equal @r0 , ret.left
assert_equal @r1 , ret.right
end
def test_slot_to_reg
instr = @r0 << @r1[:next_message]
assert_equal SlotToReg , instr.class