From e959c5b0f5439de32f0cf5fecfc072587cb7bd06 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 2 Jul 2015 13:50:13 +0300 Subject: [PATCH] fixed wrong exit code no wonder it was set faulting, duh --- lib/arm/passes/syscall_implementation.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/arm/passes/syscall_implementation.rb b/lib/arm/passes/syscall_implementation.rb index 67b52789..e68191bc 100644 --- a/lib/arm/passes/syscall_implementation.rb +++ b/lib/arm/passes/syscall_implementation.rb @@ -1,7 +1,7 @@ module Arm class SyscallImplementation - CALLS_CODES = { :putstring => 4 , :exit => 0 } + CALLS_CODES = { :putstring => 4 , :exit => 1 } def run block block.codes.dup.each do |code| next unless code.is_a? Register::Syscall @@ -17,7 +17,7 @@ module Arm codes << ArmMachine.ldr( :r1 , Register.message_reg, 4 * Register.resolve_index(:message , :receiver)) codes << ArmMachine.add( :r1 , :r1 , 8 ) codes << ArmMachine.mov( :r0 , 1 ) # stdout == 1 - codes << ArmMachine.mov( :r2 , 20 ) # String length, obvious TODO + codes << ArmMachine.mov( :r2 , 12 ) # String length, obvious TODO syscall(int_code , codes ) end