It is currently Fri Feb 22, 2019 5:15 pm

 All times are UTC - 7 hours

 Page 1 of 1 [ 14 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: More nestest woes :)Posted: Fri May 27, 2016 4:31 am

Joined: Mon May 16, 2016 7:41 am
Posts: 20
Continuing to work through nestest... I'm down to diverging at line 5530...

Here's the nestest log:

Code:
5529:     E756  18        CLC                             A:3E X:17 Y:44 P:E7 SP:FB CYC:262 SL:118
5530:     E757  83 49    *SAX (\$49,X) @ 60 = 0489 = 00    A:3E X:17 Y:44 P:E6 SP:FB CYC:268 SL:118
5531:     E759  EA        NOP                             A:3E X:17 Y:44 P:E6 SP:FB CYC:286 SL:118

According to this doc, ZN flags should be set for the AAX/SAX operation:

Code:
AAX (SAX) [AXS]
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
AND X register with accumulator and store result in memory. Status
flags: N,Z

------------|-----------|---|---|---
Zero Page   |AAX arg    |\$87| 2 | 3
Zero Page,Y |AAX arg,Y  |\$97| 2 | 4
(Indirect,X)|AAX (arg,X)|\$83| 2 | 6
Absolute    |AAX arg    |\$8F| 3 | 4

In the nestest log we can see that A and X are 0x3E (0011 1110) and 0x17 (0001 0110). I believe the result is 0x16 (0001 0110). This should result in both Z and N flags being 0. However the status value in the next row is 0xE6 (1110 0110) which has both Zero and Neg flags set to 1!

So; what am I missing? Are ZN actually supposed to be set, or is my maths wrong?

Top

 Post subject: Re: More nestest woes :)Posted: Fri May 27, 2016 4:41 am

Joined: Mon May 16, 2016 7:41 am
Posts: 20
Fro now in the interests of progressing I'm gonna assume this is an error in the linked nesdev doc, as this page also suggests no flags are set for SAX ops.

If anyone can confirm/deny I'd appreciate it

Top

 Post subject: Re: More nestest woes :)Posted: Fri May 27, 2016 6:49 am

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1458
The SAX/AAX instruction is a combination of STA and STX, neither of which update any status flags, so this one doesn't either.

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

Top

 Post subject: Re: More nestest woes :)Posted: Fri May 27, 2016 6:53 am

Joined: Mon May 16, 2016 7:41 am
Posts: 20
Quietust wrote:
The SAX/AAX instruction is a combination of STA and STX, neither of which update any status flags, so this one doesn't either.

Thanks for confirming

Is anyone able to update this doc to avoid confusion?

Top

 Post subject: Re: More nestest woes :)Posted: Fri May 27, 2016 7:58 am

Joined: Mon Jan 03, 2005 10:36 am
Posts: 3141
Location: Tampere, Finland
DaNES wrote:
Is anyone able to update this doc to avoid confusion?

It'd be pointless to try to fix all of these old documents. The front page is not trying to be a reference, it's just a collection of documents from various different sources. Generally speaking, when researching something, you should use multiple sources and cross-check their claims, because there's a lot of bad information out there.

This is why NESDev front page has the notification "The docs linked below are old and may contain inaccurate information."

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

Top

 Post subject: Re: More nestest woes :)Posted: Fri May 27, 2016 8:54 am

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21115
Location: NE Indiana, USA (NTSC)
Perhaps the implication is that old inaccurate docs are worse than useless, and that as a site admin with shell access, it's my duty to keep an updated copy alongside the unmodified* original version. The biggest effort I've done toward that was my retrospective on koitsu's nestech.

Top

 Post subject: Re: More nestest woes :)Posted: Fri May 27, 2016 9:28 am

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7224
I don't know why you linked that other thread, but Bregalad started a thread about the main page a year ago, though I don't think anything was done in response:
http://forums.nesdev.com/viewtopic.php?f=14&t=12621

I don't think there's a harm in hosting old versions of the docs (they're worth preserving, misinformation and all), but I do think there's a harm in keeping them on this site's entry page, and I said as much in that thread.

I'm not sure why you'd want to modify any of the old documents; this seems a waste of effort to me. Much better to clearly direct someone to the good documentation instead, which we happen to keep in a convenient, centralized place.

Top

 Post subject: Re: More nestest woes :)Posted: Fri May 27, 2016 10:40 am

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8144
Location: Seattle
(Tangent) Perhaps the right thing to do, similar to what zeromus did for Disch's documents on the wiki, is to copy all the text documents from the front page into the wiki. Then "ordinary" people can edit them.

