Close

Brief description of the Intel 8080

A project log for One kilobyte Tiny BASIC for the 8080 and Z80

BASIC for the 8080 and Z80, fits in 1K of memory, runs BASIC games on a 2K system. Features similar to Palo Alto Tiny BASIC.

willstevenswill.stevens 01/03/2024 at 11:140 Comments

The Intel 8080 was a revolutionary microprocessor. Released in 1974, it is the direct ancestor of the x86 family of processors found in modern computers, and vestiges of its architecture and instruction set can be seen in modern processors. The Z80 processor - a derivative of the 8080 that can run most 8080 code - is still manufactured today.

The design of the 8080 built upon the 8008 which was released a couple of years earlier. The 8008 architecture was based on the Datapoint 2200 - a very early personal computer which had a multi-chip CPU. The architecture of the 8080 was a significant improvement over the 8008, leading to faster performance and higher code density. 

The 8080 has a simple design and it is easy to write an emulator for this processor. It has an accumulator A, and 6 other 8-bit registers (B,C,D,E,H,L) which can be used by themselves or in pairs (B and C, D and E, H and L) as pseudo-16-bit registers. In particular, the HL register pair can act like a 16 bit accumulator, and the other register pairs can be added to it. Another special feature of the HL pair is that the contents of the memory address that it points to can be accessed as though it were a register called M. M can be used like any of the 6 other 8-bit registers. There is a 16 bit stack pointer SP, so the stack can be located anywhere in the 64K address space. Registers are pushed to and popped from the stack in pairs. The contents of the DE and HL register pairs can be exchanged in a single instruction, and also the top of the stack can be exchanged with HL in a single instruction.

One idea behind the register architecture of the 8080 was the observation that in CPUs where any register could be used for any purpose, programmers tend to use the same register for the same purpose across different programs. So it’s not much of a loss if the processor architecture restricts some operations to designated registers. Often in 8080 programs HL and DE are used as pointers and BC is used as a counter.

All opcodes are single-byte, with some instructions taking one or two operands. Most of the 256 opcodes are used for something, and this helps give 8080 programs a high code density.

The 8080 was used in many computer systems in the late 1970s and the CP/M operating system was based around it. It was displaced by the Z80, released in 1976. But I don’t think that this should be seen as a failure of the 8080 - the Z80 was designed by the same person as the 8080 (Federico Faggin). It has essentially the same architecture, but makes some improvements that lead to shorter, faster programs. The Z80 is a better performing processor, but in my opinion it is less elegant than the 8080 because it has around twice the number of transistors and has a lot of two-byte opcodes.

The 8080 was used in the Space Invaders arcade game in 1978, and an 8085, a close relative of the 8080, was the brain of the Sojourner rover that explored Mars in 1997.

Discussions