UNDOCUMENTED OP CODES for the 6502
Below is a list of undocumented opcodes for the
6510 (the version of the 6502 used in Commodore 64 and
128). The 6510 is compatible with the 6502, but of
course this needn't be true for these undodumented
features! Things like this may differ between various
manufacturers, too.
NOTE: I haven't tested these opcodes myself - no
responsibility is taken for any damage caused by
using them!!!
Below is
1) a description of the various instructions, in a
mixture of 6502 assembler and C.
2) a table of the opcodes for each instruction and
addressing mode.
Have fun!
AAX: M = A & X
AMA: ORA #238; AND M; TAX
ANA: AND M; CARRY=BIT 7
ANB: AND M; CARRY=BIT 7
AXM: X = A & X - M
AXS: S = A & X; M = A & X & #17
DCP: DEC M; CMP M
ISB: INC M; SBC M
LAN: ROL M; AND M
LAS: LDA M; TAX; TXS
LAX: LDA M; TAX
LOR: ASL M; ORA M
RAD: ROR M; ADC M
RAM: AND M; LSR A
RBM: AND M; LSR A
REO: LSR M; EOR M
SBC: SBC M
TEA: M = A & X & (M + 1)
TEX: M = X & (M + 1)
TEY: M = Y & #1
XMA: A = X & M & (A | #238)