mirror of
https://github.com/maximumspatium/PowerRomDasm.git
synced 2024-11-22 00:32:10 +00:00
Fix creating labels from backward branches.
This commit is contained in:
parent
a636439b47
commit
7a9e446434
@ -80,8 +80,9 @@ class M68KDasm:
|
|||||||
else:
|
else:
|
||||||
label = 'l_{:x}'.format(ea)
|
label = 'l_{:x}'.format(ea)
|
||||||
ops.append(label)
|
ops.append(label)
|
||||||
if ea >= addr and ea < (addr + size):
|
if ea not in self.labels:
|
||||||
self.labels[ea] = label
|
self.labels[ea] = label
|
||||||
|
# discard current op because we've just replaced it
|
||||||
op_list.pop(0)
|
op_list.pop(0)
|
||||||
elif op.address_mode == M68K_AM_PCI_INDEX_BASE_DISP:
|
elif op.address_mode == M68K_AM_PCI_INDEX_BASE_DISP:
|
||||||
ops.append(instr.op_str)
|
ops.append(instr.op_str)
|
||||||
@ -96,8 +97,9 @@ class M68KDasm:
|
|||||||
else:
|
else:
|
||||||
label = 'l_{:x}'.format(ea)
|
label = 'l_{:x}'.format(ea)
|
||||||
ops.append(label)
|
ops.append(label)
|
||||||
if ea >= addr and ea < (addr + size):
|
if ea not in self.labels:
|
||||||
self.labels[ea] = label
|
self.labels[ea] = label
|
||||||
|
# discard current op because we've just replaced it
|
||||||
op_list.pop(0)
|
op_list.pop(0)
|
||||||
else:
|
else:
|
||||||
ops.append(op_list.pop(0))
|
ops.append(op_list.pop(0))
|
||||||
|
Loading…
Reference in New Issue
Block a user