z80dasm 1.2.0

02.03.2023 18:48

Today I've released z80dasm 1.2.0, a new version of the disassembler for the Zilog Z80 and compatible microprocessors. My thanks for this release goes to two kind contributors that sent in patches that added new functionality.

Back in March 2021 Ben Hildred submitted a patch through the Debian bug tracking system adding partial support for the Zilog Z180 instruction set. Zilog Z180 is a lesser-known successor to the Z80 that was released by Zilog around 10 years after the popular Z80. I don't have any hands-on experience with it, but I thought Ben's patch would be a useful addition to the z80dasm functionality. Since Z180 largely shares the instruction set with Z80 not much new code was needed. Using the Z180 datasheet I added support for the instructions that Ben missed, so baring any undocumented instructions or mistakes on my part, the Z180 support in z80dasm should be complete. It can be enabled using the new --z180 command-line option.

More recently, Michael Riviera sent me a patch by email that added the possibility of copying comments from the symbol file to the disassembly. To produce a more readable output, z80dasm allows you to define symbol names in a separate symbol file. The symbol names are used to define labels in the disassembly so that, for example, function names instead of memory addresses are used in calls. If you also have some comments above the definitions in the symbol file, Michael's new code can now copy them to the output, above the label definition. This can be used to get function documentation in the disassembly. The feature can be enabled using the new --sym-comments command-line option.

Finally, Michael also submitted a patch that improved the alignment of columns in the disassembly. z80dasm's output consists of several columns, depending on the settings. The old code attempted to keep the columns somewhat aligned, but did a bad job at it with a mix of spaces and tabs. Especially if you defined symbols with longer names the output required manual editing if you wanted to have a nice looking disassembly.

I didn't keep Michael's implementation, but the discussion about it did prompt me to clean up and refactor the code that deals with the output formatting. The new z80dasm should now do a much better job at aligning the columns. The new code is also configurable at run time, to allow for different personal preferences regarding column widths and tab sizes. See the new --tab-width and --tab-stops command-line options in the man page.

The new source package is available in the same place as before. See the enclosed README and the man page for build and usage instructions.

I will work on getting the updated package into Debian as my time permits. It will definitely be updated after Debian 12/Bookworm, since there is already a freeze in place.

Posted by Tomaž | Categories: Code

Add a new comment

(No HTML tags allowed. Separate paragraphs with a blank line.)