Here’s an interesting project I came across last week through a contact on LinkedIn – a C Compiler for the Z80 processor.
The Z88 DK project was originally conceived for the Cambridge Z88, but now supports a variety of Z80 based platforms including the ZX Spectrum. There are the generic libraries you’d expect from a C compiler including stlib, maths, malloc and string, as well as support for sprites, sound, interrupts and 3D rotation.
In addition, there are some platform dependent library functions for devices such as the Interface 1 and Currah uSpeech.
I’ve had a quick look at the documentation and it looks very promising. The majority of the libraries are written in assembler for speed and, as far as I can tell, libraries such as math can either use native ROM code for size, or custom code for speed.
And when performance is an issue, there is an inline assembler that can be used to optimise critical routines.
This is an excellent project that may be a bridge for developers who are unfamiliar with assembly language that want to write fast applications for Z80 based computers taking advantage of ready made libraries.
I may take a look at this in a future blog post, but for the meantime, here’s the link to the project: