rubyx/lib/arm/passes/get_implementation.rb
Torsten Ruger 9541712af8 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
2015-06-30 18:38:56 +03:00

15 lines
398 B
Ruby

module Arm
class GetImplementation
def run block
block.codes.dup.each do |code|
next unless code.is_a? Register::GetSlot
# times 4 because arm works in bytes, but vm in words
load = ArmMachine.ldr( code.register , code.array , 4 * code.index )
block.replace(code , load )
end
end
end
Virtual.machine.add_pass "Arm::GetImplementation"
end