MOS Technology 6502: Difference between revisions

From Fox Labs Wiki
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 84: Line 84:


==== Flags ====
==== Flags ====
 
The processor maintains an internal [[status register]] for storing [[Flag word|bit flags]] representing the state of arithmetic and logic operations.
* [[Sign flag|Negative]] (N), set if the result is negative.
* [[Sign flag|Negative]] (N), set if the result is negative.
* [[Overflow flag|Overflow]] (V), set if .
* [[Overflow flag|Overflow]] (V), set if .
Line 92: Line 92:
* [[Zero flag|Zero]] (Z), set if the result is zero.
* [[Zero flag|Zero]] (Z), set if the result is zero.
* [[Carry flat|Carry]] (C), set if the last addition operation resulted in a carry, or the last subtraction operation resulted in a borrow.
* [[Carry flat|Carry]] (C), set if the last addition operation resulted in a carry, or the last subtraction operation resulted in a borrow.
{{Stub}}
[[Category:8-bit microprocessors]]
[[Category:8-bit microprocessors]]
[[Category:MOS Technology microprocessors]]
[[Category:MOS Technology microprocessors]]

Latest revision as of 21:30, 4 November 2023

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.