|
|
|
|
|
by peterevans
3024 days ago
|
|
My understanding is that in the 6502 (NMOS) chip, those other opcodes had undefined behavior, and you might crash if you executed one. So you'd need to know who was the manufacturer to be certain that opcode X was available. In the CMOS version (65C02), illegal opcodes are treated similarly to NOPs--they don't crash, and don't do anything other than spend cycles--with the caveat that certain of these "illegal" opcodes have specific numbers of cycles and bytes that they consume which are different from other illegal opcodes. More confusingly, there is an actual proper NOP instruction (0xEA), which consumes the one opcode byte and two cycles, which exists in both the CMOS and NMOS version of the chip. So some of the illegal opcodes are just like NOP, and eat one byte and two cycles; some eat two bytes, and 3 or more cycles; and there's at least one which not only eats 3 bytes, but eight (GASP!) cycles. Source: if it's possible for one to consider MOS emulation a hobby, then let's say it's a hobby of mine. |
|
(Some BBC Micro games definitely do use illegal opcodes, but I didn't take very careful notes when I was writing ver 1, rather a long time ago. For the current version, I just made sure the Lorenz 6502 test suite ran to completion.)