rubyx/lib/arm/passes/syscall_implementation.rb

17 lines
420 B
Ruby
Raw Normal View History

2015-06-23 18:55:54 +02:00
module Arm
class SyscallImplementation
def run block
block.codes.dup.each do |code|
next unless code.is_a? Register::Syscall
new_codes = []
load = ArmMachine.ldr( :r1 , code.constant )
store = ArmMachine.str( code.register , code.array , code.index )
block.replace(code , new_codes )
end
end
end
Virtual.machine.add_pass "Arm::SetImplementation"
end