It is currently Tue Oct 17, 2017 7:19 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Small Error in 6502.txt
PostPosted: Fri Dec 17, 2004 6:23 am 
Offline
User avatar

Joined: Fri Dec 17, 2004 5:46 am
Posts: 1
Location: Austin, TX
In http://nesdev.com/6502.txt , there are at least two errors in the section that goes over the ADC instruction and its opcodes.

It lists the opcodes for instructions of the form "ADC $ABCD" and "ADC $ABCD, X" as 0x60 and 0x70 respectively, but this is contradicted by two other documents ( http://nesdev.com/opcodes.txt ) and 6502jsm.doc in ( http://nesdev.com/6502jsm.zip ), which state that the opcodes are 0x6d and 0x7d respectively.

Sorry if this was already mentioned. I ran a couple of searches but they didn't turn up anything that looked related on this message board.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 9:46 am 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
That document is also wrong in the way it describes negative branches (it implies that $FF is a branch of -127 when it's really a branch of -1) I recall its opcodes being off in the occasional area as well (like the ones you brought up).

I'd recommend:

http://www.obelisk.demon.co.uk/6502/reference.html

I use that page for all my instruction/opcode/cycle lookups. I've used it several times and am pretty certain it's error free.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 04, 2005 11:13 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2961
Location: Tampere, Finland
It would be good to get some kind of a note about this matter on NesDev or take the whole document away once and for all. The link Disch gave seems decent, and it's also much more nicer to read HTML-formatted documents than ASCII ;)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 09, 2005 1:08 am 
Offline

Joined: Tue Apr 05, 2005 7:30 pm
Posts: 179
Most of that document was copied straight from the oldskool c64 programmer's reference manual...actually it *is* listed correctly in the opcode table and in the ADC opcode list of the actual manual...problem is, whoever copied out of the book most likely made typing errors. I don't exactly see where in the doc it implies that FF is -127.

Having said all of that, I find the instruction source code following the opcode table all but useless. But that's just my opinion.

_________________
Be whatever the situation demands.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 09, 2005 11:53 am 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
doppelganger wrote:
I don't exactly see where in the doc it implies that FF is -127.


From the text:

Code:
  eg  bit no.  7 6 5 4 3 2 1 0    signed value          unsigned value
      value    1 0 1 0 0 1 1 1    -39                   $A7
      value    0 0 1 0 0 1 1 1    +39                   $27
  Instruction example:
    BEQ $A7
    $F0 $A7
  This instruction will check the zero status bit. If it is set, 39 decimal
  will be subtracted from the program counter


That is wrong.

$A7 is NOT -39. $A7 is -89. $D9 is -39

The pseudo code for each instruction at the bottom is very useful when starting out for a more detailed explaination of how the instructions work. 6502.txt also gets into more detail and explains things a little better than some other docs -- but due to misprints/errors it's not reliable for lookup/reference of the technical details (like opcode numbers, possibly even cycle counts). The link I gave before is consitant and 100% error free -- and could be used as a "last word" on that stuff -- which is why I brought it up.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 09, 2005 12:17 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
Heh... that example looks strikingly like signed magnitude representation of signed numbers, which is wrong - the 6502 uses two's complement (where, to get a negative version of a number, you invert all of the bits and then add 1).

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 11, 2005 9:43 pm 
Offline

Joined: Sun Sep 19, 2004 11:07 pm
Posts: 154
The 0/D errors are likely bad OCR.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 24, 2005 7:06 am 
Or just confusion between "sixty" and "six d".


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: tepples, Yahoo [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group