... but that might run into licensing issues. Ugh.

(Plus, yes, the front page should be a redirect to the wiki)

Top

 Post subject: Re: More nestest woes :)Posted: Sat May 28, 2016 1:20 am

Joined: Mon May 16, 2016 7:41 am
Posts: 20
thefox wrote:
DaNES wrote:
Is anyone able to update this doc to avoid confusion?

It'd be pointless to try to fix all of these old documents. The front page is not trying to be a reference, it's just a collection of documents from various different sources. Generally speaking, when researching something, you should use multiple sources and cross-check their claims, because there's a lot of bad information out there.

This is why NESDev front page has the notification "The docs linked below are old and may contain inaccurate information."

The problem is, these docs all turn up in Google results so it's likely that the huge majority of people reading them and using them as a reference never see that text and assume because of where they're hosted they contain good info. When you find conflicting information it's hard to know which is correct (especially if you've already had issues with the nintendulator nestest log)

Ofcourse, finding all the issues isn't realistic, but if people find them and point them out, surely it'd make this a better resource if they were corrected?

Or if they're known to be bad and you don't wish to update them, maybe insert a note at the top of each of the old docs that it might contain incorrect info and is not being maintained and a link to a better place to use?

It's really hard to find info on all these opcodes; there are so many incomplete (and now seemingly incorrect) docs. Knowing the best place to check (and knowing that it evolves and is updated as required) would be great. Building an emulator is already hard even with all the correct information!

Top

 Post subject: Re: More nestest woes :)Posted: Sat May 28, 2016 12:27 pm

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7224
DaNES wrote:
these docs all turn up in Google results

I was curious, so I tried to search for stuff to see what comes up, but I couldn't find any example where an outdated nesdev.com document comes up directly in a search.

What did you search for that ended up doing this?

My other question is whether the searches pointed directly to nesdev.com hosted versions of these, or to myriad other versions scattered about the internet?

1. If they do happen to turn up prominently in google searches, could we use a robots.txt or something to prevent this?

2. If the versions you find aren't actually hosted on nesdev.com, updating them here wouldn't do any good anyway.

Top

 Post subject: Re: More nestest woes :)Posted: Sat May 28, 2016 12:31 pm

Joined: Mon May 16, 2016 7:41 am
Posts: 20
rainwarrior wrote:
DaNES wrote:
these docs all turn up in Google results

I was curious, so I tried to search for stuff to see what comes up, but I couldn't find any example where an outdated nesdev.com document comes up directly in a search.

What did you search for that ended up doing this?

I searched for nesdev SAX and the linked doc was the third result.

Note: robots.txt does not stop things being indexed, it only controls crawlling (I know this sounds crazy, but it's sadly true).

Top

 Post subject: Re: More nestest woes :)Posted: Sat May 28, 2016 1:04 pm

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7224
Hmm, well at least it's nice that the Wiki comes up first. The Wiki doesn't really have an adequate reference for the unofficial opcodes, or even the official ones, though; I can see why you couldn't get what you wanted from the first 2 google hits there.

For the time being, it might help if we linked some known good documents prominently in the Wiki articles. In particular the CPU unofficial opcodes article could use a link to a good reference in its lead, I think, since there's no attempt to document the actual opcode function in that article.

Top

 Post subject: Re: More nestest woes :)Posted: Sat May 28, 2016 1:10 pm

Joined: Mon May 16, 2016 7:41 am
Posts: 20
Yeah, I keep ending up at that wiki page and being disappointed!

The other references I've found useful have been:

- http://www.6502.org/tutorials/6502opcodes.html
- http://www.oxyron.de/html/opcodes02.html

First one doesn't include illegal opcodes so I was mostly just using the second one towards the end. Didn't notice anything incorrect in it (though I've only passed nestest; not sure how complete that is).

Top

 Post subject: Re: More nestest woes :)Posted: Sat May 28, 2016 1:16 pm

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21115
Location: NE Indiana, USA (NTSC)
That page's "External links" page links to Graham's doc on oxyron.de, the same document that the ca65 Users Guide cites for names of the unofficial instructions. But it doesn't say a lot about flags, especially for ARR #ii (\$6B), which sets C and V strangely.

The lead of Programming with unofficial opcodes cites 65xx Processor Data as well as Graham's doc.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 14 posts ]

 All times are UTC - 7 hours