fix the logic of move, but really there is a deeper issue (we'd have to add to get pc relative addressing for constants)

This commit is contained in:
Torsten Ruger 2014-10-02 16:08:24 +03:00
parent 0e3e11a699
commit cc08016a0f

View File

@ -38,13 +38,9 @@ module Arm
# do pc relative addressing with the difference to the instuction # do pc relative addressing with the difference to the instuction
# 8 is for the funny pipeline adjustment (ie pc pointing to fetch and not execute) # 8 is for the funny pipeline adjustment (ie pc pointing to fetch and not execute)
right = Virtual::IntegerConstant.new( r_pos - self.position - 8 ) right = Virtual::IntegerConstant.new( r_pos - self.position - 8 )
#puts "Position #{r_pos} from #{self.position} = #{right}" puts "Position #{r_pos} from #{self.position} = #{right}"
if right.integer > 255
right = Virtual::IntegerConstant.new(r_pos)
else
rn = :pc rn = :pc
end end
end
if (right.is_a?(Virtual::IntegerConstant)) if (right.is_a?(Virtual::IntegerConstant))
if (right.fits_u8?) if (right.fits_u8?)
# no shifting needed # no shifting needed