MOS Technology 6502
From Retrocomputing Wiki
The MOS Technology 6502 is an 8-bit microprocessor designed by a small team led by Chuck Peddle and Bill Mensch at MOS Technology and introduced in September 1975. It sold for $25 at a time when the Intel 8080 and Motorola 6800 cost around $150 to $180, and its low price made it the processor of choice for the first wave of home computers and video game consoles.
Contents |
[edit] History
Peddle and most of his team had worked on the Motorola 6800 and left Motorola in 1974 after the company showed no interest in a cheaper version. At MOS Technology they designed two processors, the 6501, which fitted the same socket as the 6800, and the 6502, which had a different pinout and an on-chip clock generator. Motorola sued over the 6501, and MOS agreed to drop it.
The 6502 was launched at the WESCON trade show in San Francisco, where it was sold over the counter from a jar. Buyers included Steve Wozniak, who used it in the Apple I and later the Apple II. MOS Technology also sold the KIM-1, a single-board computer intended to help engineers learn the chip, which became popular with hobbyists in its own right.
Commodore International bought MOS Technology in 1976, which gave Commodore its own supply of processors for the Commodore PET, the VIC-20 and the Commodore 64.
[edit] Design
The 6502 has a small set of registers: an 8-bit accumulator (A), two 8-bit index registers (X and Y), an 8-bit stack pointer and a status register. Its 16-bit address bus can reach 64 KB of memory. To make up for the small number of registers, the first 256 bytes of memory, the zero page, can be reached with shorter and faster instructions, and programmers use it almost like a large register file. The stack is fixed at page one ($0100-$01FF).
The instruction set has 56 instructions and was designed with simplicity in mind. A 1 MHz 6502 is roughly as fast as a 2 MHz 8080 in typical code, because most instructions take only two to four clock cycles.
[edit] Quirks
- The indirect jump instruction
JMP ($xxFF)does not cross a page boundary correctly: it takes the high byte of the target from $xx00 instead of the next page. - Undocumented opcodes do useful (and sometimes useless) things, and some programmers used them to save a few cycles.
- The processor has a decimal mode for BCD arithmetic, which the Ricoh version used in the NES left out.
[edit] Variants
| Chip | Used in | Notes |
|---|---|---|
| 6502 | Apple II, Commodore PET, VIC-20, Atari 8-bit family, BBC Micro | original NMOS part |
| 6507 | Atari 2600 | only 13 address lines, 28-pin package |
| 6510 | Commodore 64 | adds a 6-bit I/O port |
| 2A03 | Nintendo Entertainment System | made by Ricoh, no decimal mode, sound on chip |
| 65C02 | Apple IIc, enhanced Apple IIe | CMOS version from the Western Design Center |
| 65C816 | Apple IIGS, Super Nintendo | 16-bit extension, 6502 compatible |

