Skip to content

The Z80 at fifty and lessons in constrained computing

The Z80 at fifty and lessons in constrained computing

The Zilog Z80, introduced in 1976, reaches its 50th anniversary in 2026. That is an anniversary-year observation, not a claim that this article was written on its exact launch day. Its small architecture still makes a useful case study for web, cloud and systems developers.

Sources: Zilog founding and Z80 development oral-history panel

The Z80 offers lessons in constraints, register use and predictable instruction timing, but is not the direct ancestor of every modern CPU. TI-83 and early embedded systems provide Z80 examples; the Game Boy uses the related but distinct Sharp SM83 instruction set, not full Z80 assembly. We will inspect the architecture and a small multiplication routine without claiming an emulator or hardware test.

Sources: Zilog founding and Z80 development oral-history panel; Pan Docs project CPU comparison; Zilog Z80 CPU User Manual UM008011-0816

The Genesis: Breaking Away from Intel

Federico Faggin and Ralph Ungermann founded Zilog in 1974 after leaving Intel. Faggin had major roles in the 4004 and 8080, and the Z80 was designed to extend 8080 compatibility while simplifying system implementation. The founders’ oral history gives a fuller account than attributing the company’s creation to one unsupported personal grievance.

Sources: Zilog founding and Z80 development oral-history panel

The original Z80 appeared in 1976, with early 2.5 MHz parts and faster later variants. A single +5 V supply and built-in DRAM refresh address/control support simplified system design compared with the multi-supply 8080. Refresh support was not a complete memory controller: external memory, decoding and timing still mattered.

Sources: Zilog founding and Z80 development oral-history panel; Zilog Z80 CPU User Manual UM008011-0816

Z80 helped enable systems such as the TRS-80 and ZX Spectrum. The later Game Boy is a useful related 8-bit example, but its Sharp SM83 omits several Z80 features and adds others; code and architectural assumptions are not freely interchangeable.

Sources: Zilog founding and Z80 development oral-history panel; Pan Docs project CPU comparison

Inside the Silicon: Register Shadowing and Architecture

From an architectural standpoint, the Z80 introduced several concepts that developer communities still debate today in the context of CPU design, compilers, and virtual machines.

The Z80 has an 8-bit data path and a 16-bit memory address space: 64 KiB, which may contain both RAM and ROM, with bank switching needed to expose more memory over time. Its A accumulator, F flags and B, C, D, E, H, L registers include 16-bit BC, DE, HL pairs. Not every pair supports every addressing mode.

Sources: Zilog Z80 CPU User Manual UM008011-0816

But Zilog didn’t stop there. They introduced an alternate register set: A', F', B', C', D', E', H', and L'.

Primary:    AF  BC  DE  HL
Alternate:  AF' BC' DE' HL'
Other registers (not shadow counterparts): IX, IY, SP, PC, I, R
EXX swaps BC/DE/HL; EX AF,AF' swaps AF separately.

Sources: Zilog Z80 CPU User Manual UM008011-0816

Alternate registers can reduce register-save overhead, particularly in a carefully designed interrupt handler. They do not perform a complete operating-system context switch: stack, program counter, index registers and other state still need appropriate treatment. Modern context-switch save sets also depend on the OS and architecture, rather than always saving every register identically.

Sources: Zilog Z80 CPU User Manual UM008011-0816

EXX exchanges BC, DE, HL with their alternate pairs; EX AF, AF' separately exchanges accumulator and flags. Both instructions are needed to exchange all of those registers. Each takes 4 T-states on the documented Z80 timing, before wait states or interruptions. Interrupt nesting and ownership of the alternate bank must be planned.

Sources: Zilog Z80 CPU User Manual UM008011-0816

Hands-On Z80: Squeezing Performance Out of 8 Bits

The base Z80 instruction set has no general multiply instruction. To multiply an unsigned 8-bit value by 10, additions and shifts are a useful implementation; other software algorithms are possible too. The example below is exact only for inputs 0 through 25 and otherwise returns the product modulo 256.

