mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-05 15:20:56 +11:00
79ce88c12c
and remove cfspack, which will not ever be used again.
17 lines
627 B
Plaintext
17 lines
627 B
Plaintext
Stack management
|
|
|
|
The Parameter stack (PS) is maintained by SP and the Return
|
|
stack (RS) is maintained by IX. This allows us to generally use
|
|
push and pop freely because PS is the most frequently used.
|
|
However, this causes a problem with routine calls: because in
|
|
Forth, the stack isn't balanced within each call, our return
|
|
offset, when placed by a CALL, messes everything up. This is
|
|
one of the reasons why we need stack management routines below.
|
|
IX always points to RS' Top Of Stack (TOS)
|
|
|
|
This return stack contain "Interpreter pointers", that is a
|
|
pointer to the address of a word, as seen in a compiled list of
|
|
words.
|
|
|
|
|