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
(→Reference: more correct paragraph terminology) |
(effective address) |
||
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
The '''Stack Pointer''' | The '''Stack Pointer''' (SP) points to the next [[stack]] location available for pushing to. In stack addressing modes it is used for the effective address. | ||
On the [[65c816]], the only two instructions that modify the stack pointer directly are [[TCS]] and [[TXS]]. | On the [[SPC700]] it 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]].<sup>[4]</sup> 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. | |||
=== See Also === | === See Also === | ||
* [[TSX]] | |||
* [[TSC]] | |||
* [[PUSH]] | * [[PUSH]] | ||
* [[POP]] | * [[POP]] | ||
Line 9: | Line 17: | ||
* [[Program Counter]] | * [[Program Counter]] | ||
=== | === References === | ||
# subparagraph 8.1.5 of [https://archive.org/details/SNESDevManual/book1/page/n182 page 3-8-4 of Book I] of the official Super Nintendo development manual | |||
# diversified activities: [https://archive.org/details/SNESDevManual/book1/page/n183 page 3-8-5 of Book I], lbid. | |||
# [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/31 page 31] on The Stack Pointer | |||
# [[Eyes & Lichty]], [https://archive.org/details/0893037893ProgrammingThe65816/page/511 page 511] on TCS | |||
[[Category:ASM]] | [[Category:ASM]] | ||
[[Category:Registers]] | [[Category:Registers]] | ||
[[Category:Inherited from 6502]] | [[Category:Inherited from 6502]] |
Latest revision as of 20:21, 12 November 2024
The Stack Pointer (SP) points to the next stack location available for pushing to. In stack addressing modes it is used for the effective address.
On the SPC700 it 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.
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 on The Stack Pointer
- Eyes & Lichty, page 511 on TCS