Skip to content
Hardware

Zilog Z80

The 8-bit processor that defined British home computing

The Zilog Z80, designed by Federico Faggin after he left Intel, became the dominant 8-bit CPU of European home computing — powering the ZX Spectrum, Amstrad CPC, MSX, Game Boy, Sega Master System, and countless arcade machines. An 8080-compatible superset with shadow registers, block operations, and an instruction set rich enough to feel almost mid-range for a 1976 chip.

sinclair-zx-spectrumamstrad-cpcMSXgame-boysega-master-system cpuprocessorszilog 1976–present

Overview

The Zilog Z80 is an 8-bit microprocessor designed by Federico Faggin — the engineer who led the Intel 4004 and 8080 projects before leaving Intel in 1974 to co-found Zilog. The Z80 launched in 1976 as a deliberate improvement on the 8080: binary-compatible at the opcode level, but with a richer register file, more addressing modes, simpler interface logic (single 5V supply, single-phase clock), and integrated DRAM refresh — features that, combined with aggressive pricing, made the chip the default choice for European 8-bit home computers and a major presence in 1980s arcades.

The Z80 powered the ZX Spectrum, Amstrad CPC, MSX, Sega Master System, Game Gear, the original Game Boy (Sharp LR35902 — a Z80 variant), TRS-80, and a generation of CP/M business machines. For most British and European bedroom coders of the 1980s, "learning machine code" meant learning Z80.

Fast facts

  • Designer: Federico Faggin / Masatoshi Shima / Ralph Ungermann at Zilog, 1974-1976.
  • Launched: July 1976.
  • Clock speed (original NMOS): 2.5 MHz (Z80), 4 MHz (Z80A), 6 MHz (Z80B), 8 MHz (Z80H). CMOS Z84C00 variants run up to 20 MHz.
  • Data bus: 8-bit.
  • Address bus: 16-bit (64 KB addressable).
  • Process: NMOS (original), CMOS (later Z84C00 series).
  • Package: 40-pin DIP for the original; smaller packages for embedded variants.
  • 8080 compatibility: binary-compatible superset — most 8080 code runs unmodified.

Register architecture

The Z80's register file was generous for a 1976 8-bit chip — and notably richer than the contemporary 6502:

Register setPurpose
A, FAccumulator and flags (combined pair: AF)
B, C, D, E, H, LGeneral-purpose 8-bit; paired as BC, DE, HL for 16-bit address arithmetic
A', F', B', C', D', E', H', L'Shadow registers — swapped in/out via EX AF,AF' and EXX
IX, IY16-bit index registers with signed displacement: (IX+d), (IY+d)
SPStack pointer (16-bit)
PCProgram counter (16-bit)
IInterrupt vector base (mode 2)
RDRAM refresh counter (bits 0-6 auto-increment; bit 7 writable)

The shadow set is the Z80's most distinctive architectural feature. A single-instruction context switch — EXX swaps BC/DE/HL with BC'/DE'/HL' in 4 T-states — lets interrupt handlers preserve state without a single push/pop. Many Spectrum games and the BASIC ROM use the shadow set for the interrupt routine that maintains the system clock (FRAMES at $5C78, three bytes incremented every frame).

Key instruction families

FamilyExamplesWhat's notable
Block operationsLDIR, LDDR, CPIR, OTIRRepeating instruction prefix — one opcode copies up to 64 KB of memory
Bit manipulationBIT n,r, SET n,r, RES n,rSingle-instruction bit-test on any register or memory location
Relative jumpsJR, JR cc, DJNZSigned 8-bit displacement; smaller, faster than absolute JP
Index modesLD A,(IX+d), INC (IY+d)Structure-style access via signed 8-bit offset
I/OIN, OUT, IN A,(C), OUT (C),ASeparate I/O address space (256 ports addressed by low 8 bits)
Conditional returnRET ccOne-byte conditional return — denser than testing-then-RET

For Spectrum work the most-used are DJNZ (16-bit loop counters in 13 T-states, no flag side effects on B), LDIR (the screen-clear primitive), BIT n,(HL) (collision testing against attribute bytes), and the index registers (sprite structures).

Undocumented features

The real silicon supports several instructions that don't appear in Zilog's official manual but are universally accepted by assemblers and modelled by accurate emulators:

  • Half-registers of IX and IY. IXH, IXL, IYH, IYL are usable as 8-bit operands in any DD- or FD-prefixed opcode. LD IXH, 5 works. This applies only to register operands — LD (IX+d), H still references the real H, not IXH.
  • SLL (Shift Left Logical). Like SLA but shifts a 1 into bit 0 instead of 0. Useful occasionally for clean ANDed shifts.
  • Undocumented flag effects. Bits 3 and 5 of F (X and Y flags) take their values from various source bytes in ways the official manual doesn't document. Demo-scene code occasionally relies on these.

The most notorious CPU-family quirk: OUT (C),0 outputs the literal value 0 on NMOS Z80, but outputs 0xFF on the CMOS Z84C00. Software written assuming the NMOS behaviour breaks on CMOS parts and on emulators that model the CMOS variant.

Z80 vs 6502 — temperament

The two dominant 8-bit CPUs of the era have very different personalities:

FeatureZ806502
Register countMany (with shadows + index)Few (A, X, Y)
Addressing modesFewer kinds, but more flexibleMany kinds, all clever
Block operationsBuilt-in (LDIR)Must be hand-coded
Code densityMore verbose; bigger opcodesTighter; smaller routines
Clock per instructionHigher T-state counts but higher clockLower cycle counts at lower clock
Typical Spectrum vs C643.5 MHz Z801 MHz 6510
Learning curveSteeper, more to rememberGentler, easier to fit in your head

Neither was objectively better; the 6502 won on density and elegant addressing, the Z80 won on register richness and useful block instructions. The platform-architecture debate of the 1980s often reduced to a CPU-camp argument.

Systems powered

  • Home computers: ZX Spectrum (3.5 MHz), Amstrad CPC (4 MHz), MSX (3.58 MHz), TRS-80 (1.77-4 MHz), Sharp MZ series, Jupiter Ace.
  • Consoles: Sega Master System and Game Gear (Z80A at 3.58 MHz); Game Boy (Sharp LR35902 — a Z80 derivative); ColecoVision; Sega Mega Drive (Z80 as audio co-processor for backwards compatibility).
  • Arcade: Pac-Man, Galaga, Donkey Kong's audio sub-board, countless others.
  • Business / CP/M: Kaypro, Osborne 1, Amstrad PCW.

Cultural impact

For European bedroom coders, the Z80 was assembly language. British schoolchildren in 1985 learning Hewson's Hints & Tips for the ZX Spectrum were learning Z80; the Sinclair User "Andrew Hewson's Helpline" column was a Z80 column under another name. The chip's instruction set was the entry-level apprenticeship for a generation of UK developers — many of whom went on to ship 16-bit games, then PC games, then triple-A titles, all built on muscle memory first acquired by writing DJNZ loops on a rubber-keyed Spectrum.

Why the Z80 matters for Code Like It's 198x

Every line of Shadowkeep's assembly is Z80. The Project teaches the Z80 instruction set not as historical curiosity but as the live language of the Spectrum platform: LDIR for screen clears, BIT n,(HL) for attribute-based collision, DJNZ for tight loops, port I/O via IN A,(C) / OUT (C),A for ULA communication. The chip's design choices — shadow registers, block operations, relative jumps — shape what idiomatic Spectrum code looks like.

See also