65002 Opcode Prefixes
This page describes the opcode structure for the 65k line of processors.
Table of content
In the opcode map there are 32 codes designated as "prefix1" and 16 codes designated as "prefix2". These opcodes are no operations in themselves, but modify the following operation. The prefix has these values:
prefix1 | |||||||
---|---|---|---|---|---|---|---|
bit 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 0 |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
OF1 | OF0 | RS1 | RS0 | 0 | AM | 1 | 1 |
I.e. in prefix1 the lowest two bits are always one and bit 2 (value 4) is always zero, but all of the other five bits have a special meaning.
prefix2 | |||||||
---|---|---|---|---|---|---|---|
bit 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 0 |
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
UM | LE1 | LE0 | NF | 1 | 0 | 1 | 1 |
For prefix2 the low four bit are fixed, the other bits are used as prefix.
The following table explains the prefix bits.
AM | Adressing Modes |
---|---|
0 | normal addressing modes (8 / 16 bit) |
1 | extended addressing modes (32 / 64 bit) |
LE | Load extension |
0/0 | Do not extend values to full register width when loading a value with RS width; operations use RS width - default for all AC-related operations. |
0/1 | Sign-extend values to full register width when loading a value with RS width; operations use full width |
1/0 | Zero-extend values to full register width when loading a value with RS width; operations use full width - default for XR/YR-related operations. |
1/1 | One-extend values to full register width when loading a value with RS width; operations use full width |
RS1/RS0 | Register Size |
0/0 | 8 bit register |
0/1 | 16 bit register |
1/0 | 32 bit register |
1/1 | 64 bit register |
OF1/OF0 | Offset Register |
0/0 | No offset added to address |
0/1 | Add Program Counter (PC) to address |
1/0 | Add Stack Pointer (SP) to address |
1/1 | Add Base Offset Register (BR) to address |
UM | User mode selector |
0 | Current mode environment (user space/hypervisor mode) |
1 | User mode environment, privileged operation; Stack Pointer for OF=10 is also User Space stack pointer |
NF | No Flags selector |
0 | Flags are updated on each (relevant) operation according to standard 6502 rules |
1 | Flags are not updated. |
These prefix opcodes modify the following opcodes in various aspects. The following opcodes are taken from the original 8 bit opcodes. I.e. there could be a new opcode
LDA.L #$12345678
to load the accumulator with a long (32 bit) value, that is implemented as
23 A9 78 56 34 12
Here 23 is the prefix with RS=%10, i.e. 32 bit registers, and A9 is the original LDA immediate opcode - only the parameter is now 4 byte (32 bit) not 1 byte anymore.
Please note that when all variable prefix bits are zero, the original 6502 operation is executed - with the notable exception on LD* opcodes as described in the section about Load Extension.
Please also note that the order of the prefix bytes is well defined. prefix1 must be before prefix2, which is before the actual opcode. This way the prefix1 codes can be reused in the actual prefixed opcode. This would not be the case if prefix2 was before prefix1, because then it would not be distinguishable of the byte following prefix2 is a prefix1 or a reused opcode. This is done to be able to reuse the prefix1 values for extended opcodes, when a prefix1 byte has already occured. With AM=1 a prefix1 byte must be set, so there can be additional opcodes in the prefix1 space that use extended addressing modes.
The table below gives an overview on which prefix applies to which opcode.
The LE flags only apply to opcodes that read an operand from memory, but not to read-modify-write opcodes. It does not apply to store operations (which could have been done switching memory and register sides). However, as the processor is available in different native register widths, the store would happen in different widths depending on the processor - effectively binding the software to a fixed processor width.
The NF flag does not apply to compare opcodes - their only purpose is to set the flags...
Note that the Register size option for the RTS and JSR opcodes determine the size of the return address as put on the stack. The RS=00 (8 bit register size option) however is mapped to the natural address width of the processor (mode).
The Register size option for the branch opcodes determines the size of the relative address offset. For the BSR opcode this is in conflict with the size options for the address on the stack. Therefore BSR is handled similar to JSR, in that RS determines the size of the return address on the stack, and AM modifies the relative offset from "rel" to "rellong" resp. from "relwide" to "relquad".
Note that the TRAP opcode is marked as using no prefix bits, but still written down in that table. This is for future extensions, when RS may be used to allow more than 256 trap codes.
The green cells are duplicate opcodes. These take the place of prefix1 and require at least one prefix bit set (AM in the current cases). These duplicate opcodes allow to extend an indirect opcode, more specifically to have more options for the size of the address stored at the indirect location.
Normally not all addressing modes would be supported with direct addressing mode replacements. The quad (longlong) indirect addressing modes are not reached. Thus the indirect opcodes are mirrored, and extended from long to quad (longlong) indirect addressing modes. Row LSB 1 is mirrored thus to row LSB 3, as well as row LSB 2 is mirrored to LSB 7. These values are marked with a green background in the table. The LSB 3 and 7 rows then change from (normal = word) indirect addressing modes to quad (longlong) indirect addressing modes.
Also note that there a are no indirect addressing modes that take a long or quad (longlong) value as indirect address.
The AM prefix allows to select an alternative addressing mode compared to the original 6502 addressing mode. For example the "zeropage" addressing mode is converted to the "long" alternative addressing mode.
For more details on this please see the addressing modes page.
The offset prefix bits allows to add an address offset to the effective address of the operand. Four options are available:
OF1/0 | Register | Register Name | Syntax | Examples |
---|---|---|---|---|
00 | - | no register value added | - | LDA $1234 |
01 | PC | Program Counter | Address prefix P, | LDA P,$1234; LDA (P,$12),Y |
10 | SR | Stack Pointer | Address prefix S, | LDA S,$1234; LDA [S,$23,X] |
11 | BR | Base Register | Address prefix B, | LDA B,$1234; LDA B,$12,X |
For (non-indirect) zeropage/absolute and indexed addressing modes to compute the effective address the standard addressing mode effective address is computed, then the register value is added to get the final effective address.
For the indirect addressing mode that situation is more complex. The offset register value is added to the zeropage or absolute address given in the opcode, to compute the indirect address. For indexed with XR addressing modes XR is added to this address to get the real indirect address. Then the effective address is read from the computed indirect address, for indexed with YR then the value of YR is added to the address read, to get the real effective address. Here the offset is not added again.
Note that the size of the address read from the indirect address is defined by the addressing mode alone (which is also determined by the AM prefix bit).
The maximum register size depends on the used processor option. Each operation has a possibly smaller width. The Register size prefix defines the operation width. I.e. this determines the number of bytes to read from memory (from the effective address), the number of bytes to store to memory, or the number bytes to use from resp. store in a register.
The different width prefixes are written as postfixes to the opcode:
RS1/0 | width | Postfix | Example |
---|---|---|---|
00 | 8 | LDA #$12 | |
01 | 16 | .W | LDA.W #$1234 |
10 | 32 | .L | LDA.L #$12345678 |
11 | 64 | .Q | LDA.Q #$123456789ABCDEF0 |
Please note that 8 bit width has no postfix.
TODO: rename to "OS" = "Operation size" or "OW" = "Operation width"?
The registers have a defined width - depending on processor option - of 16, 32 or 64 bit. Operations can be
from 8 to 64 bit.
There are some use cases where some adaption of a value to the register size is practical. For example if
an 8-bit value is used on a 32-bit operation - like adding #8
to an address register.
For this purpose the LE bits define how a value loaded from memory (or from another register in the case of the Txy opcodes) is extended to full register size. Four options are available:
LE1/0 | Extension type | Postfix | Example | Description |
---|---|---|---|---|
00 | no extension | ADC #$92 | Adds $92 to AC in 8 bit operation, leaves upper bits untouched. Default for non-load/transfer operations. | |
.E | LDY.E #$92 | Loads $92 into YR, leaves upper bits untouched. | ||
01 | sign-extension | .S | ADC.S #$92 | Because the sign of $92 is 1, this adds $ffffffffffffff92 to AC with a 64 bit operation, truncated to actual processor width. |
10 | zero-extension | .0 | ADC.0 #$92 | Extends with zeros and adds $0000000000000092 to AC in a 64 bit operation, truncated to actual AC width. |
LDY #$92 | Extends with zeros and loads $0000000000000092 into a 64 bit YR, truncated to actual processor width. Default for loads and transfer operations | |||
11 | ones-extension | .1 | ADC.1 #$92 | Extends with ones and adds $ffffffffffffff92 to AC in a 64 bit operation, truncated to actual processor width. |
When the result of an operation is written to a memory location or register, the data is written in the same width as the operation.
Using this extension - i.e. having a value of not 00 - modifies the meaning of the RS prefix. RS then actually defines the width of the memory location to be read. The actual operation happens after loading the value, and it happens at full width. For operations other than loads, the flags are set appropriately from the full width operation result value. For loads (LDA, LDX, LDY) and transfers (TAX, ...), however, the flags are set from the RS-width value that is read from memory (note: if you need flags from the full width value, use BIT A, but in general you should know the outcome of the extension of a load opcode).
There is another difference between loads/transfers and other operations. Loads and transfers do a zero-extension by default, while other opcodes do not extend. To change the load/transfer default behaviour, use an explicit LE prefix of 00. The assembler should take care to create the correct prefix when using another prefix bit in prefix2. For example doing a LDA.U should automatically be set to LDA.U0.
This somewhat inconsistent behaviour between loads/stores and others implements a "least surprise" strategy for loads. X and Y are always used full-width in address calculation. Doing an LDY #0 would not clear all bits and depending what previously executed code left in those bits this leads to unexpected behaviour. Even with the extension, however, the flags need to be set from the width that has been read - in general 8 bits, to be compatible with 6502 code.
So when loading a register, the upper bits are filled with zero by default - but flags are set from the original width (as defined by RS). To load AC with the lower bits only, explicitely set the prefix with LE0=LE1=0 (using the postfix .E). This would normally denote the original 6502 behaviour and could thus be left out, but not in this case as the default - for loads/transfers - is not the 6502 behaviour, yet compatible.
Normally the opcode uses the current processor mode - user or hypervisor - to compute the correct address. For the supervisor mode there is an option, however, to use an address from user mode as operand. This is what the User Mode selector bit (UM) is for.
When the User Mode selector is set, the operand following the opcode is read from the current (hypervisor mode) memory environment (as defined by the matchcode). Then the processor temporarily switches to user mode, using the user mode matchcode and usermode stack pointer. For non-indirect addressing modes then the operand is written to or read from the computed address. For indirect addressing modes the indirect address is read from user mode, then the actual operand is read from or written to user mode as well.
The main purpose of this bit is to enable the following situation:
- user mode prepares stack with trap parameters
- user mode executes a TRP, jumping to hypervisor trap handler. Note that the return address is stored on the hypervisor stack, so the user mode stack pointer still points to the parameters.
- hypervisor mode trap handler then does for example
LDA.U S,$00
to read the first parameter byte from the user mode stack
Note that this bit is a privileged operation - unavailable if no hypervisor mode option is present, and trapping into an abort if executed in user mode.
With the user mode selector such operations as PHA or PLX etc can be easily redirected to the user space stack.
If it is needed to also compute the address in hypervisor mode - relevant only for the indirect addresses -
use LEA with the indirect addressing mode. This computes the address in hypervisor mode and stores it in E.
Then use the E-indirect addressing mode on the actual operation for example with LDA.U (E)
.
The NF bit, when set, prevents the status register bits from being changed. For example you can do index register increments for example without losing the contents of the Z and N status register flags.
The following tables describe which prefixes apply to which opcode.
This table describes the standard opcode page:
LSB-> MSB | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | BRK #byte
RS | ORA (zp,X)
NF, RS, UM, OF, LE, AM | LDA zp,Y
NF, RS, UM, OF, LE, AM | ORA [[zp,X]]
NF, RS, UM, OF, LE, AM=1 | TSB zp
NF, RS, UM, OF, AM | ORA zp
NF, RS, UM, OF, LE, AM | ASL zp
NF, RS, UM, OF, AM | JMP [[abs]]
UM, OF, LE, AM=1 | PHP
RS, UM | ORA #byte
NF, RS, LE | ASL
NF, RS | prefix2 | TSB abs
NF, RS, UM, OF, AM | ORA abs
NF, RS, UM, OF, LE, AM | ASL abs
NF, RS, UM, OF, AM | EXT |
1 | BPL rel
RS | ORA (zp),Y
NF, RS, UM, OF, LE, AM | ORA (zp)
NF, RS, UM, OF, LE, AM | ORA [[zp]],Y
NF, RS, UM, OF, LE, AM=1 | TRB zp
NF, RS, UM, OF, AM | ORA zp,X
NF, RS, UM, OF, LE, AM | ASL zp,X
NF, RS, UM, OF, AM | ORA [[zp]]
NF, RS, UM, OF, LE, AM=1 | CLC
| ORA abs,Y
NF, RS, UM, OF, LE, AM | INC
NF, RS | prefix2 | TRB abs
NF, RS, UM, OF, AM | ORA abs,X
NF, RS, UM, OF, LE, AM | ASL abs,X
NF, RS, UM, OF, AM | |
2 | JSR abs
RS, OF, LE, AM | AND (zp,X)
NF, RS, UM, OF, LE, AM | STA zp,Y
RS, UM, OF, AM | AND [[zp,X]]
NF, RS, UM, OF, LE, AM=1 | BIT zp
NF, RS, UM, OF, LE, AM | AND zp
NF, RS, UM, OF, LE, AM | ROL zp
NF, RS, UM, OF, AM | JMP [[abs,X]]
UM, OF, LE, AM=1 | PLP
| AND #byte
NF, RS, LE | ROL
NF, RS | prefix2 | BIT abs
NF, RS, UM, OF, LE, AM | AND abs
NF, RS, UM, OF, LE, AM | ROL abs
NF, RS, UM, OF, AM | SYS |
3 | BMI rel
RS | AND (zp),Y
NF, RS, UM, OF, LE, AM | AND (zp)
NF, RS, UM, OF, LE, AM | AND [[zp]],Y
NF, RS, UM, OF, LE, AM=1 | BIT zp,X
NF, RS, UM, OF, LE, AM | AND zp,X
NF, RS, UM, OF, LE, AM | ROL zp,X
NF, RS, UM, OF, AM | AND [[zp]]
NF, RS, UM, OF, LE, AM=1 | SEC
| AND abs,Y
NF, RS, UM, OF, LE, AM | DEC
NF, RS | prefix2 | BIT abs,X
NF, RS, UM, OF, LE, AM | AND abs,X
NF, RS, UM, OF, LE, AM | ROL abs,X
NF, RS, UM, OF, AM | |
4 | RTI
| EOR (zp,X)
NF, RS, UM, OF, LE, AM | LDA (abs),Y
NF, RS, UM, OF, LE, AM | EOR [[zp,X]]
NF, RS, UM, OF, LE, AM=1 | BSR relwide
RS, AM | EOR zp
NF, RS, UM, OF, LE, AM | LSR zp
NF, RS, UM, OF, AM | LDA [[abs]],Y
NF, RS, UM, OF, LE, AM=1 | PHA
RS, UM | EOR #byte
NF, RS, LE | LSR
NF, RS | prefix2 | JMP abs
UM, OF, LE, AM | EOR abs
NF, RS, UM, OF, LE, AM | LSR abs
NF, RS, UM, OF, AM | QUICK |
5 | BVC rel
RS | EOR (zp),Y
NF, RS, UM, OF, LE, AM | EOR (zp)
NF, RS, UM, OF, LE, AM | EOR [[zp]],Y
NF, RS, UM, OF, LE, AM=1 | EOR zp,X
NF, RS, UM, OF, LE, AM | LSR zp,X
NF, RS, UM, OF, AM | EOR [[zp]]
NF, RS, UM, OF, LE, AM=1 | CLI
| EOR abs,Y
NF, RS, UM, OF, LE, AM | PHY
RS, UM | prefix2 | EOR abs,X
NF, RS, UM, OF, LE, AM | LSR abs,X
NF, RS, UM, OF, AM | |||
6 | RTS
RS | ADC (zp,X)
NF, RS, UM, OF, LE, AM | LDA (abs,X)
NF, RS, UM, OF, LE, AM | ADC [[zp,X]]
NF, RS, UM, OF, LE, AM=1 | STZ zp
RS, UM, OF, AM | ADC zp
NF, RS, UM, OF, LE, AM | ROR zp
NF, RS, UM, OF, AM | LDA [[abs,X]]
NF, RS, UM, OF, LE, AM=1 | PLA
NF, RS, UM, LE | ADC #byte
NF, RS, LE | ROR
NF, RS | prefix2 | JMP (abs)
UM, OF, LE, AM | ADC abs
NF, RS, UM, OF, LE, AM | ROR abs
NF, RS, UM, OF, AM | reserved prefix |
7 | BVS rel
RS | ADC (zp),Y
NF, RS, UM, OF, LE, AM | ADC (zp)
NF, RS, UM, OF, LE, AM | ADC [[zp]],Y
NF, RS, UM, OF, LE, AM=1 | STZ zp,X
RS, UM, OF, AM | ADC zp,X
NF, RS, UM, OF, LE, AM | ROR zp,X
NF, RS, UM, OF, AM | ADC [[zp]]
NF, RS, UM, OF, LE, AM=1 | SEI
| ADC abs,Y
NF, RS, UM, OF, LE, AM | PLY
NF, RS, UM, LE | prefix2 | JMP (abs,X)
UM, OF, LE, AM | ADC abs,X
NF, RS, UM, OF, LE, AM | ROR abs,X
NF, RS, UM, OF, AM | |
8 | BRA rel
RS | STA (zp,X)
RS, UM, OF, AM | BSR rel
RS, AM | STA [[zp,X]]
RS, UM, OF, AM=1 | STY zp
RS, UM, OF, AM | STA zp
RS, UM, OF, AM | STX zp
RS, UM, OF, AM | JSR [[abs]]
RS, OF, LE, AM=1 | DEY
NF, RS | BIT #byte
NF, RS, LE | TXA
NF, RS, LE | prefix2 | STY abs
RS, UM, OF, AM | STA abs
RS, UM, OF, AM | STX abs
RS, UM, OF, AM | reserved prefix |
9 | BCC rel
RS | STA (zp),Y
RS, UM, OF, AM | STA (zp)
RS, UM, OF, AM | STA [[zp]],Y
RS, UM, OF, AM=1 | STY zp,X
RS, UM, OF, AM | STA zp,X
RS, UM, OF, AM | STX zp,Y
RS, UM, OF, AM | STA [[zp]]
RS, UM, OF, AM=1 | TYA
NF, RS, LE | STA abs,Y
RS, UM, OF, AM | TXS
RS, UM, LE | prefix2 | STZ abs
RS, UM, OF, AM | STA abs,X
RS, UM, OF, AM | STZ abs,X
RS, UM, OF, AM | reserved prefix |
A | LDY #byte
NF, RS, LE | LDA (zp,X)
NF, RS, UM, OF, LE, AM | LDX #byte
NF, RS, LE | LDA [[zp,X]]
NF, RS, UM, OF, LE, AM=1 | LDY zp
NF, RS, UM, OF, LE, AM | LDA zp
NF, RS, UM, OF, LE, AM | LDX zp
NF, RS, UM, OF, LE, AM | JSR [[abs,X]]
RS, OF, LE, AM=1 | TAY
NF, RS, LE | LDA #byte
NF, RS, LE | TAX
NF, RS, LE | prefix2 | LDY abs
NF, RS, UM, OF, LE, AM | LDA abs
NF, RS, UM, OF, LE, AM | LDX abs
NF, RS, UM, OF, LE, AM | reserved prefix |
B | BCS rel
RS | LDA (zp),Y
NF, RS, UM, OF, LE, AM | LDA (zp)
NF, RS, UM, OF, LE, AM | LDA [[zp]],Y
NF, RS, UM, OF, LE, AM=1 | LDY zp,X
NF, RS, UM, OF, LE, AM | LDA zp,X
NF, RS, UM, OF, LE, AM | LDX zp,Y
NF, RS, UM, OF, LE, AM | LDA [[zp]]
NF, RS, UM, OF, LE, AM=1 | CLV
| LDA abs,Y
NF, RS, UM, OF, LE, AM | TSX
NF, RS, UM, LE | prefix2 | LDY abs,X
NF, RS, UM, OF, LE, AM | LDA abs,X
NF, RS, UM, OF, LE, AM | LDX abs,Y
NF, RS, UM, OF, LE, AM | reserved prefix |
C | CPY #byte
RS, LE | CMP (zp,X)
RS, UM, OF, LE, AM | STA (abs),Y
RS, UM, OF, AM | CMP [[zp,X]]
RS, UM, OF, LE, AM=1 | CPY zp
RS, UM, OF, LE, AM | CMP zp
RS, UM, OF, LE, AM | DEC zp
NF, RS, UM, OF, AM | STA [[abs]],Y
RS, UM, OF, AM=1 | INY
NF, RS | CMP #byte
RS, LE | DEX
NF, RS | prefix2 | CPY abs
RS, UM, OF, LE, AM | CMP abs
RS, UM, OF, LE, AM | DEC abs
NF, RS, UM, OF, AM | reserved prefix |
D | BNE rel
RS | CMP (zp),Y
RS, UM, OF, LE, AM | CMP (zp)
RS, UM, OF, LE, AM | CMP [[zp]],Y
RS, UM, OF, LE, AM=1 | CMP zp,X
RS, UM, OF, LE, AM | DEC zp,X
NF, RS, UM, OF, AM | CMP [[zp]]
RS, UM, OF, LE, AM=1 | CLD
| CMP abs,Y
RS, UM, OF, LE, AM | PHX
RS, UM | prefix2 | JSR (abs)
RS, OF, LE, AM | CMP abs,X
RS, UM, OF, LE, AM | DEC abs,X
NF, RS, UM, OF, AM | reserved prefix | |
E | CPX #byte
RS, LE | SBC (zp,X)
NF, RS, UM, OF, LE, AM | STA (abs,X)
RS, UM, OF, AM | SBC [[zp,X]]
NF, RS, UM, OF, LE, AM=1 | CPX zp
RS, UM, OF, LE, AM | SBC zp
NF, RS, UM, OF, LE, AM | INC zp
NF, RS, UM, OF, AM | STA [[abs,X]]
RS, UM, OF, AM=1 | INX
NF, RS | SBC #byte
NF, RS, LE | NOP
| prefix2 | CPX abs
RS, UM, OF, LE, AM | SBC abs
NF, RS, UM, OF, LE, AM | INC abs
NF, RS, UM, OF, AM | reserved prefix |
F | BEQ rel
RS | SBC (zp),Y
NF, RS, UM, OF, LE, AM | SBC (zp)
NF, RS, UM, OF, LE, AM | SBC [[zp]],Y
NF, RS, UM, OF, LE, AM=1 | TRP #byte
| SBC zp,X
NF, RS, UM, OF, LE, AM | INC zp,X
NF, RS, UM, OF, AM | SBC [[zp]]
NF, RS, UM, OF, LE, AM=1 | SED
| SBC abs,Y
NF, RS, UM, OF, LE, AM | PLX
NF, RS, UM, LE | prefix2 | JSR (abs,X)
RS, OF, LE, AM | SBC abs,X
NF, RS, UM, OF, LE, AM | INC abs,X
NF, RS, UM, OF, AM | reserved prefix |
This table describes the EXT opcode page:
LSB-> MSB | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | ADD (E)
NF, RS, UM, LE | PEA (abs),Y
UM, OF, AM | PEA relwide
UM, OF, AM | MVN
| ADD #byte
NF, RS, LE | ASR zp
NF, RS, UM, OF, AM | PHE
UM | ORA (E)
NF, RS, UM, LE | ASR
NF, RS | TSB (E)
NF, RS, UM | ASL (E)
NF, RS, UM | ASR abs
NF, RS, UM, OF, AM | ASL abs,Y
NF, RS, UM, OF, AM | |||
1 | BEV rel
RS | PEA (abs,X)
UM, OF, AM | PEA (abs)
UM, OF, AM | MVP
| ASR zp,X
NF, RS, UM, OF, AM | TRB (E)
NF, RS, UM | ASR (E)
NF, RS, UM | ASR abs,X
NF, RS, UM, OF, AM | ASR abs,Y
NF, RS, UM, OF, AM | |||||||
2 | JSR (E)
RS, LE | LEA (abs),Y
NF, UM, OF, AM | LEA relwide
NF, UM, OF, AM | FIL
RS | ADE #byte
NF, RS, LE | RDL zp
NF, RS, UM, OF, AM | PLE
NF, UM | AND (E)
NF, RS, UM, LE | RDL
NF, RS | SCA (E)
RS, UM | ROL (E)
NF, RS, UM | RDL abs
NF, RS, UM, OF, AM | ROL abs,Y
NF, RS, UM, OF, AM | |||
3 | BOD rel
RS | LEA (abs,X)
NF, UM, OF, AM | LEA (abs)
NF, UM, OF, AM | BIT
NF, RS | ADE
NF, RS | RDL zp,X
NF, RS, UM, OF, AM | LDE #byte
NF, RS, LE | LLA (E)
NF, RS, UM, LE | RDL (E)
NF, RS, UM | RDL abs,X
NF, RS, UM, OF, AM | RDL abs,Y
NF, RS, UM, OF, AM | |||||
4 | PEA [[abs]],Y
UM, OF, AM | PSH
UM | ADS #byte
NF, RS, LE | LEA zp
NF, UM, OF, AM | PHB
UM | EOR (E)
NF, RS, UM, LE | JMP (E)
UM, LE | LSR (E)
NF, RS, UM | LSR abs,Y
NF, RS, UM, OF, AM | |||||||
5 | BLTS rel
RS | PEA [[abs,X]]
UM, OF, AM | PEA [[abs]]
UM, OF, AM | PLL
UM | ADS
NF, RS | LEA zp,X
NF, UM, OF, AM | PRB
NF, UM | LDB #byte
NF, RS, LE | ||||||||
6 | LEA [[abs]],Y
NF, UM, OF, AM | RMB
UM | ADB #byte
NF, RS, LE | RDR zp
NF, RS, UM, OF, AM | PLB
NF, UM | ADC (E)
NF, RS, UM, LE | RDR
NF, RS | JMP long
UM, OF, LE, AM | ROR (E)
NF, RS, UM | RDR abs
NF, RS, UM, OF, AM | ROR abs,Y
NF, RS, UM, OF, AM | |||||
7 | BGES rel
RS | LEA [[abs,X]]
NF, UM, OF, AM | LEA [[abs]]
NF, UM, OF, AM | WMB
UM | ADB
NF, RS | RDR zp,X
NF, RS, UM, OF, AM | RDR (E)
NF, RS, UM | RDR abs,X
NF, RS, UM, OF, AM | RDR abs,Y
NF, RS, UM, OF, AM | |||||||
8 | SUB (E)
NF, RS, UM, LE | PEA (zp,X)
UM, OF, AM | PEA rel
UM, OF, AM | HBS
NF, RS | SUB #byte
NF, RS, LE | PEA zp
UM, OF, AM | TAE
NF, RS, LE | BIT (E)
NF, RS, UM, LE | TYS
RS, UM, LE | STY (E)
RS, UM | STA (E)
RS, UM | STY abs,X
RS, UM, OF, AM | ||||
9 | BLE rel
RS | PEA (zp),Y
UM, OF, AM | PEA (zp)
UM, OF, AM | HBC
NF, RS | PEA zp,X
UM, OF, AM | TEA
NF | SXY
| STZ (E)
RS, UM | STX (E)
RS, UM | STZ abs,Y
RS, UM, OF, AM | ||||||
A | LDY (E)
NF, RS, UM, LE | LEA (zp,X)
NF, UM, OF, AM | LEA rel
NF, UM, OF, AM | INV
NF, RS | SBE #byte
NF, RS, LE | SAB
| LDA (E)
NF, RS, UM, LE | LDX (E)
NF, RS, UM, LE | LEA abs
NF, UM, OF, AM | STX abs,Y
RS, UM, OF, AM | ||||||
B | BGT rel
RS | LEA (zp),Y
NF, UM, OF, AM | LEA (zp)
NF, UM, OF, AM | BCN
NF, RS | SBE
NF, RS | SEB
| SAX
| LEA abs,X
NF, UM, OF, AM | LEA abs,Y
NF, UM, OF, AM | |||||||
C | CPY (E)
RS, UM, LE | PEA [[zp]],Y
UM, OF, AM | EXT
NF, RS | SBS #byte
NF, RS, LE | TPA
NF | CMP (E)
RS, UM, LE | TSY
NF, RS, UM, LE | DEC (E)
NF, RS, UM | PEA abs
UM, OF, AM | DEC abs,Y
NF, RS, UM, OF, AM | ||||||
D | BLES rel
RS | PEA [[zp,X]]
UM, OF, AM | PEA [[zp]]
UM, OF, AM | SWP
NF, RS | SBS
NF, RS | PEA zp,Y
UM, OF, AM | SAE
| SAY
| JSR long
RS, OF, LE, AM | PEA abs,X
UM, OF, AM | PEA abs,Y
UM, OF, AM | |||||
E | CPX (E)
RS, UM, LE | LEA [[zp]],Y
NF, UM, OF, AM | SBB #byte
NF, RS, LE | TAB
NF, RS, LE | SBC (E)
NF, RS, UM, LE | TEB
NF | RMB (E)
UM | INC (E)
NF, RS, UM | INC abs,Y
NF, RS, UM, OF, AM | |||||||
F | BGTS rel
RS | LEA [[zp,X]]
NF, UM, OF, AM | LEA [[zp]]
NF, UM, OF, AM | BSW
NF, RS | SBB
NF, RS | LEA zp,Y
NF, UM, OF, AM | TBA
NF | TBE
NF | WMB (E)
UM |
The grey fields note opcodes that are not used in the 65002.
Disclaimer
Last updated 2012-04-23. Last modified: 2013-11-17