[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 6502 illegal opcodes questions
In article <d4CdnR_y__CUmfXZnZ2dnUVZ_s-dnZ2d@comcast.com>,
"Michael J. Mahon" <mjmahon@aol.com> writes:
|> True, but the decoding in the 6502 is handled by a kind of PLA, so
|> it would likely not be very expensive (in real estate) to trap or
|> NOP the invalid combinations.
You are too today-centric.
Back in the 1970s even that "likely not very expensive" decision raised
the costs significantly and introduced complexity to the chip which was
unnecessary from a technical and marketing point of view.
|> If I had been designing the 6502,
|> I likely would have made the same choice.
Probably everyone would have. Leaving out the illegal opcode traps or
mapping them to NOP did no harm, implementing them would just raise
costs.
|> (But as a coder, I would have regarded undefined ops as a curiosity,
|> not as an opportunity to save a few cycles at the expense of future
|> utility.)
If a platform stays identical over a long-enough period of time
then why not starting to squeeze the last out of it by using undocumented
behavior. After all, the use of such undocumented behavior in the end
led to enhanced capabilities, even the chip designers didn't envision
in the first place.
I'm especially thinking about all the fancy stuff coders did with the
C64's video chip, which like the original 6502 (and the hereon based 6510)
is a hardwired design.
And back then noone really thought about future utility. Maybe apart from
the Apple II those machines were pretty much integrated & rather unexpandable
boxes -- even more, in the early homecomputer and video game market there was
no sense for a "family concept" where software from the old machine would just
run on its next generation successor, cause that most likely was an entirely
new box.
Think of Atari 400/800 vs. 600/800XL, Commodore VIC20 vs. C64, Sinclair ZX81
vs. Spectrum just to name a few.
Rainer