It is currently Sat Dec 16, 2017 11:28 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Jan 03, 2008 11:40 am 
Offline

Joined: Thu Jul 13, 2006 3:15 pm
Posts: 177
I was just wondering something. I was looking at someone's code who had based their reset routine off the sample code in the wiki:

http://nesdevwiki.org./wiki/index.php/Init_code

If you look on the wiki it sets the stack pointer to FF but then the clear mem routine runs which (I believe) clears it to zero.

In my code, I always set the stack pointer "after" I clear the memory.

Is the wiki wrong, or does it not really matter? I had thought that the person's code I was looking at was getting its stack hsoed (in FCEU's memory viewer), but I'm still pretty new to this so I'm not really sure.
Al


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 03, 2008 11:49 am 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
The stack pointer is a seperate register... it does not exist in addressable memory. It can only be changed by TXS (or by a stack push/pull). The clearmem routine is clearing the memory associated with the stack (the $01xx page), but not the stack pointer itself.

So in short... it doesn't matter which you do first, since they're both setting two seperate things.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 03, 2008 12:06 pm 
Offline

Joined: Thu Jul 13, 2006 3:15 pm
Posts: 177
Thanks.
Al


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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