The 6502 is the model number of a computer chip
that made its way into many of the original microcomputer
s. It is fondly remembered by many people as a capable (for its time) and quirky
MOS Technology hired a group of ex-Motorola engineers in August 1974. Their plan was to create a better 6800. By the fall of 1976 they had two models ready: the 6501 was pin-compatible with the 6800, and the 6502 was similar but had an on-chip clock. Both used a new instuction set that was similar, but incompatible with the 6800. Even so, Motorola sued, and MOS withdrew the 6501 in a settlement.
The 6502 was immediately successful. The Atari 2600 featured a 6507, a specialized 6502. But the 6502's big breakthrough occured when a hacker named Steve Wozniak picked up some cheap $25 samples and built his Apple I computer around it. At the time, Motorola and Intel charged hundreds of dollars for it's comparable chips in small quantities. MOS practically gave away their chips, making it far more accessible for the growing microcomputer hobbyist community.
Commodore, another microcomputer maker, chose the 6502 for its machines. The famous Commodore PET, VIC-20, and Commodore 64 computers all ran on 6502 family chips. In 1976, Commodore bought MOS, but eventually hit hard times and shut down its semiconductor division. Rockwell International, a 6502 design lisencee, became the only producer of the chips.
Other popular designs that featured 6502 or 6502 family chips include the entire Apple II series of computers, the Atari 8-bit computer family including the Atari 400/800, the original Nintendo NES and the BBC Micro.
Later, one of the ex-Motorola and ex-MOS engineers, Bill Mensch, resurrected the 6502. He founded Western Design Center and redesigned the 6502 using a low-powered CMOS design. The result was 65c02. The new processor also had a few new instructions specially designed to address some shortcomings of the original design. The 65c02 was used in the Apple IIc and a later redesign, the 65C816, was in the Apple IIgs and the Super Nintendo. Commodore, however, sued WDC for theft of trade secrets, but settled for the right to make the chip at half the usual licence fee.
The Technical Details
The 6502 is an 8-bit microprocessor with a 16-bit address bus. In other words, its registers are 8-bits wide, but it has 16-bit addresses. It has a 16-bit program counter and five 8-bit registers: an accumulator (A), two index registers (X and Y), a status register and a stack pointer. The stack is hardwired to the second page of 256 bytes.
The 6502 is the epitome of CISC design: it has many, complex addressing modes: zero-page, absolute, accumulator, (indirect,x), (indirect),y, immediate, and various additional combinations. The original 6502 also has a number of unassigned instructions opcodes which try to do two operations at once, sometimes even producing useful results. This was the source of many incompatibilities between the the original and the later revisions like the 65c02, which added new instructions that replaced these "undocumented" opcodes.
The 6502 instruction set is relatively simple: four logical instructions,
EOR; four shifts and rotates,
ROR; two arithmetic instructions,
SBC; six increment and decrement instructions,
INY; three comparisions,
CPY; six register transfers,
TYA; six loads and stores,
STY; four stack operations,
PLP; eleven branches, jumps and returns,
RTS; seven flag sets and clears,
SEI; two for interrupts,
RTI; and the ubiquitous no operation
The 6502's Long Path to The Western Design Center, Michael Slater