c8923075@frey.nu.oz.au (Chris Baird) (12/04/90)
Here is my list (but prob. not all) of un-documented op-codes for
the 6502 and simular microprocessiors. I mainly use these to get extra
addressing modes on some of the arith operations (ie: ASL $xxxx,Y). Most
of these I discovered 'by hand' a few years ago, and it's interesting to note
how the lower nybble corresponds to the addressing mode in many of the
operations (maybe a short-cut in the 6502's microcode?)
Note: ANX = A AND X (bitwise AND)
& AAA-BBB Means operation AAA, followed by BBBB
Dual operatiors
===============
Operation Suggested ADDRESSING MODES
mnemonic zz zz,X (zz,X) (zz),Y zzzz zzzz,X zzzz,Y
------------------------------------------------------------------------------
ASL-ORA ALO 07 17 03 13 0F 1F 1B
ROL-AND RLA 27 37 23 33 2F 3F 3B
LSR-EOR LRE 47 57 43 53 4F 5F 5B
ROR-ADC RAC 67 77 63 73 6F 7F 7B
ANX-STA SAX 87 +97 8F 9F
LDX-TXA LAX A7 +B7 A3 B3 AF BF
DEC-CMP DCP C7 D7 C3 D3 CF DF DB
INC-SBC ISC E7 F7 E3 F3 EF FF FB
+ : Addressing mode zz,Y
Immediate mode operations
=========================
Operation Hex value
--------- ---------
AND #nn 0B nn
or 29 nn
or 2B nn
AND #nn - LSR A 4B nn
AND #nn - ROR A 6B nn
TXA - AND #nn 8B nn
ANX - SUB #nn CB nn (Note: Subtract without carry)
SBC #nn EB nn
or E9 nn
No-Operations
=============
Single byte (classic NOP): 1A 5A 7A DA FA 2 cycles
Double (NOP zz): 04 34 44 54 64 74 80 89 FA 3 cycles
Triple: (NOP zzzz): 0C 1C 3C 5C 7C DC FC 4 cycles
HALTing "Crash operations", Maybe interuptible
==============================================
HLT 02 12 32 42 52 62 72 82 92 B2 C2 D2 E2 F2
Notice the "ANX", "HLT" and "SUB" operations, which are not in the
standard instruction set. 'Undocumented features' (bugs) in the 6502?
--
Chris Baird
Undergrad BSc(Physics) @ Newcastle Uni (OZ!)
C8923075@frey.nu.oz.au) (12/12/90)
Does anyone remember the sys location to begin the old Scott Adams Adventure game on the Vic-20? Eric