fix get_internal_byte

improved operators and tests
some logic errors still
This commit is contained in:
2020-03-09 12:47:12 +02:00
parent a70f63e7bb
commit fb4fa598f2
9 changed files with 46 additions and 45 deletions

View File

@ -59,22 +59,22 @@ module Risc
assert_operator ret , :<< , :message , "id_.type"
end
def test_byte_to_reg
instr = @r0 <= @r1[1]
instr = @r0 <= @r1[@r0]
assert_equal ByteToReg , instr.class
assert_equal @r1 , instr.array
assert_equal @r0 , instr.register
assert_equal 1 , instr.index
assert_equal @r0 , instr.index
end
def test_slot_to_reg
instr = @r0 << @r2[:next_object]
assert_slot_to_reg instr , "id_" , 2 , :message
end
def test_reg_to_byte
instr = @r1[1] <= @r0
instr = @r1[@r0] <= @r0
assert_equal RegToByte , instr.class
assert_equal @r1 , instr.array
assert_equal @r0 , instr.register
assert_equal 1 , instr.index
assert_equal @r0 , instr.index
end
end
end