summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-02-27 20:03:18 -0600
committerBryan Bishop <kanzure@gmail.com>2013-02-27 20:03:18 -0600
commit1230ed649a65b9767f29df3c4227cd328081907a (patch)
treeef34e9c0bf1e05d501c75bb3bc36f7ed1dced131
parentd847dcd8f47d02bb2e0dea133414eb6fb0e54859 (diff)
include_last_address for disassembler
This is an extra option that is on by default for gbz80disasm, which is useful in situations where you may not want the last address to be included (like if the output of the disassembler is going to be sent to to_asm anyway). original-commit-id: 381d3e76b73302672c0d568600f78f15f5cd0fcf
-rw-r--r--gbz80disasm.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gbz80disasm.py b/gbz80disasm.py
index d22f152..6c03ad9 100644
--- a/gbz80disasm.py
+++ b/gbz80disasm.py
@@ -592,7 +592,7 @@ def asm_label(address):
# why using a random value when you can use the address?
return ".ASM_" + hex(address)[2:]
-def output_bank_opcodes(original_offset, max_byte_count=0x4000, debug = False):
+def output_bank_opcodes(original_offset, max_byte_count=0x4000, include_last_address=True, debug = False):
#fs = current_address
#b = bank_byte
#in = input_data -- rom
@@ -824,7 +824,8 @@ def output_bank_opcodes(original_offset, max_byte_count=0x4000, debug = False):
output = output.replace((label_line["name"] + "\n").lower(), "")
#add the offset of the final location
- output += "; " + hex(offset)
+ if include_last_address:
+ output += "; " + hex(offset)
return (output, offset, last_hl_address, last_a_address, used_3d97)