Fix arm offset calculation (#152)
* Fix offset calculation .subtracted is unreliable, and .disp has the sign anyway * Use .subtracted for reg offsets
This commit is contained in:
parent
4ad028b0df
commit
5ae5daa5c4
@ -133,10 +133,10 @@ class Armv7Operand(Operand):
|
||||
if self.is_shifted():
|
||||
shift = self.op.shift
|
||||
idx, carry = self.cpu._Shift(idx, shift.type, shift.value, carry)
|
||||
off = idx
|
||||
off = -idx if self.op.subtracted else idx
|
||||
else:
|
||||
off = self.mem.disp
|
||||
return -off if self.op.subtracted else off
|
||||
return off
|
||||
|
||||
def get_mem_base_addr(self):
|
||||
assert self.type == 'memory'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user