Fix incorrect sign in disassembly

This commit is contained in:
Yannik Marchand 2018-09-25 08:44:36 +02:00
parent 190a55e032
commit 015b3228f8

View File

@ -46,7 +46,7 @@ def extend_sign(value, bits=16):
def ihex(value):
sign = "-" if value < 0 else ""
return "%s0x%X" %(sign, value)
return "%s0x%X" %(sign, abs(value))
condition_table_true = ["lt", "gt", "eq"]
@ -231,7 +231,7 @@ def decode_compare_float(instr):
def decode_memory(instr):
def decode(value, addr):
D, A, d = decodeD(value)
A = extend_sign(A)
d = extend_sign(d)
return instr, "r%i, %s(r%i)" %(D, ihex(d), A)
return decode