Nintendo NES-001 User Guide - Page 11

Registers, 3.1 Program Counter PC, 3.2 Stack Pointer SP - value of

Page 11 highlights

Figure 2-3. CPU memory map. 2.3 Registers The 6502 has fewer registers than similar processors. There are three special purpose registers, the program counter, stack pointer and status register which each have a specific use. It also has three general purpose registers, the accumulator and the index registers, X and Y, which can be used to store data or control information temporarily. 2.3.1 Program Counter (PC) The program counter is a 16-bit register which holds the address of the next instruction to be executed. As instructions are executed, the value of the program counter is updated, usually moving on to the next instruction in the sequence. The value can be affected by branch and jump instructions, procedure calls and interrupts. 2.3.2 Stack Pointer (SP) 11

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47

11
Figure 2-3. CPU memory map.
2.3 Registers
The 6502 has fewer registers than similar processors. There are three special purpose
registers, the program counter, stack pointer and status register which each have a specific
use. It also has three general purpose registers, the accumulator and the index registers, X
and Y, which can be used to store data or control information temporarily.
2.3.1 Program Counter (PC)
The program counter is a 16-bit register which holds the address of the next instruction to be
executed. As instructions are executed, the value of the program counter is updated, usually
moving on to the next instruction in the sequence. The value can be affected by branch and
jump instructions, procedure calls and interrupts.
2.3.2 Stack Pointer (SP)