Play free

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.

3 min read · Updated

Designed byChuck Peddle, Bill Mensch and team (MOS Technology)
Released1975
Launch price$25
Data width8 bits, with a 16-bit address bus (64 KB)
Transistorsabout 3,500
Clocktypically 1 to 2 MHz
RegistersA, X, Y, stack pointer S, status P (all 8-bit), 16-bit program counter
Instructions56, with 13 addressing modes
Famous usesApple 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:

ModeExampleMeaning
ImmediateLDA #$10Load the value $10
Zero pageLDA $10Load from address $0010
AbsoluteLDA $1234Load from a full 16-bit address
IndexedLDA $1234,XLoad from $1234 plus X
Indirect indexedLDA ($10),YRead a pointer from the zero page, add Y, load from there
RelativeBNE loopBranch 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.

Run the 6502 live