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

Re: 6502 illegal opcodes questions



John Selck wrote:

> Some illegals are quite useful, like SHX/SHY which in some cases can be
> used as STX absolute,Y / STY absolute,X if you use the right. Also you
> can do a CPU test and use different code on different CPUs. The demo
> "Oneder/Oxyron" does this. It works on 6502 with illegal opcodes, and on
> 65816 it uses a slower but illegal-free code.

This is reasonable on the C64 where all machines were fitted with
6502's, and in the case of a 65816 it's accelerated, so a slower code
section is acceptable.

The Apple II series is essentially 3 platforms, and 3 CPU generations,
all backwards compatible.

I'll concede there is a potential fringe case where a piece of code was
so tight that downconverting from 65C02 to 6502 broke it, and it was
fixable using an undocumented instruction. Damned if I can think of an
example though; there's almost always another way to find a cycle or
two.

Matt