The 6502 is the model number of a computer chip that made its way into many of the original microcomputers. It is fondly remembered by many people as a capable (for its time) and quirky processor.

History

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, AND, BIT, ORA, EOR; four shifts and rotates, ASL, LSR, ROL, ROR; two arithmetic instructions, ADC, SBC; six increment and decrement instructions, DEC, DEX, DEY, INC, INX, INY; three comparisions, CMP, CPX, CPY; six register transfers, TAX, TAY, TSX, TXA, TXS, TYA; six loads and stores, LDA, LDX, LDY, STA, STX, STY; four stack operations, PHA, PHP, PLA, PLP; eleven branches, jumps and returns, BCC, BCS, BEQ, BMI, BNE, BPL, BVC, BVS, JMP, JSR, RTS; seven flag sets and clears, CLC, CLD, CLI, CLV, SEC, SED, SEI; two for interrupts, BRK, RTI; and the ubiquitous no operation NOP.


Sources:
The 6502's Long Path to The Western Design Center, Michael Slater
http://www.6502.org/