libz80 - A portable Z80 emulation library

(C) Gabriel Gambetta 1999-2012 Logo


libz80 is a simple and clean Z80 emulation library. It is developed on Linux but is written in pure ANSI C, so it should be easy to port to other platforms.

It's intended to be part of bigger emulation projects, such as a Gameboy emulator. Therefore, it doesn't have an user interface, but it's flexible enough to use it in a wide range of applications. For example, all I/O is done through user-supplied functions which emulate the data bus and whatever hardware is outside.

This library is released under the GPL license. Basically, it means you can do whatever you want with it, except claiming that you wrote it (that is, you don't have the copyright). It also means it is free and will continue to be free. Finally, if you use it in your projects, these projects must be GPL too.


All the decode tables and the implementation of the opcodes are automatically generated from an opcode table and a specification table consisting in regular expressions and C-code templates. This has two benefits; first, there are less manually-written lines of code to make mistakes in; second, it makes *very* easy to add or modify opcodes. Even the prefixes tree is automatically generated from the opcodes list. So it should be very easy to modify the input files to emulate other similar processors (Z180?) or maybe even different processors.


You can download libz80 from the project page at SourceForge.