Play free

1976 · Zilog

Zilog Z80

The Z80 was built by people who had just designed Intel’s 8080, and it ran 8080 programs unchanged. It then added so much on top that it outsold its parent and stayed in production for almost half a century.

3 min read · Updated

Designed byFederico Faggin and Masatoshi Shima (Zilog)
Released1976
Data width8 bits, with a 16-bit address bus (64 KB)
Transistorsabout 8,500
Clock2.5 MHz at launch; 4 MHz for the Z80A, faster in later versions
RegistersA, F, B, C, D, E, H, L plus a shadow copy of each; IX, IY, SP, PC, I, R
CompatibilityRuns Intel 8080 machine code
Famous usesTRS-80, ZX Spectrum, MSX, Amstrad CPC, CP/M machines, Pac-Man, Sega Master System

Why it was built

Federico Faggin led the design of Intel’s early microprocessors, from the 4004 to the 8080. In 1974 he left to start his own company, Zilog, with Ralph Ungermann, and brought in Masatoshi Shima, who had worked with him on the 4004 and 8080. Their plan was a better 8080: one that could run all the existing 8080 software but was easier to build a computer around and more pleasant to program.

The Z80 arrived in 1976. Hardware designers noticed the practical wins first. The 8080 needed three power supply voltages and a two-phase clock; the Z80 needed a single 5-volt supply and a single clock. It could also refresh dynamic RAM by itself, which saved a handful of extra chips on every board.

How it worked

The Z80 keeps the 8080’s registers: the accumulator A, the flags F, and B, C, D, E, H and L, which pair up as BC, DE and HL for 16-bit addresses. HL is the favorite pointer, used by many instructions to reach memory.

Then it adds a second copy of all of them. Two instructions, EX AF,AF' and EXX, swap the main set with the shadow set in a single step. That makes interrupt handlers fast: swap, do the work, swap back, with nothing saved to the stack.

RegisterJob
A, FAccumulator and flags (sign, zero, half-carry, parity/overflow, subtract, carry)
BC, DE, HLGeneral purpose; usable as 8-bit or 16-bit pairs
AF' … HL'The shadow set, swapped in with EX and EXX
IX, IY16-bit index registers: address = register + signed offset
SP, PCStack pointer and program counter
I, RInterrupt vector base and memory refresh counter

The instruction set

Zilog counted 158 instruction types, a superset of the 8080’s 78. The additions fill gaps programmers had complained about: relative jumps (JR, DJNZ for loops), instructions to set, reset and test any single bit, more shifts and rotates, and block instructions such as LDIR, which copies a whole region of memory with one opcode, and CPIR, which searches it. The new instructions live behind prefix bytes, so the original 8080 opcodes keep their meaning.

There were three interrupt modes, including one where a device supplies part of an address and the CPU jumps through a table, which made multi-device systems tidy. The flags are set by the ALU after each operation, which is the same idea as the condition checks in how a CPU works.

Legacy

The Z80 became the standard CPU for CP/M business computers, the first popular microcomputer operating system. It powered the TRS-80, the Sinclair ZX80, ZX81 and ZX Spectrum, MSX machines and the Amstrad CPC. Arcade boards such as Pac-Man used it, the Sega Master System and Game Gear ran on it, and the Sega Genesis kept one around for sound. Texas Instruments graphing calculators still carry Z80-family processors. Zilog announced the end of the standalone Z80 in 2024, after about 48 years.

The Game Boy’s CPU is a close cousin: it borrows much of the Z80’s style and syntax, though it is not a Z80 itself.

The Z80 in NANDSIM

The museum Z80 is rebuilt from NAND gates in a small computer with a screen, keyboard and teletype, and runs Snake, a Mandelbrot set and an echo program. Its ancestor, the Intel 8080, is on show next to it.

Run the Z80 live