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