diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-06-20 01:51:23 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-06-20 01:51:23 -0500 |
commit | 36eb6c726a73e5106dd2c2904f50a3ce134f1f32 (patch) | |
tree | 0cf475028036b61af5ad552b7f5c339b9139bc96 | |
parent | 099295bb3d9edd7c3f9e3d4ed688c97098df7c7c (diff) |
use labels in the disassembler output
-rw-r--r-- | extras/romstr.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/extras/romstr.py b/extras/romstr.py index 63a9ef707..1e3fbb664 100644 --- a/extras/romstr.py +++ b/extras/romstr.py @@ -296,6 +296,10 @@ class DisAsm: if op_code in relative_jumps: target_address = offset + 2 + c_int8(ord(rom[offset + 1])).value insertion = "asm_" + hex(target_address) + + if str(target_address) in self.rom.labels.keys(): + insertion = self.rom.labels[str(target_address)] + opstr2 = base_opstr[:base_opstr.find("x")].lower() + insertion + base_opstr[base_opstr.find("x")+1:].lower() asm_command["formatted_with_labels"] = opstr2 @@ -321,6 +325,10 @@ class DisAsm: # straight out of the "main.asm" file. target_address = number % 0x4000 insertion = "asm_" + hex(target_address) + + if str(target_address) in self.rom.labels.keys(): + insertion = self.rom.labels[str(target_address)] + opstr2 = base_opstr[:base_opstr.find("?")].lower() + insertion + base_opstr[base_opstr.find("?")+1:].lower() asm_command["formatted_with_labels"] = opstr2 |