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: Difference between revisions

From SnesLab
Jump to: navigation, search
m (→‎Reference: pluralize)
(added ref)
Line 1: Line 1:
The '''Stack''' is a buffer which remembers the state of subroutines that are currently executing.
The '''Stack''' is a buffer which remembers the state of subroutines that are currently executing.


On the [[65c816]], the stack is always in [[bank]] zero.  It can be thousands of bytes deep.<sup>[1]</sup>
On the [[65c816]], the stack is always in [[bank]] zero.<sup>[3]</sup> It can be thousands of bytes deep.<sup>[1]</sup>


In [[emulation mode]] it wraps within page one.<sup>[2]</sup>
In [[emulation mode]] it wraps within page one.<sup>[2]</sup>
Line 32: Line 32:
# https://wilsonminesco.com/816myths
# https://wilsonminesco.com/816myths
# Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#5.1.1
# Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#5.1.1
# section 2.11 of 65c816 datasheet: https://www.westerndesigncenter.com/wdc/documentation/w65c816s.pdf


[[Category:ASM]]
[[Category:ASM]]
[[Category:Inherited from 6502]]
[[Category:Inherited from 6502]]

Revision as of 19:33, 10 August 2024

The Stack is a buffer which remembers the state of subroutines that are currently executing.

On the 65c816, the stack is always in bank zero.[3] It can be thousands of bytes deep.[1]

In emulation mode it wraps within page one.[2]

The stack grows towards zero, but the most recently pushed byte is nontheless called the top of the stack. These instructions push things to the stack:

Pulling takes one cycle more than pushing. These instructions pull things from the stack:

Note the lack of PLK. PHS and PLS similarly do not exist.

See Also

References

  1. https://wilsonminesco.com/816myths
  2. Clark, Bruce. http://www.6502.org/tutorials/65c816opcodes.html#5.1.1
  3. section 2.11 of 65c816 datasheet: https://www.westerndesigncenter.com/wdc/documentation/w65c816s.pdf