Opcode numbers on 6502.txt

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
elsteveogrande
Posts: 1
Joined: Sun Dec 23, 2018 12:59 pm

Opcode numbers on 6502.txt

Post by elsteveogrande » Sun Dec 23, 2018 1:13 pm

Just wanted to mention something -- this page has a couple of minor mistakes. (And I'm not sure who to contact about it :)

http://nesdev.com/6502.txt

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.)

Code: Select all

  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: http://nparker.llx.com/a2/opcodes.html )

Thanks all! Cheers :beer:

User avatar
NovaSquirrel
Posts: 372
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Re: Opcode numbers on 6502.txt

Post by NovaSquirrel » Sun Dec 23, 2018 1:45 pm

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...

User avatar
dougeff
Posts: 2598
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: Opcode numbers on 6502.txt

Post by dougeff » Sun Dec 23, 2018 5:53 pm

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.
Last edited by dougeff on Sun Dec 23, 2018 6:09 pm, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES

User avatar
rainwarrior
Posts: 7636
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Opcode numbers on 6502.txt

Post by rainwarrior » Sun Dec 23, 2018 5:59 pm

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.

nocash
Posts: 1060
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: Opcode numbers on 6502.txt

Post by nocash » Mon Dec 24, 2018 12:20 pm

BS - LDA - Zero Page,X
What kind of humans would write BS instead B5?

tepples
Posts: 21708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Opcode numbers on 6502.txt

Post by tepples » Mon Dec 24, 2018 12:38 pm

People who aren't fans of the series Babylon 5 perhaps?

nocash
Posts: 1060
Joined: Fri Feb 24, 2012 12:09 pm
Contact:

Re: Opcode numbers on 6502.txt

Post by nocash » Mon Dec 24, 2018 1:57 pm

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.

Post Reply