This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Opcode numbers on 6502.txt

Opcode numbers on 6502.txt
by on (#230866)
Just wanted to mention something -- this page has a couple of minor mistakes. (And I'm not sure who to contact about it :)

The STA section has a couple of incorrect opcode numbers. (Same incorrect numbers are in the by-opcode-number listing, though they're in the right spot.)

  STA                  STA Store accumulator in memory                  STA

  Operation:  A -> M                                    N Z C I D V
                                                        _ _ _ _ _ _
                                (Ref: 2.1.2)
  | Addressing Mode| Assembly Language Form| OP CODE |No. Bytes|No. Cycles|
  |  Zero Page     |   STA Oper            |    85   |    2    |    3     |
  |  Zero Page,X   |   STA Oper,X          |    95   |    2    |    4     |
  |  Absolute      |   STA Oper            |    80   |    3    |    4     |   <-- opcode should be 8D
  |  Absolute,X    |   STA Oper,X          |    90   |    3    |    5     |   <-- opcode should be 9D
  |  Absolute,Y    |   STA Oper, Y         |    99   |    3    |    5     |
  |  (Indirect,X)  |   STA (Oper,X)        |    81   |    2    |    6     |
  |  (Indirect),Y  |   STA (Oper),Y        |    91   |    2    |    6     |

I noticed this after being tripped up for a while when decoding some instructions incorrectly.

(Another opcode map for reference: )

Thanks all! Cheers :beer:
Re: Opcode numbers on 6502.txt
by on (#230869)
That's a document that's just up for historical reasons alongside the others on the archive page and many of those are known to be wrong in some fashion. Though, this looks like a bad OCR? I could see D and 0 getting confused somehow.

Maybe it would be beneficial to have a robots.txt up to prevent people from finding those when looking for actual resources (assuming that's what happened here)? But then that would complicate things if you were specifically looking for those old documents...
Re: Opcode numbers on 6502.txt
by on (#230887)
Looks like Optical Character Recognition (OCR) error. (someone scanned a text page and didn't correct the errors it made.

80 -> 8D

I also commented, several years ago, that this document incorrectly lists PLA as setting no flags. It sets Z and N flags depending on the new value of A.
Re: Opcode numbers on 6502.txt
by on (#230888)
This isn't an OCR document. (None of the docs on the old main page are, AFAIK.)

That's just a plain human transcription error. Probably was typed up in EDIT.COM. They did duplicate the error when they made corresponding opcode tables further down in the document, too...

According to the description on the archive page, it was based on the C64 Programmer's Reference Guide. You can see the table they were copying on page 251 (and again on 258), though this source does not have the corresponding errors. (Also gets PLA correct.) Not sure if there were multiple revisions of this book.
Re: Opcode numbers on 6502.txt
by on (#230907)
BS - LDA - Zero Page,X

What kind of humans would write BS instead B5?
Re: Opcode numbers on 6502.txt
by on (#230910)
People who aren't fans of the series Babylon 5 perhaps?
Re: Opcode numbers on 6502.txt
by on (#230912)
Did you just say that the author of the txt file thinks that Babylon 5 is BULLSHIT?
On the other hand, Eighty and Ninety instead of Eight'dee and Nine'dee does almost certainly hint on voice recognition software with slang filter.