Why do some processors have unofficial codes and/or bugs?

-1

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

  1. 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)
  2. 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?

Juan Antonio Gomez Moriano

Posted 2014-12-07T23:39:27.760

Reputation: 99

Question was closed 2014-12-08T01:26:31.887

Answers

1

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?

Why are CPUs any different than software? Companies spend millions of dollars on software development, manufacturing and marketing. Why then would a flawed product get loose?

I mean Apple is a major computer and data company right? How then can one explain how such a big company would—for example—release the iPhone 4 with bad antenna issues? Or heck, release a few seconds of white noise as a Taylor Swift song in Canada?

Your presumption is because a company is big and has checks & balances that those checks and balances should then be flawless. Which is simply not the case in any human endeavor no matter how many layers of quality assurance one has.

In the case of unofficial operation codes, it can easily be explained by rushed development or code being readied for future development. If a new CPU is made, the engineers will most likely have a massive list of desired features. Some will be made. Some will not. And some will be made yet would be impractical to officially stamp as “Yes this is working, uses this.”

This is the reason—for example—why pretty much every CPU out there has revisions. And why in the multi-CPU systems—ones with multiple physical CPUs—it is often important that all CPUs match the same production batch.

JakeGould

Posted 2014-12-07T23:39:27.760

Reputation: 38 217

What you assume is a bad might have been on purpose. Nintendo was known to do that sometimes. Undocumented features are undocumented for a reason. – Ramhound – 2014-12-08T00:20:49.780

@Ramhound Never said undocumented features were bad. Just said development might have been rushed. – JakeGould – 2014-12-08T00:24:50.733

1

how is it possible that when manufacturing millions of those CPUs, they ended up with bugs

  • It's really, really hard to design CPUs let alone CPUs that are totally bug-less.

  • Often subtle bugs are only discovered in the real-world once a product is released, because there is no way you can test to the scale and breadth that millions of end-users can.

  • Competition plays a huge part. Getting to the market first, or at least in a timely fashion, is important otherwise you loose business to competitors and eventually go out of business. That pressure versus the pressure to create quality is why you often get something that is only good enough.

  • For some reason, in the IT world especially, the demand for new and improved massively outweighs the demand for updated and refined. It's your fault as much as mine. For example, if Intel continuously refined the 80486 CPU I suppose it would be exceptionally close to bug-free by now. But what could you do with an 80486 these days, really? I certainly wouldn't be buying one today, nor would you.

why on earth would you as a manufacturer include unofficial operation codes that may be removed in following revisions?

Unofficial op-codes exist for a variety of reasons:

  • Some are found to have bugs or side-effects at a point during development where it would be too expensive and/or time-consuming to fix or remove.

  • Some are the result of time constraints where they could not be tested thoroughly enough and there isn't enough certainly that they will work correctly.

  • Some are put in place as a proof-of-concept or prototype for the future and might see adoption in later CPU revisions/generations.

  • Some exist for internal testing purposes only.

  • And no doubt some are put in there just for fun, aka Easter Eggs

misha256

Posted 2014-12-07T23:39:27.760

Reputation: 10 292