Nintendo NES-001 User Guide - Page 14

Addressing Modes, 6 Instructions - value

Page 14 highlights

Figure 2-5. NMI (Non-Maskable Interrupt) handling. 2.5 Addressing Modes The 6502 has several different addressing modes, providing different ways to access memory locations. There are also addressing modes which operate on the contents of registers, rather than memory. In total there are 13 different addressing modes on the 6502. Some instructions can use more than one different addressing mode. Details on the available addressing modes can be found in Appendix E. 2.6 Instructions The 6502 has 56 different instructions although some come in multiple variations using different addressing modes, making a total of 151 valid opcodes (operation codes) out of a possible 256. A detailed explanation of the complete instruction set can be found in [2], [29] and [32]. Instructions are either one, two or three bytes long, depending on the addressing mode. The first byte is the opcode and the remaining bytes are the operands. Instructions fit into several functional groups [3]: • Load / Store Operations - Load a register from memory or stores the contents of a register to memory. • Register Transfer Operations - Copy contents of X or Y register to the accumulator or copy contents of accumulator to X or Y register. • Stack Operations - Push or pull the stack or manipulate stack pointer using X register. • Logical Operations - Perform logical operations on the accumulator and a value stored in memory. • Arithmetic Operations - Perform arithmetic operations on registers and memory. • Increments / Decrements - Increment or decrement the X or Y registers or a value stored in memory. • Shifts - Shift the bits of either the accumulator or a memory location one bit to the left or right. 14

  • 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

14
Figure 2-5. NMI (Non-Maskable Interrupt) handling.
2.5 Addressing Modes
The 6502 has several different addressing modes, providing different ways to access
memory locations. There are also addressing modes which operate on the contents of
registers, rather than memory. In total there are 13 different addressing modes on the 6502.
Some instructions can use more than one different addressing mode. Details on the available
addressing modes can be found in Appendix E.
2.6 Instructions
The 6502 has 56 different instructions although some come in multiple variations using
different addressing modes, making a total of 151 valid opcodes (operation codes) out of a
possible 256. A detailed explanation of the complete instruction set can be found in [2], [29]
and [32]. Instructions are either one, two or three bytes long, depending on the addressing
mode. The first byte is the opcode and the remaining bytes are the operands. Instructions fit
into several functional groups [3]:
Load / Store Operations - Load a register from memory or stores the contents of a
register to memory.
Register Transfer Operations - Copy contents of X or Y register to the accumulator or
copy contents of accumulator to X or Y register.
Stack Operations - Push or pull the stack or manipulate stack pointer using X register.
Logical Operations - Perform logical operations on the accumulator and a value stored in
memory.
Arithmetic Operations - Perform arithmetic operations on registers and memory.
Increments / Decrements - Increment or decrement the X or Y registers or a value stored
in memory.
Shifts - Shift the bits of either the accumulator or a memory location one bit to the left or
right.