finish syscall

works, even had to fix parfait bug to see
This commit is contained in:
Torsten Ruger 2015-06-24 16:07:27 +03:00
parent 1a82ebcd69
commit 59188105ba
3 changed files with 8 additions and 5 deletions

View File

@ -112,6 +112,7 @@ module Arm
end
Arm::ArmMachine.init
require_relative "passes/call_implementation"
require_relative "passes/syscall_implementation"
require_relative "passes/save_implementation"
require_relative "passes/transfer_implementation"
require_relative "passes/get_implementation"

View File

@ -4,13 +4,14 @@ module Arm
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 )
raise "uups" unless code.name == :putstring
new_codes = [ ArmMachine.mov( :r1 , 20 ) ]
new_codes << ArmMachine.ldr( :r0 , Virtual::Slot::MESSAGE_REGISTER, Virtual::SELF_INDEX)
new_codes << ArmMachine.mov( :r7 , 4 )
new_codes << ArmMachine.swi( 0 )
block.replace(code , new_codes )
end
end
end
Virtual.machine.add_pass "Arm::SetImplementation"
Virtual.machine.add_pass "Arm::SyscallImplementation"
end

View File

@ -27,6 +27,7 @@ module Parfait
super()
Parfait::Space.set_object_space self
@classes = Parfait::Dictionary.new_object
@syscall_message = nil # a hack sto store the message during syscall
end
attr_reader :classes , :frames, :messages, :next_message , :next_frame