Opcode

From C64-Wiki
(Redirected from illegal opcode)
Jump to: navigation, search

Opcodes (short for Operation code) are used when programming machine language.

There are ??? official opcodes for the 6510 CPU and ??? illegal opcodes.

Legal Opcodes[edit]

Examples:

Illegal Opcodes[edit]

Illegal opcodes are undocumented commands that evolved from the hardwired circuit design as a side-effect and were labelled "illegal" because they are not guaranteed to work stable.

Opcode matrix for MOS 6510[edit]

Illegale Opcodes are written small and italic.


x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF
0x BRK
imp
ORA
inx
KIL SLO
inx
NOP
zp
ORA
zp
ASL
zp
SLO
zp
PHP
imp
ORA
imm
ASL
akk
ANC
imm
NOP
abs
ORA
abs
ASL
abs
SLO
abs
1x BPL
abs
ORA
iny
KIL SLO
iny
NOP
zpx
ORA
zpx
ASL
zpx
SLO
zpy
CLC
imp
ORA
aby
NOP
imp
SLO
aby
NOP
abx
ORA
abx
ASL
abx
SLO
abx
2x JSR
abs
AND
inx
KIL RLA
inx
BIT
zp
AND
zp
ROL
zp
RLA
zp
PLP
imp
AND
imm
ROL
akk
ANC
imm
BIT
abs
AND
abs
ROL
abs
RLA
abs
3x BMI
abs
AND
iny
KIL RLA
iny
NOP
zpx
AND
zpx
ROL
zpx
RLA
zpy
SEC
imp
AND
aby
NOP
imp
RLA
aby
NOP
abx
AND
abx
ROL
abx
RLA
abx
4x RTI
imp
EOR
inx
KIL SRE
inx
NOP
zp
EOR
zp
LSR
zp
SRE
zp
PHA
imp
EOR
imm
LSR
akk
ALR
imm
JMP
abs
EOR
abs
LSR
abs
SRE
abs
5x BVC
abs
EOR
iny
KIL SRE
iny
NOP
zpx
EOR
zpx
LSR
zpx
SRE
zpx
CLI
imp
EOR
aby
NOP
imp
SRE
aby
NOP
abx
EOR
abx
LSR
abx
SRE
abx
6x RTS
imp
ADC
inx
KIL RRA
inx
NOP
zp
ADC
zp
ROR
zp
RRA
zp
PLA
imp
ADC
imm
ROR
akk
ARR
imm
JMP
ind
ADC
abs
ROR
abs
RRA
abs
7x BVS
abs
ADC
iny
KIL RRA
iny
NOP
zpx
ADC
zpx
ROR
zpx
RRA
zpx
SEI
imp
ADC
aby
NOP
imp
RRA
aby
NOP
abx
ADC
abx
ROR
abx
RRA
abx
8x NOP
imm
STA
inx
NOP
imm
SAX
inx
STY
zp
STA
zp
STX
zp
SAX
zp
DEY
imp
NOP
imm
TXA
imp
XAA
imm
STY
abs
STA
abs
STX
abs
SAX
abs
9x BCC
abs
STA
iny
KIL AHX
iny
STY
zpx
STA
zpx
STX
zpy
SAX
zpy
TYA
imp
STA
aby
TXS
imp
TAS
aby
SHY
abx
STA
abx
SHX AHX
aby
Ax LDY
imm
LDA
inx
LDX
imm
LAX
inx
LDY
zp
LDA
zp
LDX
zp
LAX
zp
TAY
imp
LDA
imm
TAX
imp
LAX
imm
LDY
abs
LDA
abs
LDX
abs
LAX
abs
Bx BCS
abs
LDA
iny
KIL LAX
iny
LDY
zpx
LDA
zpx
LDX
zpy
LAX
zpy
CLV
imp
LDA
aby
TSX
imp
LAS
aby
LDY
abx
LDA
abx
LDX
aby
LAX
aby
Cx CPY
imm
CMP
inx
NOP
imm
DCP
inx
CPY
zp
CMP
zp
DEC
zp
DCP
zp
INY
imp
CMP
imm
DEX
imp
AXS
imm
CPY
abs
CMP
abs
DEC
abs
DCP
abs
Dx BNE
abs
CMP
iny
KIL DCP
iny
NOP
zpx
CMP
zpx
DEC
zpx
DCP
zpx
CLD
imp
CMP
aby
NOP
imp
DCP
aby
NOP
abx
CMP
abx
DEC
abx
DCP
abx
Ex CPX
imm
SBC
inx
NOP
imm
ISC
inx
CPX
zp
SBC
zp
INC
zp
ISC
zp
INX
imp
SBC
imm
NOP
imp
SBC
imm
CPX
abs
SBC
abs
INC
abs
ISC
abs
Fx BEQ
abs
SBC
iny
KIL ISC
iny
NOP
zpx
SBC
zpx
INC
zpx
ISC
zpx
SED
imp
SBC
aby
NOP
imp
ISC
aby
NOP
abx
SBC
abx
INC
abx
ISC
abx

Links[edit]