diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-04-20 17:57:59 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-04-20 17:57:59 -0500 |
commit | a8da5fbda9be62bc1786954f9e62f3957c1764ed (patch) | |
tree | a0f52e65e86c722e0b81b67ceb5e2e655ecb2ed9 /extras/crystal.py | |
parent | 9ab98276409a816dda1e4bf5cf54b693ac57a6f2 (diff) |
improvements to global to_asm
Diffstat (limited to 'extras/crystal.py')
-rw-r--r-- | extras/crystal.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/extras/crystal.py b/extras/crystal.py index 30d73cc3c..dae8dc348 100644 --- a/extras/crystal.py +++ b/extras/crystal.py @@ -4036,11 +4036,18 @@ incbin_lines = [] processed_incbins = {} def to_asm(some_object): - """shows asm with labels and ending comments""" - #label: ; 0x10101 + """shows an object's asm with a label and an ending comment + showing the next byte address""" + if isinstance(some_object, int): + some_object = script_parse_table[some_object] + #add one to the last_address to show where the next byte is in the file + last_address = some_object.last_address + 1 + #create a line like "label: ; 0x10101" asm = some_object.label + ": ; " + hex(some_object.address) + "\n" + #now add the inner/actual asm asm += spacing + some_object.to_asm().replace("\n", "\n"+spacing).replace("\n"+spacing+"\n"+spacing, "\n\n"+spacing) - asm += "\n; " + hex(some_object.last_address) + #show the address of the next byte below this + asm += "\n; " + hex(last_address) return asm def isolate_incbins(): |