[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6502 CPU



Nathan Mates (nathan@cco.caltech.edu) wrote:
: In article <3mbd1l$av@naurouze.cert.fr>,
: Jean-Francois Fabre <fabre@puigmal.cert.fr> wrote:
: >Does any of you know about the undocumented instructions on the 6502 ?

:    The 6502 does have some sort of undocumented instructions, but they
: are not standardized. They can vary from one machine to the next, so
: there is no acceptible list of undocumented instructions. If you have
: a 6502 (not 65C02) based machine (Apple ][, ][+, unenhanced //e), you
: could by trial and error determine their behavior on your machine, but
: it probably wouldn't work on any other 6502 machine.

You mean unimplemented rather than undocumented. The unused opcodes are 
documented as being able to freak your machine if you use them. The results
are undefined and thus unpredictable.

:    To make things worse, the 65C02 (used in enhanced //e, //c, //c+,
: and the GS in emulation mode) has no useful undocumented instructions.
: Anything unlisted acts just like a NOP ($EA), so you can put all the
: undocumented instructions you want in your program, but it won't do
: anything useful.

According to Eyes & Lichty, unused opcodes use differing numbers of clock
cycles and increment the program counter by differing amounts on a 65C02.
Since there are no unimplemented opcodes in the 65802/816, using this feature 
is not recommended. Also, the 802/816 instructions are for the most part usable
in emulation mode.
-- 
Randy Shackelford                                 I was internet
shack@southwind.net                               when internet wasn't cool