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

Re: 6502: what happens when an illegal inst is encountered?



In article <DEVERNAY.95Sep6192030@eire.inria.fr>,
Frederic Devernay <devernay@news-sop.inria.fr> wrote:
>I'm working on a II+ emulator and would like to know what happens if
>the 6502 CPU encounters an illegal instruction (e.g. $54), does it
>generate the same interruption as BRK (i.e. it pushes PC and P and
>jumps to the address at $FFFE) or is it a different kind of
>interruption?

Usually, it causes *no* sort of interruption, but instead does something
bizarre to the registers.  A lot of the "unused" opcodes have interesting
effects - and some of these were intentionally used by those who were
attempting to copy-protect games, as these opcodes were not well-understood
by many.  I've included a table below my .sig that I pulled off the net 
a while back that lists many of these opcodes.

Tim. (shoppa@altair.krl.caltech.edu)