Z80 Experimentation

Photos and Videos

Early experiments - the first steps

These experiments were done by loading a 2K static RAM with data directly from RS-232 (without using a CPU, using an RS-232 receiver very similar to the Nixie project RS-232 receiver, with a 16 bit counter to select the memory address to write). Then letting the CPU rip once the memory was loaded, simply by letting /RESET go high. I made a simple output device using an 8-input NAND gate plus a 4049 inverter to decode an address, and store the result in a latch which lit up 8 LEDs.

Early experiments - the second stage

I replaced the simple output device with the Z80 PIO. The PIO (parallel I/O) has two 8 bit ports plus handshaking lines for each, and understands IM2 (interrupt mode 2), the most powerful Z80 interrupt mode, and can provide an interrupt vector for incoming data, acknowledges etc. to the CPU. It also supports a 'daisy chain' interrupt priority system.

Pulling it all together

The code for a working system will start pulling together here. For now, I'll just put links to individual files, but as this grows it'll probably need to be a tarball or possibly via anon SVN.

Some conventions in the code:

Additionally, I write instructions in lower case, and registers/hex numbers in upper case to make operands stand out a bit better in the text. Incidentally, I'm using vim as an editor which has syntax highlighting for assembly language :-)

The first machine, in line with all early machines having an ending -AC (i.e. UNIVAC, ENIAC etc.) is called ALIAC-1. Onto the code:

This needs SJASM Plus to assemble, since it makes use of some of the features of this cross-assembler (ability to include files, macros etc.) Link below.

Development Journal

My Slashdot journal - where progress will be noted. I also talk about other things here, not just the electronics projects, so the first entry you hit might not be about the project!

Other info

All the code listings here were assembled using the SJASM Plus cross assembler. This is a platform independent assembler - I have it running on Mac OS X 10.4, Linux and OpenBSD/vax. It has lots of handy things like defines, lua scripting, macros and is (perhaps obviously!) based on SJASM. SJASM Plus is BSD licensed Free software.