Z80 Development Tools


Before I started writing Castle Escape (towards the end of 2020), I was surfing the web looking for a 'C' compiler for Z80 based systems and stumbled across Z88DK. I was thinking back to my teenage years of programming games on the ZX Spectrum using assembly and was wondering if I could write a game today using 'C' instead of assembly. For the Speccy, the answer is no. The lack of hardware sprite support means a lot of the timing sensitive sprite routines still needed to be written and hand optimized in assembly. I have a separate project running in parallel on the Sega Master System, and due to it's hardware sprite support it may be possible, but I digress. Although I started to write Castle Escape in 'C' it became clear pretty quickly that even today, the quality of the code generated by the 'C' compiler was no match for good old hand-crafted Z80 assembly. YES!

The Tools

Although my initial development tool searches were for a 'C' compiler, it became clear to me that Z88DK had a plethora of supporting tools which made it easy to work with. I'll go into a little detail about the ones I used to create Castle Escape below.

z80asm

The assembler (and linker) z80asm, supports macros in addition to code sections, much like 'C'. This allowed me to easily move code between different memory banks and combine data of similar types together (BSS, RODATA, DATA, CODE, etc.) across multiple source files.

z88dk-dis

The disassembler. One nice feature is, if the map file from z80asm is passed in, the disassembler can determine the type of the data being disassembled. For example, it can tell the difference between code and data based on the name of the section containing the information.

z88dk-ticks

A Z80 profiler. You can't run an entire ZX Spectrum program in it as it doesn't emulate the ZX Spectrum, just the Z80 CPU. But you can profile individual routines.

z88dk-appmake

What an amazing tool. This tool can take a binary input file and convert it to a .tap (or .dsk) file, with or without a header and/or a loader. Optionally a .wav file can be created. There are just too many options to mention.

z88dk-asmstyle

A perl based utility which can format (prettify) assembly code. I like all my code to have the same look and feel, but I don't want to spend time doing it. Some editors, eclipse, MS Code, can do this but I prefer to just run 'z88dk-asmstyle *.asm' before I check-in my code.

In Summary

z88dk supports many, many, Z80 and Z88K systems. It's all provided in source code, which is great because if you find any bugs, you can fix them and push the changes back to the community. Of course, you can also download pre-built binaries for Windows and Ubuntu (via the Snap store). Check out the git repo for z88dk here or the home page.

Get Castle Escape (ZX Spectrum 48K-128K)

Buy Now$1.99 USD or more

Leave a comment

Log in with itch.io to leave a comment.