update return address in label

so return jumps go to the right address
This commit is contained in:
Torsten Ruger
2018-06-10 09:15:57 +03:00
parent c7ad1d98ca
commit 0513cd504f
3 changed files with 22 additions and 8 deletions

View File

@ -10,6 +10,13 @@ module Risc
@instruction = DummyInstruction.new(DummyInstruction.new)
@position = InstructionListener.init(@instruction , @binary)
end
def test_label_address
label = Label.new("hi" ,"ho" , FakeAddress.new(0))
label_pos = Position.new( label , -1 )
label_pos.position_listener(InstructionListener.new(@binary))
label_pos.set(8)
assert_equal 8 , label_pos.object.address.value
end
def test_init
assert InstructionListener.init(@instruction , @binary)
end