Lately I am writing (or trying) an emulator for the 6502 NES CPU.
I am learning many many things, some of them really surprise me and I was wondering what's the explanation for those, in particular, two things came to my mind
- The existence of bugs, in particular the 6502 seems to have a bug in the indirect addressing mode, at least for the first processors (it affects the one used in the NES)
- Unofficial operation codes: Again, really surprising that there are codes not official yet usable, some of them seem to be totally useless (like DOP and TOP which are variations of NOP), and some of them seem to be composition of other operation codes (such SAX or DCP).
The question is, how is it possible that when manufacturing millions of those CPUs, they ended up with bugs (such the indirect addressing mode) and also, why on earth would you as a manufacturer include unofficial operation codes that may be removed in following revisions? Does this happen also with newer CPUs?