fixing all the indexes
with the type word and layout but the list starting at 1, indexes still need 1 added and for arm x 4. Tried to get all that into one function, resolve_index
This commit is contained in:
@ -5,8 +5,7 @@ module Arm
|
||||
block.codes.dup.each do |code|
|
||||
next unless code.is_a? Register::GetSlot
|
||||
# times 4 because arm works in bytes, but vm in words
|
||||
# + 1 because of the type word
|
||||
load = ArmMachine.ldr( code.register , code.array , 4 * (code.index + 1) )
|
||||
load = ArmMachine.ldr( code.register , code.array , 4 * code.index )
|
||||
block.replace(code , load )
|
||||
end
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ module Arm
|
||||
next unless code.is_a? Register::SetSlot
|
||||
# times 4 because arm works in bytes, but vm in words
|
||||
# + 1 because of the type word
|
||||
store = ArmMachine.str( code.register , code.array , 4 * (code.index + 1) )
|
||||
store = ArmMachine.str( code.register , code.array , 4 * code.index )
|
||||
block.replace(code , store )
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user