Sources: Zilog Z80 CPU User Manual UM008011-0816

Because 10=8+2, double A, save 2A in B, double twice more to obtain 8A, then add B. This is a teaching example of strength reduction; modern compilers may also use shifts or additions when appropriate. The routine clobbers B and flags as well as updating A.

Sources: Zilog Z80 CPU User Manual UM008011-0816

Here is how a developer would write this in Z80 assembly:

; Input: A unsigned, 0..25 for an exact 8-bit result.
; Output: A = (original A * 10) modulo 256.
; Clobbers: B and flags. Requires a valid caller stack for RET.
MultiplyBy10:
    add a, a
    ld  b, a
    add a, a
    add a, a
    add a, b
    ret

Sources: Zilog Z80 CPU User Manual UM008011-0816

There are five 4 T-state register instructions plus a 10 T-state RET: 30 T-states total, excluding the caller’s CALL. At an ideal 4 MHz this is 7.5 microseconds. WAIT states, interrupts, bus contention and hardware differences can extend elapsed time. The routine allocates no heap memory, but RET still reads its return address from the stack. This is a timing calculation, not a measured benchmark.

Sources: Zilog Z80 CPU User Manual UM008011-0816

What the Z80 Teaches Us About Modern Software Engineering

Studying the Z80 isn't just an exercise in nostalgia; it directly informs how we approach modern systems architecture. Here are three major takeaways that apply to your daily work today:

1. Mechanical Sympathy and Constraints

Small ROM and RAM budgets force attention to code and data size: even ten extra bytes can exceed a specific device’s remaining capacity. Modern services can have much larger footprints, but hundreds of megabytes merely to parse any JSON payload is not a measured or universal requirement.

Sources: Zilog Z80 CPU User Manual UM008011-0816

This forced discipline led to highly optimized algorithms. When you understand how the underlying hardware handles data, you develop "mechanical sympathy"—designing software that works with the hardware rather than fighting it. In modern development, this translates to writing cache-friendly data structures in Go or Rust, avoiding unnecessary allocations in hot paths, and understanding how CPU L1/L2 caches operate.

2. The Evolution of Assembly and Compilers

Studying register allocation and instruction selection on small processors helps explain compiler trade-offs. The Z80 extends the 8080 line; x86’s 8086 also has an 8080-related design history, but calling x86 a direct Z80 descendant reverses and oversimplifies that relationship. JIT output from Node.js or .NET targets the current processor and runtime, not a literal inherited 8-bit pipeline.

Sources: Zilog founding and Z80 development oral-history panel; Zilog Z80 CPU User Manual UM008011-0816

3. Edge Computing and the IoT Renaissance

Edge and IoT systems still reward careful resource use, whether based on Cortex-M, RISC-V or another architecture. That is a shared engineering concern, not proof of direct Z80 descent. Some legacy systems retain older processors, but an ordinary Z80 is not inherently radiation-hardened; medical or aerospace suitability requires evidence for the exact component and system.

Sources: Zilog Z80 CPU User Manual UM008011-0816

Conclusion: The Legacy Lives On

The Z80 helped make accessible microcomputer and embedded systems possible. Its lasting educational value lies in concrete trade-offs: compact code, explicit register use, hardware interfaces and timing. Those lessons remain useful without claiming that one chip created every modern architectural idea.

Sources: Zilog founding and Z80 development oral-history panel

As we celebrate 50 years of this silicon icon, take a moment to look at your current project. Ask yourself: If I only had 64 Kilobytes of memory to run this, how would I design it? You might find that looking back at the constraints of the past is the best way to build the highly optimized, scalable systems of the future.

What's your Z80 story?

Did you write BASIC on a ZX Spectrum, build Z80 controllers or explore the related Game Boy architecture? Share how assembly and hardware constraints influenced your engineering work in the comments, or pass this article to another systems developer.

Sources: Pan Docs project CPU comparison

Primary references

Post a Comment

Previous Post Next Post