From 98de7404efeb40662c6fc60ec8a209e31fddeeb3 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Tue, 24 Jun 2014 12:40:49 +0300 Subject: [PATCH] named syscall register --- lib/arm/arm_machine.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/arm/arm_machine.rb b/lib/arm/arm_machine.rb index d8e5deea..6746c0b5 100644 --- a/lib/arm/arm_machine.rb +++ b/lib/arm/arm_machine.rb @@ -13,6 +13,7 @@ module Arm RETURN_REG = :r0 TYPE_REG = :r1 RECEIVER_REG = :r2 + SYSCALL_REG = :r7 def return_register RETURN_REG @@ -91,7 +92,7 @@ module Arm def syscall block , num # This is very arm specific, syscall number is passed in r7, other arguments like a c call ie 0 and up - sys = Vm::Integer.new( Vm::RegisterReference.new(:r7) ) + sys = Vm::Integer.new( Vm::RegisterReference.new(SYSCALL_REG) ) ret = Vm::Integer.new( Vm::RegisterReference.new(RETURN_REG) ) block.add_code mov( sys , num ) block.add_code swi( 0 )