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

Re: 6502 illegal opcodes questions



Michael J. Mahon <mjmahon@aol.com> wrote:
> is really missing is discipline--on the part of the original designer,
> who failed to "protect" the undefined space (to save a few transistors),

Not really.  At the time every gate on the chip was expensive and saving
them was a valid concern.  When I studied VLSI design we called these
undefined cased "Don't care" conditions; invalid input meant we didn't
care about the output.  You can see this on some cheap LED digital
clocks where pressing wierd button combinations can cause odd displays;
invalid input.  That can actually cut down the number of gates by 20%
or more and so reduce the cost, accordingly.

Handling these "don't care" conditions actually requires a level of
optimisation which doesn't exist in a naive design.  So it's not a case
of the designers failing to protect the undefined space, but of them
optimising the circuitry for efficiency.

It is a valid design decision.

With the 6502 essentially not having a microcode level, this
optimisation is exposed to the programmer.  This also shows up in the
regularity of the opcodes, and allowed hackers to make educated guesses
as to what the undocumented codes could do.

-- 
                                 Stephen  Harris
                                usenet@spuddy.org
      The truth is the truth, and opinion just opinion.  But what is what?
       My employer pays to ignore my opinions; you get to do it for free.