- Platform List
- Unsupported Platforms
- i8080/5 Support
- Building the libraries
- Library Configuration
- Header Files
- Assembly Language
- Library in Depth
- Embedded Platform
- More than 64k
- Compiling Larger Applications
- Importing routines written in 8080 assembly mnemonics
- Using CP/M libraries in REL format with z88dk
- Writing optimal code
- Speeding up Compilation
- Calling Conventions
- The Stack frame (Parameter passing)
- Sharing Code by Creating Libraries
- Inline Assembler
Clone this wiki locally
Z88DK is a complete development toolkit for the 8080, 8085, gbz80, z80, z180, z80n and Rabbit processors.
It contains two C compilers, an assembler / linker / librarian, data compression tools and a utility for processing the raw binaries into forms needed by specific targets.
It comes with an extensive library of functions written in assembly language that implements the C standard and many extensions. It holds the largest repository of z80 code on the internet.
Development in assembly language or C is completely integrated; projects can be 100% assembler, 100% C or any mixture of the two. The toolset treats both as first-class languages and is designed to make it very easy to mix them at will with C and asm functions being able to call each other or make use of the hand-optimized library functions.
The toolset is modern and has modern features. Most z80 assembly tools are simple in that they assume a small memory space (confined to 64k) or lack linking capability. Z88DK is able to generate ROMable code and code for multiple memory banks (bank assignment still requires human direction) and the linking capability means large bodies of code or data can be shared in libraries between projects with the linker only drawing out code and data that is actually used by a linking program.
We compare Z88DK with other commercial and non-commercial offerings using benchmarks to identify where Z88DK can be improved. Z88DK compares favourably and you can see that for yourself by investigating the benchmarks if you are interested.
z88dk supports two different library implementations, they are being slowly merged and much of the standard C library is now shared between the implementations.
The classic library is z88dk's traditional library and is written with in a mix of assembler and C.
The classic library supports over 100 platforms and provides many extensions (graphics, sound etc) as well as broadly supporting the C library standard.
The new C library aims to implement as large a subset of C11 as is reasonable on an 8-bit target. The library does not confine itself to the standard and adds many non-standard functions drawn from BSD and GNU, as well as libraries aiming to support text, graphics and sound among other things. The library is slowly being merged into the classic library.
The new library supports a restricted number of targets, and notably doesn't (yet) support file I/O. The supported targets are: +cpm, +hbios, +rc2014, +scz180, +sms, +yaz180, +z80, +z180, +zx, +zxn
This is a quick overview of the tools included in Z88DK.
ZCC is the toolchain's front end. zcc can generate an output binary out of any set of input source files.
SCCZ80 is z88dk's native c compiler. sccz80 is derived from small c but has seen much development to the point that it is nearly c89 compliant as well features from later standards.
ZSDCC is z88dk's customization of the sdcc optimizing c compiler. Our patch makes sdcc compatible with the z88dk toolchain, gives it access to z88dk's extensive assembly language libraries and ready-made crts, addresses some of sdcc's code generation bugs and improves on sdcc's generated code. It has very good standards compliance with c89, some c99 and a little c11.
Z88DK-Z80ASM (not to be confused with several external projects called z80asm) is a fully featured assembler / linker / librarian implementing sections.
Z88DK-Z80NM is z80asm's companion library dumper. It can provide a listing of functions or data encoded in an object or library file.
Z88DK-APPMAKE processes the raw binaries generated by the toolkit into a form suitable for specific target machines. For example, it can generate intel hex files, tapes, ROMs, etc.
Z88DK-TICKS is a command line z80 emulator that can be used to time execution speed of code fragments.
Z88DK-GDB provides the debugger interface from ticks and connects to a gdbserver to permit line-by-line debugging of software in emulators or on real hardware.
Z88DK-DIS is a command line disassembler for Z80, Z180, Z80N and Rabbit 2000/3000. It can additionally read map files generated by z80asm to provide a more symbolic output.
Z88DK-LIB is an installer for third party libraries. It manages installation, removal and listing of available libraries.
Z88DK-ZX0 and Z88DK-ZX7 are PC side data compression tools with companion decompression functions in the z80 library.
Z88DK-ZX0 and Z88DK-ZX7 are PC-side decompressor counterparts to the z88dk-zx0 and z88dk-zx7.
These tools are not normally directly invoked by the user:
M4 acts as z88dk's macro preprocessor and can optionally process files ahead of the c preprocessor or assembler.
ZCPP is the c preprocessor invoked for sccz80.
ZSDCPP is the c preprocessor invoked for zsdcc.
Z88DK-ZPRAGMA is used by the toolchain to process pragmas embedded in c source.
Z88DK-COPT is a regular expression engine that is used as peephole optimizer for sccz80 and as a post-processing tool for both sccz80 and zsdcc.