We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS
Stack Pointer: Difference between revisions
From SnesLab
(what pushing/pulling does) |
(points to next available location) |
||
Line 5: | Line 5: | ||
1FFh is a common value to initialize the stack pointer to. | 1FFh is a common value to initialize the stack pointer to. | ||
Pushing things onto the [[stack]] decrements the stack pointer and pulling things increments it. | Pushing things onto the [[stack]] decrements the stack pointer and pulling things increments it. It points to the next available location on the stack. | ||
=== See Also === | === See Also === |
Revision as of 02:09, 11 August 2024
The Stack Pointer (SP) on the SPC700 is 16-bit, but the upper byte is fixed by the hardware to be 0x01.
On the 65c816, the only two instructions that modify the stack pointer (S) directly are TCS and TXS.[4] It is only fixed to be in page one in emulation mode on the '816.
1FFh is a common value to initialize the stack pointer to.
Pushing things onto the stack decrements the stack pointer and pulling things increments it. It points to the next available location on the stack.
See Also
References
- subparagraph 8.1.5 of page 3-8-4 of Book I of the official Super Nintendo development manual
- diversified activities: page 3-8-5 of Book I, lbid.
- Eyes & Lichty, page 31
- Eyes & Lichty, page 511 on TCS