fixing index issues
This commit is contained in:
parent
99b59d920c
commit
31635d9747
@ -4,7 +4,7 @@ module Arm
|
||||
def run block
|
||||
block.codes.dup.each do |code|
|
||||
next unless code.is_a? Register::FunctionReturn
|
||||
load = ArmMachine.ldr( :pc , code.register , code.index )
|
||||
load = ArmMachine.ldr( :pc , code.register , 4 * code.index )
|
||||
block.replace(code , load )
|
||||
end
|
||||
end
|
||||
|
@ -15,7 +15,7 @@ module Arm
|
||||
|
||||
def putstring int_code , codes
|
||||
codes << ArmMachine.mov( :r1 , 20 ) # String length, obvious TODO
|
||||
codes << ArmMachine.ldr( :r0 , Register::RegisterReference.message_reg, Virtual::SELF_INDEX)
|
||||
codes << ArmMachine.ldr( :r0 , Register::RegisterReference.message_reg, 4 * Virtual::SELF_INDEX)
|
||||
syscall(int_code , codes )
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user