Implied
In the implied addressing mode, the address containing the operand is implicitly stated in the operation code of the instruction.
Bytes: 1
Instruction | Opcode | No. Cycles |
---|---|---|
AUG | $5C | 4 |
BRK | $00 | 2 |
CLC | $18 | 1 |
CLD | $D8 | 1 |
CLE | $02 | 1 |
CLI | $58 | 1 |
CLV | $B8 | 1 |
DEX | $CA | 1 |
DEY | $88 | 1 |
DEZ | $3B | 1 |
INX | $E8 | 1 |
INY | $C8 | 1 |
INZ | $1B | 1 |
NOP | $EA | 1 |
PHA | $48 | 1 |
PHP | $08 | 1 |
PHX | $DA | 1 |
PHY | $5A | 1 |
PHZ | $DB | 1 |
PLA | $68 | 1 |
PLP | $28 | 1 |
PLX | $FA | 1 |
PLY | $7A | 1 |
PLZ | $FB | 1 |
RTI | $40 | 1 |
RTS | $60 | 1 |
SEC | $38 | 1 |
SED | $F8 | 1 |
SEE | $03 | 1 |
SEI | $78 | 1 |
TAB | $5B | 1 |
TAX | $AA | 1 |
TAY | $A8 | 1 |
TAZ | $4B | 1 |
TBA | $7B | 1 |
TSX | $BA | 1 |
TSY | $0B | 1 |
TXA | $8A | 1 |
TXS | $9A | 1 |
TYA | $98 | 1 |
TYS | $2B | 1 |
TZA | $6B | 1 |
AccumulatorA
This form of addressing is represented with a one byte instruction, implying an operation on the accumulator.
Bytes: 1
Instruction | Opcode | No. Cycles |
---|---|---|
ASL A | $0A | 1 |
ASR A | $43 | 1 |
DEC A | $3A | 1 |
INC A | $1A | 1 |
LSR A | $4A | 1 |
NEG A | $42 | 1 |
ROL A | $2A | 1 |
ROR A | $6A | 1 |
Immediate#$nn
In immediate addressing, the operand is contained in the second byte of the instruction, with no further memory addressing required.
Bytes: 2
Instruction | Opcode | No. Cycles |
---|---|---|
ADC #$nn | $69 | 2 |
AND #$nn | $29 | 2 |
BIT #$nn | $89 | 2 |
CMP #$nn | $C9 | 2 |
CPX #$nn | $E0 | 2 |
CPY #$nn | $C0 | 2 |
CPZ #$nn | $C2 | 2 |
EOR #$nn | $49 | 2 |
LDA #$nn | $A9 | 2 |
LDX #$nn | $A2 | 2 |
LDY #$nn | $A0 | 2 |
LDZ #$nn | $A3 | 2 |
ORA #$nn | $09 | 2 |
RTN #$nn | $62 | 2 |
SBC #$nn | $E9 | 2 |
Immediate (word)#$nnnn
The data used in the operation is taken from the bytes immediately following the opcode in the 3-byte instruction.
Bytes: 3
Instruction | Opcode | No. Cycles |
---|---|---|
PHW #$nnnn | $F4 | 3 |
Absolute$nnnn
In absolute addressing, the second byte of the instruction specifies the eight low order bits of the effective address while the third byte specifies the eight high order bits. Thus, the absolute addressing mode allows access to the entire 65 K bytes of addressable memory.
Bytes: 3
Instruction | Opcode | No. Cycles |
---|---|---|
ADC $nnnn | $6D | 3 |
AND $nnnn | $2D | 3 |
ASL $nnnn | $0E | 3 |
ASW $nnnn | $CB | 3 |
BIT $nnnn | $2C | 3 |
CMP $nnnn | $CD | 3 |
CPX $nnnn | $EC | 3 |
CPY $nnnn | $CC | 3 |
CPZ $nnnn | $DC | 3 |
DEC $nnnn | $CE | 3 |
EOR $nnnn | $4D | 3 |
INC $nnnn | $EE | 3 |
JMP $nnnn | $4C | 3 |
JSR $nnnn | $20 | 3 |
LDA $nnnn | $AD | 3 |
LDX $nnnn | $AE | 3 |
LDY $nnnn | $AC | 3 |
LDZ $nnnn | $AB | 3 |
LSR $nnnn | $4E | 3 |
ORA $nnnn | $0D | 3 |
PHW $nnnn | $FC | 3 |
ROL $nnnn | $2E | 3 |
ROR $nnnn | $6E | 3 |
ROW $nnnn | $EB | 3 |
SBC $nnnn | $ED | 3 |
STA $nnnn | $8D | 3 |
STX $nnnn | $8E | 3 |
STY $nnnn | $8C | 3 |
STZ $nnnn | $9C | 3 |
TRB $nnnn | $1C | 3 |
TSB $nnnn | $0C | 3 |
X-Indexed Absolute$nnnn,X
This form of addressing is used in conjunction with the X index register. The effective address is formed by adding the contents of X to the address contained in the second and third bytes of the instruction. This mode allows the index register to contain the index or count value and the instruction to contain the base address. This type of indexing allows any location referencing and the index to modify multiple fields resulting in reduced coding and execution time.
Bytes: 3
Instruction | Opcode | No. Cycles |
---|---|---|
ADC $nnnn,X | $7D | 3 |
AND $nnnn,X | $3D | 3 |
ASL $nnnn,X | $1E | 3 |
BIT $nnnn,X | $3C | 3 |
CMP $nnnn,X | $DD | 3 |
DEC $nnnn,X | $DE | 3 |
EOR $nnnn,X | $5D | 3 |
INC $nnnn,X | $FE | 3 |
LDA $nnnn,X | $BD | 3 |
LDY $nnnn,X | $BC | 3 |
LDZ $nnnn,X | $BB | 3 |
LSR $nnnn,X | $5E | 3 |
ORA $nnnn,X | $1D | 3 |
ROL $nnnn,X | $3E | 3 |
ROR $nnnn,X | $7E | 3 |
SBC $nnnn,X | $FD | 3 |
STA $nnnn,X | $9D | 3 |
STY $nnnn,X | $8B | 3 |
STZ $nnnn,X | $9E | 3 |
Y-Indexed Absolute$nnnn,Y
This form of addressing is used in conjunction with the Y index register. The effective address is formed by adding the contents of Y to the address contained in the second and third bytes of the instruction. This mode allows the index register to contain the index or count value and the instruction to contain the base address. This type of indexing allows any location referencing and the index to modify multiple fields resulting in reduced coding and execution time.
Bytes: 3
Instruction | Opcode | No. Cycles |
---|---|---|
ADC $nnnn,Y | $79 | 3 |
AND $nnnn,Y | $39 | 3 |
CMP $nnnn,Y | $D9 | 3 |
EOR $nnnn,Y | $59 | 3 |
LDA $nnnn,Y | $B9 | 3 |
LDX $nnnn,Y | $BE | 3 |
ORA $nnnn,Y | $19 | 3 |
SBC $nnnn,Y | $F9 | 3 |
STA $nnnn,Y | $99 | 3 |
STX $nnnn,Y | $9B | 3 |
Absolute Indirect($nnnn)
The second byte of the instruction contains the low order eight bits of a memory location. The high order eight bits of that memory location is contained in the third byte of the instruction. The contents of the fully specified memory location is the low order byte of the effective address. The next memory location contains the high order byte of the effective address which is loaded into the sixteen bits of the program counter.
Bytes: 3
Instruction | Opcode | No. Cycles |
---|---|---|
JMP ($nnnn) | $6C | 3 |
JSR ($nnnn) | $22 | 3 |
Absolute X-Indexed Indirect($nnnn,X)
With the Absolute Indexed Indirect addressing mode, the X Index Register is added to the second and third byes of the instruction to form an address to a pointer. This address mode is only used with the JMP instruction and the program Counter is loaded with the first and second bytes at this pointer.
Bytes: 3
Instruction | Opcode | No. Cycles |
---|---|---|
JMP ($nnnn,X) | $7C | 3 |
JSR ($nnnn,X) | $23 | 3 |
Base Page$nn
The second byte of the two-byte instruction contains the low-order address byte, and the B register contains the high-order address byte of the memory location to be used by the operation.
Bytes: 2
Instruction | Opcode | No. Cycles |
---|---|---|
ADC $nn | $65 | 2 |
AND $nn | $25 | 2 |
ASL $nn | $06 | 2 |
ASR $nn | $44 | 2 |
BIT $nn | $24 | 2 |
CMP $nn | $C5 | 2 |
CPX $nn | $E4 | 2 |
CPY $nn | $C4 | 2 |
CPZ $nn | $D4 | 2 |
DEC $nn | $C6 | 2 |
DEW $nn | $C3 | 2 |
EOR $nn | $45 | 2 |
INC $nn | $E6 | 2 |
INW $nn | $E3 | 2 |
LDA $nn | $A5 | 2 |
LDX $nn | $A6 | 2 |
LDY $nn | $A4 | 2 |
LSR $nn | $46 | 2 |
ORA $nn | $05 | 2 |
RMB0 $nn | $07 | 2 |
RMB1 $nn | $17 | 2 |
RMB2 $nn | $27 | 2 |
RMB3 $nn | $37 | 2 |
RMB4 $nn | $47 | 2 |
RMB5 $nn | $57 | 2 |
RMB6 $nn | $67 | 2 |
RMB7 $nn | $77 | 2 |
ROL $nn | $26 | 2 |
ROR $nn | $66 | 2 |
SBC $nn | $E5 | 2 |
SMB0 $nn | $87 | 2 |
SMB1 $nn | $97 | 2 |
SMB2 $nn | $A7 | 2 |
SMB3 $nn | $B7 | 2 |
SMB4 $nn | $C7 | 2 |
SMB5 $nn | $D7 | 2 |
SMB6 $nn | $E7 | 2 |
SMB7 $nn | $F7 | 2 |
STA $nn | $85 | 2 |
STX $nn | $86 | 2 |
STY $nn | $84 | 2 |
STZ $nn | $64 | 2 |
TRB $nn | $14 | 2 |
TSB $nn | $04 | 2 |
X-Indexed Base Page$nn,X
The second byte of the two-byte instruction is added to the X index register to form the low-order address byte, and the B register contains the high-order address byte of the memory location to be used by the operation.
Bytes: 2
Instruction | Opcode | No. Cycles |
---|---|---|
ADC $nn,X | $75 | 2 |
AND $nn,X | $35 | 2 |
ASL $nn,X | $16 | 2 |
ASR $nn,X | $54 | 2 |
BIT $nn,X | $34 | 2 |
CMP $nn,X | $D5 | 2 |
DEC $nn,X | $D6 | 2 |
EOR $nn,X | $55 | 2 |
INC $nn,X | $F6 | 2 |
LDA $nn,X | $B5 | 2 |
LDY $nn,X | $B4 | 2 |
LSR $nn,X | $56 | 2 |
ORA $nn,X | $15 | 2 |
ROL $nn,X | $36 | 2 |
ROR $nn,X | $76 | 2 |
SBC $nn,X | $F5 | 2 |
STA $nn,X | $95 | 2 |
STY $nn,X | $94 | 2 |
STZ $nn,X | $74 | 2 |
Y-Indexed Base Page$nn,Y
The second byte of the two-byte instruction is added to the Y index register to form the low-order address byte, and the B register contains the high-order address byte of the memory location to be used by the operation.
Bytes: 2
Instruction | Opcode | No. Cycles |
---|---|---|
LDX $nn,Y | $B6 | 2 |
STX $nn,Y | $96 | 2 |
X-Indexed Base Page Indirect($nn,X)
The second byte of the two-byte instruction is added to the contents of the X register to form the low-order address byte, and the contents of the B register contains the high-order address byte, of two memory locations that contain the low-order and high-order address of the memory location to be used by the operation.
Bytes: 2
Instruction | Opcode | No. Cycles |
---|---|---|
ADC ($nn,X) | $61 | 2 |
AND ($nn,X) | $21 | 2 |
CMP ($nn,X) | $C1 | 2 |
EOR ($nn,X) | $41 | 2 |
LDA ($nn,X) | $A1 | 2 |
ORA ($nn,X) | $01 | 2 |
SBC ($nn,X) | $E1 | 2 |
STA ($nn,X) | $81 | 2 |
Base Page Indirect Y-Indexed($nn),Y
The second and third bytes of the three-byte instruction are added to the unsigned contents of the X index register to form the low-order and high-order address bytes, respectively, of two memory locations containing the low-order and high-order JMP or JSR address bytes.
Bytes: 2
Instruction | Opcode | No. Cycles |
---|---|---|
ADC ($nn),Y | $71 | 2 |
AND ($nn),Y | $31 | 2 |
CMP ($nn),Y | $D1 | 2 |
EOR ($nn),Y | $51 | 2 |
LDA ($nn),Y | $B1 | 2 |
ORA ($nn),Y | $11 | 2 |
SBC ($nn),Y | $F1 | 2 |
STA ($nn),Y | $91 | 2 |
Indirect Z-Indexed($nn),Z
The second byte of the two-byte instruction contains the low-order byte, and the B register contains the high-order address byte of two memory locations whose contents are added to the unsigned Z index register to form the address of the memory location to be used by the operation.
Bytes: 2
Instruction | Opcode | No. Cycles |
---|---|---|
ADC ($nn),Z | $72 | 2 |
AND ($nn),Z | $32 | 2 |
CMP ($nn),Z | $D2 | 2 |
EOR ($nn),Z | $52 | 2 |
LDA ($nn),Z | $B2 | 2 |
ORA ($nn),Z | $12 | 2 |
SBC ($nn),Z | $F2 | 2 |
STA ($nn),Z | $92 | 2 |
Relative$nnnn
Relative addressing is used only with branch instructions and establishes a destination for the conditional branch.
The second byte of-the instruction becomes the operand which is an “Offset" added to the contents of the lower eight bits of the program counter when the counter is set at the next instruction. The range of the offset is —128 to +127 bytes from the next instruction.
Bytes: 2
Instruction | Opcode | No. Cycles |
---|---|---|
BCC $nnnn | $90 | 2 |
BCS $nnnn | $B0 | 2 |
BEQ $nnnn | $F0 | 2 |
BMI $nnnn | $30 | 2 |
BNE $nnnn | $D0 | 2 |
BPL $nnnn | $10 | 2 |
BRA $nnnn | $80 | 2 |
BVC $nnnn | $50 | 2 |
BVS $nnnn | $70 | 2 |
Relative (word)$nnnn
The second and third bytes of the three-byte branch instruction are added to the low-order and high-order program counter bytes, respectively. (The program counter now contains the opcode address plus two). If the condition of the branch is true, the sum is stored back into the program counter.
Bytes: 3
Instruction | Opcode | No. Cycles |
---|---|---|
BCC $nnnn | $93 | 3 |
BCS $nnnn | $B3 | 3 |
BEQ $nnnn | $F3 | 3 |
BMI $nnnn | $33 | 3 |
BNE $nnnn | $D3 | 3 |
BPL $nnnn | $13 | 3 |
BRA $nnnn | $83 | 3 |
BSR $nnnn | $63 | 3 |
BVC $nnnn | $53 | 3 |
BVS $nnnn | $73 | 3 |
Base Page, Relative$nn,$nnnn
This mode bit tests the base page location specified for bit set/reset per the mask and performs a conditional relative branch based on the results of the bit test.
Bytes: 3
Instruction | Opcode | No. Cycles |
---|---|---|
BBR0 $nn,$nnnn | $0F | 3 |
BBR1 $nn,$nnnn | $1F | 3 |
BBR2 $nn,$nnnn | $2F | 3 |
BBR3 $nn,$nnnn | $3F | 3 |
BBR4 $nn,$nnnn | $4F | 3 |
BBR5 $nn,$nnnn | $5F | 3 |
BBR6 $nn,$nnnn | $6F | 3 |
BBR7 $nn,$nnnn | $7F | 3 |
BBS0 $nn,$nnnn | $8F | 3 |
BBS1 $nn,$nnnn | $9F | 3 |
BBS2 $nn,$nnnn | $AF | 3 |
BBS3 $nn,$nnnn | $BF | 3 |
BBS4 $nn,$nnnn | $CF | 3 |
BBS5 $nn,$nnnn | $DF | 3 |
BBS6 $nn,$nnnn | $EF | 3 |
BBS7 $nn,$nnnn | $FF | 3 |
Stack Relative Indirect Y-Indexed($nnnn,SP),Y
The second byte of the two-byte instruction contains an unsigned offset value, d, which is added to the stack pointer (word) to form the address of two memory locations whose contents are added to the unsigned Y register to form the address of the memory location to be used by the operation.
Bytes: 2
Instruction | Opcode | No. Cycles |
---|---|---|
LDA ($nnnn,SP),Y | $E2 | 2 |
STA ($nnnn,SP),Y | $82 | 2 |
Load/Store |
Transfer |
Stack |
Shift |
Logic |
Arithmetic |
Arithmetic: Inc/Dec |
Control Flow |
Control Flow: Branch |
Flags |
KIL |
NOP |