1975 · MOS Technology
MOS 6502
In 1975 a microprocessor cost well over a hundred dollars. Then a small team at MOS Technology started selling one for $25 from a jar at a trade show. Within a few years it was inside the Apple II, the Commodore 64, the Atari 2600 and the NES.
| Designed by | Chuck Peddle, Bill Mensch and team (MOS Technology) |
|---|---|
| Released | 1975 |
| Launch price | $25 |
| Data width | 8 bits, with a 16-bit address bus (64 KB) |
| Transistors | about 3,500 |
| Clock | typically 1 to 2 MHz |
| Registers | A, X, Y, stack pointer S, status P (all 8-bit), 16-bit program counter |
| Instructions | 56, with 13 addressing modes |
| Famous uses | Apple II, Commodore PET and 64, Atari 2600, BBC Micro, NES |
Why it was built
Chuck Peddle had worked on Motorola’s 6800 and kept hearing the same thing from customers: they liked it, but it cost too much. He and several colleagues, including Bill Mensch, left for MOS Technology in Pennsylvania with a plan to build a simpler chip that could be made cheaply and sold in huge numbers.
The 6502 was the result. It was small, which meant more working chips per silicon wafer, and MOS used a mask process that cut defects. In 1975 they launched it at the WESCON show for $25. Engineers who had been pricing out other chips lined up to buy one.
How it worked
The 6502 has very few registers, even for its time. The accumulator A does the arithmetic. X and Y are index registers, used to step through tables and arrays. The stack pointer S is only 8 bits, so the stack always lives in one 256-byte page of memory, from $0100 to $01FF. The status register P holds the flags: negative, overflow, break, decimal, interrupt disable, zero and carry.
The trick that makes so few registers workable is the zero page. The first 256 bytes of memory can be reached with a one-byte address, which makes those instructions shorter and faster. Programmers treat the zero page as 256 extra registers, and store pointers there to reach the rest of memory.
The 6502 also overlaps work: while it finishes one instruction, it is already fetching the next. Combined with its simple design, that let a 1 MHz 6502 keep up with rivals running at higher clock speeds.
Addressing modes
The 6502’s 56 instructions get their flexibility from how they find their operand:
| Mode | Example | Meaning |
|---|---|---|
| Immediate | LDA #$10 | Load the value $10 |
| Zero page | LDA $10 | Load from address $0010 |
| Absolute | LDA $1234 | Load from a full 16-bit address |
| Indexed | LDA $1234,X | Load from $1234 plus X |
| Indirect indexed | LDA ($10),Y | Read a pointer from the zero page, add Y, load from there |
| Relative | BNE loop | Branch a short distance if the zero flag is clear |
There is no multiply or divide, and adding always includes the carry flag, so you clear it first with CLC. That carry is the same one that ripples through a binary adder, exposed directly to the programmer.
Why it mattered
A cheap CPU made cheap computers possible. The Apple I and Apple II, the Commodore PET, VIC-20 and 64, the Atari 8-bit computers and the BBC Micro all used a 6502 or a close relative. The Atari 2600 used a cut-down version, the 6507, and the NES used a Ricoh chip built around a 6502 core. Commodore bought MOS Technology in 1976, and Bill Mensch’s company Western Design Center still makes the CMOS 65C02 today.
In 2010 the Visual 6502 project photographed a 6502 die, mapped every transistor, and simulated the chip at the transistor level in a browser. It is one of the best-understood processors ever made.
The 6502 in NANDSIM
The museum 6502 is rebuilt from NAND gates, decode PLA and all, in a small computer with a screen, keyboard and teletype. It runs Snake, a Mandelbrot set and an echo program; watch the registers and memory while it runs, or open it up between steps.