Ghidra: Incorrect Z80 instruction LD A,HL in exported text/assembly files.

Created on 17 Jul 2019  路  2Comments  路  Source: NationalSecurityAgency/ghidra

To Reproduce
Steps to reproduce the behavior:

  1. Create a Project
  2. Click on Create Tool
  3. Select Ghidra Core
  4. On the newly created tool, click on File... and Import File.
  5. Select any Z80 executable file (e.g. a vintage arcade ROM file or a CP/M .com program).
  6. Do a basic disassembling process and spot a LD A,(HL) instruction.
  7. Now click on File... Export... and create an output file in ASCII or HTML format.
  8. Open the new ascii or html format file and inspect the LD A,(HL) instruction: it is written as LD A,HL (without parenthesis), which is not a valid Z80 mnemonic.

Expected behavior
All occurrences of LD A,(HL) must use parenthesis.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Environment (please complete the following information):

  • OS: Windows 7 64bit / Linux 64bit
  • Java Version: 11
  • Ghidra Version: 9.0.4
Bug

Most helpful comment

The problem isn't just with LD A, (HL) or just with the exporter. I see it with many Z80 instructions: SBC A, (HL), LD (BC), A, etc. The Disassembled View plugin mangles the parentheses as well (but only chops off one of them).

All 2 comments

The problem isn't just with LD A, (HL) or just with the exporter. I see it with many Z80 instructions: SBC A, (HL), LD (BC), A, etc. The Disassembled View plugin mangles the parentheses as well (but only chops off one of them).

I reported this bug more than one year ago; it has not even been assigned yet. Open-source brings many benefits, they said...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

awsaba picture awsaba  路  3Comments

gemini00 picture gemini00  路  3Comments

pd0wm picture pd0wm  路  3Comments

toor-de-force picture toor-de-force  路  3Comments

loudinthecloud picture loudinthecloud  路  3Comments