start by moving positioned(module) to position(class)

This commit is contained in:
Torsten Ruger
2018-05-05 19:47:18 +03:00
parent 43d5521cfc
commit d65a982454
14 changed files with 76 additions and 62 deletions

View File

@ -95,7 +95,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 = Positioned.position(@left) - Positioned.position(self) - 8
right = Risc::Position.position(@left) - Risc::Position.position(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