rename Position get/set

This commit is contained in:
Torsten Ruger
2018-05-06 20:04:02 +03:00
parent e89c4d1ce1
commit 68fb9b1bdc
12 changed files with 41 additions and 37 deletions

View File

@ -69,7 +69,7 @@ module Arm
else
unless @extra
@extra = 1
# puts "RELINK L at #{Risc::Position.position(self)}"
# puts "RELINK L at #{Risc::Position.get(self)}"
# use sub for sub and add for add, ie same as opcode
insert ArmMachine.send( opcode , result , result , 0 ) #noop
end
@ -92,7 +92,7 @@ module Arm
(@left.is_a?(Symbol) and !Risc::RiscValue.look_like_reg(@left)))
# do pc relative addressing with the difference to the instuction
# 8 is for the funny pipeline adjustment (ie pointing to fetch and not execute)
right = Risc::Position.position(@left) - Risc::Position.position(self) - 8
right = Risc::Position.get(@left) - Risc::Position.get(self) - 8
if( (right < 0) && ((opcode == :add) || (opcode == :sub)) )
right *= -1 # this works as we never issue sub only add
set_opcode :sub # so (as we can't change the sign permanently) we can change the opcode