fix instruction positioning

use at as at and only compute difference when needed (to determine if
there is a jump in binary)
Easier to understand that way
This commit is contained in:
Torsten Ruger
2018-05-11 18:36:45 +03:00
parent bc1e29e4f6
commit 776a97986d
14 changed files with 60 additions and 29 deletions

View File

@@ -19,8 +19,9 @@ module Arm
Risc.machine.boot
bin = Parfait::BinaryCode.new(1)
Risc::Position.set(bin , 0x20)
Risc::Position.set(@binary , 0)
code = @machine.call( bin ,{} )#this jumps to the next instruction
Risc::Position.set(code , 0, 1)
Risc::Position.set(code , 0, @binary)
assert_code code , :call, [0x09,0x0,0x0,0xeb]
end
def test_swi