The following section lists all the instruction mnemonics in alphabetical order. Each instruction is accompanied by a description of the instruction, a symbolic representation of the action performed by the instruction, a diagram showing the status-register flags affected by the instruction, and a list of the permitted addressing modes for the instruction.
The following symbols are used in this section:
Symbol: Definition: + Addition - Subtraction & Logical AND \ Logical OR : Logical Exclusive-OR ! Push onto hardware stack ^ Pull from hardware stack = Assignment M Memory location (PC+1) Contents of location after op-code @ Immediate addressing mode ~ No change to flag % Change to flag 1 Set 0 Cleared A Accumulator X X Index Register Y Y Index Register PC Program Counter PCH Low byte of Program Counter PCL High byte of Program Counter
ADC | Add
memory to accumulator with carry A,C=A+M+C |
ADC N Z C I D V % % % ~ ~ % |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
AND | AND
memory with accumulator A=A&M |
AND N Z C I D V % % ~ ~ ~ ~ |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
ASL | Arithmetic
shift left one bit (memory or accumulator)
|
ASL N Z C I D V % % % ~ ~ ~ |
||||||||||||||||||||||||||||||
|
BCC | Branch
if Carry Clear Branch if C=0 |
BCC N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||
|
BCS | Branch
if Carry Set Branch if C=1 |
BCS N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||
|
BEQ | Branch
if Carry Set Branch if Z=1 |
BEQ N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||
|
BIT | Test
bits in memory with accumulator A&M, N=M7, V=M6 Bit 6 and 7 are transferred to the status register. If the result of A&M is zero then Z=l, otherwise Z=0. |
BIT N Z C I D V M7% % ~ ~M6 |
|||||||||||||||
|
BMI | Branch
if result Minus Branch if N=1 |
BMI N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||
|
BNE | Branch
if result Not Equal to zero Branch if Z=0 |
BNE N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||
|
BPL | Branch
if result Plus Branch if N=0 |
BPL N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||
|
BRK | Force
Break Forced interrupt; PC+2 ! P ! |
X N Z C I D V % % % ~ ~ ~ |
||||||||||||||
|
BCC | Branch
if Carry Clear Branch if C=0 |
BCC N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||
|
BVC | Branch
if Overflow Clear Branch if V=0 |
BVC N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||
|
BVS | Branch
if Overflow Set Branch if Z=1 |
BVS N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||
|
CLC | Clear
Carry flag C=0 |
CLC N Z C I D V % % 0 ~ ~ ~ |
||||||||||
|
CLD | Clear
Decimal mode D=0 |
CLD N Z C I D V % % ~ ~ 0 ~ |
||||||||||
|
CLI | Clear
Interrupt disable bit I=0 |
CLI N Z C I D V % % ~ 0 ~ ~ |
||||||||||
|
CLV | Clear
Overflow flag V=0 |
CLD N Z C I D V % % ~ ~ ~ 0 |
||||||||||
|
CMP | Compare
memory and accumulator A-M |
CMP N Z C I D V % % % ~ ~ ~ |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
CPX | Compare
memory and index register X X-M |
CPX N Z C I D V % % % ~ ~ ~ |
||||||||||||||||||||
|
CPY | Compare
memory and index register Y X-M |
CPY N Z C I D V % % % ~ ~ ~ |
||||||||||||||||||||
|
DEC | Decrement
memory by one M=M-1 |
DEC N Z C I D V % % ~ ~ ~ ~ |
|||||||||||||||||||||||||
|
DEX | Decrement
index register X by one X=X-1 |
DEX N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|
DEY | Decrement
index register Y by one Y=Y-1 |
DEY N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|
EOR | Exclusive-OR
memory with accumulator A=A:M |
EOR N Z C I D V % % ~ ~ ~ ~ |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
INC | Increment
memory by one M=M+1 |
INC N Z C I D V % % ~ ~ ~ ~ |
|||||||||||||||||||||||||
|
INX | Increment
index register X by one X=X+1 |
INX N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|
INY | Increment
index register Y by one X=X+1 |
INY N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|
JMP | Jump
to new location PCL=(PC+1), PCH=(PC+2) |
JMP N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||
|
JSR | Jump
to Subroutine saving return address PC+2 !, PCL=(PC+1), PCH=(PC+2) |
JSR N Z C I D V ~ ~ ~ ~ ~ ~ |
||||||||||
|
LDA | Load
accumulator with memory A=M |
LDA N Z C I D V % % ~ ~ ~ ~ |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
LDX | Load
index register X with memory X=M |
LDX N Z C I D V % % ~ ~ ~ ~ |
|||||||||||||||||||||||||||||||||||
|
LDY | Load
index register Y with memory Y=M |
LDY N Z C I D V % % ~ ~ ~ ~ |
|||||||||||||||||||||||||||||||||||
|
LSR | Logical
shift right one bit (memory or accumulator)
|
LSR N Z C I D V % % % ~ ~ ~ |
||||||||||||||||||||||||||||||
|
NOP | No Operation | NOP N Z C I D V ~ ~ ~ ~ ~ ~ |
||||||||||
|
ORA | Load
accumulator with memory A=A\M |
ORA N Z C I D V % % ~ ~ ~ ~ |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
PHA | Push
Accumulator to stack A ! |
PHA N Z C I D V ~ ~ ~ ~ ~ ~ |
||||||||||
|
PHP | Push
Processor status to stack = |
PHP N Z C I D V ~ ~ ~ ~ ~ ~ |
||||||||||
|
PLA | Pull
Accumulator from stack A ^ |
PLA N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|
PLP | Pull
Processor status from stack P ^ |
PLP N Z C I D V from stack |
||||||||||
|
ROL | Rotate
Left one bit (memory or accumulator)
|
ROL N Z C I D V % % % ~ ~ ~ |
||||||||||||||||||||||||||||||
|
ROR | Rotate
right one bit (memory or accumulator)
|
ROR N Z C I D V % % % ~ ~ ~ |
||||||||||||||||||||||||||||||
|
RTI | Return
from Interrupt P^ PC^ |
RTI N Z C I D V From stack |
||||||||||
|
RTS | Return
from Subroutine P^ PC^ |
RTS N Z C I D V ~ ~ ~ ~ ~ ~ |
||||||||||
|
SBC | Subtract
memory from accumulator with carry A,C=A-M-(C-1) |
SBC N Z C I D V % % % ~ ~ % |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
SEC | Set
Carry flag C=1 |
SEC N Z C I D V % % 1 ~ ~ ~ |
||||||||||
|
SED | Set
Decimal mode D=1 |
SED N Z C I D V % % ~ ~ 1 ~ |
||||||||||
|
SEI | Set
Interrupt disable bit I=1 |
SEI N Z C I D V % % ~ 1 ~ ~ |
||||||||||
|
STA | Store
accumulator in memory M=A |
STA N Z C I D V ~ ~ ~ ~ ~ ~ |
|||||||||||||||||||||||||||||||||||||||||||||
|
STX | Store
index register X in memory M=X |
STX N Z C I D V ~ ~ ~ ~ ~ ~ |
||||||||||||||||||||
|
STY | Store
index register Y in memory M=Y |
STY N Z C I D V ~ ~ ~ ~ ~ ~ |
||||||||||||||||||||
|
TAX | Transfer
Accumulator to index register X X=A |
TAX N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|
TAY | Transfer
Accumulator to index register Y Y=A |
TAY N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|
TSX | Transfer
Stack pointer to index register X X=S |
TSX N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|
TXA | Transfer
index register X to Accumulator A=X |
TXA N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|
TXS | Transfer
index register X to stack pointer S=X |
TXS N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|
TYA | Transfer
index register Y to Accumulator A=Y |
TYA N Z C I D V % % ~ ~ ~ ~ |
||||||||||
|