💾 Archived View for librehacker.com › gemlog › tech › 20220414-0.gmi captured on 2024-07-09 at 00:36:25. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-05-10)
-=-=-=-=-=-=-
This information applies to Mecrisp Stellaris Forth running on a rp2040 platform such as Rpi Pico.
Top of Stack (TOS) is stored in register r6. So a simple "i r r6" or "print $r6" will get you the TOS value.
The rest of the data stack is stored in RAM, with a point to the top value stored in register r7. The data stack is 32 bit cells, so "x /8dw $r7" will show the next eight values of the stack. Use "x /8hw $r7" if you want them printed as hex values instead of decimal.
Just keep in mind that whenever you pause execution while the interpreter seems to be idle, the interpreter is actually running various procedures to check for serial communication, so it might have some of its own stack data on top of yours.