fix arm (assembled) indexing

by having a dummy 0 index in salaam. when assembled
This commit is contained in:
Torsten Ruger
2015-11-15 20:42:07 +02:00
parent 9a2fe42167
commit 8e82da0b61
5 changed files with 18 additions and 14 deletions

View File

@ -17,12 +17,11 @@ module Arm
# arm indexes are
# in bytes, so *4
# 0 based , so -1
# if an instruction is passed in we ge the index with inex function
# if an instruction is passed in we get the index with index function
def arm_index index
index = index.index if index.is_a?(Register::Instruction)
raise "index error 0" if index == 0
(index - 1) * 4
index * 4
end
# Arm stores the return address in a register (not on the stack)
# The register is called link , or lr for short .