finish syscall
works, even had to fix parfait bug to see
This commit is contained in:
parent
1a82ebcd69
commit
59188105ba
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user