Follow reference assembler syntax in output of thingamajig_disasm.py
This commit is contained in:
parent
0fc5da3483
commit
677f31ea91
|
@ -76,7 +76,7 @@ def segment(binary, origin):
|
|||
def disasm(binary, origin = 0):
|
||||
for addr, raw, contents in segment(binary, origin):
|
||||
if type(contents) == Data:
|
||||
statement = f'db 0x{contents.byte:02x}'
|
||||
statement = f'data {contents.byte:02x}'
|
||||
else:
|
||||
mnemonic = opcodes[contents.opcode].mnemonic
|
||||
fields = []
|
||||
|
@ -85,9 +85,9 @@ def disasm(binary, origin = 0):
|
|||
if opcodes[contents.opcode].ry:
|
||||
fields.append(f'r{contents.ry}')
|
||||
if contents.immediate is not None:
|
||||
fields.append(f'#0x{contents.immediate:02x}')
|
||||
fields.append(f'#{contents.immediate:02x}')
|
||||
elif opcodes[contents.opcode].addr:
|
||||
fields.append(f'0x{contents.addr:04x}')
|
||||
fields.append(f'{contents.addr:04x}')
|
||||
|
||||
if mnemonic == 'store':
|
||||
fields = ', '.join(reversed(fields))
|
||||
|
|
Loading…
Reference in New Issue