MOS Technology 6502

From Fox Labs Wiki
Jump to navigation Jump to search
MOS Technology 6502
General information
Launched1975
Common manufacturer(s)
Performance
Max. CPU clock rate1 MHz to 3 MHz
Data width8 bits
Address width16 bits
Architecture and classification
Instruction set6502
History
Predecessor(s)Motorola 6800
Successor(s)

The MOS Technology 6502 is an 8-bit processor based off the Motorola 6800. The 6502 was singlehandedly responsible for the home computing revolution, allowing for the development of some of the most influential home computers of the era, including Commodore 64.

Design

Registers

Zilog Z80 registers
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 (bit position)
Main registers
  A Accumulator
Index registers
  X X index
  Y Y index
0 0 0 0 0 0 0 1 SP Stack Pointer
Program counter
PC Program Counter
Status register
N V - B D I Z C Processor Flags

The 6502, just like the 6800, has a limited set of registers including a single 8-bit accumulator (A), two 8-bit general registers (X and Y), an 8-bit stack pointer (SP) and a 16-bit program counter (PC).

Flags

The processor maintains an internal status register for storing bit flags representing the state of arithmetic and logic operations.

  • Negative (N), set if the result is negative.
  • Overflow (V), set if .
  • Break (B), set if .
  • Decimal (D), set if .
  • Interrupt disable (I), set if .
  • Zero (Z), set if the result is zero.
  • Carry (C), set if the last addition operation resulted in a carry, or the last subtraction operation resulted in a borrow.