t3x.org / t3x / t3x-manual / 4A.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
4.9 Context Manipulation
TOC | Index | Back Next:
4.11 Arithmetic Instructions

4.10 Stack Manipulation

0xA013   CLEAN   N   -   CLEAN up argument stack

Remove N procedure arguments from the stack:

SP := SP + N*BPW

and then push the content of RR on the stack.

0x0010   DUP   -   DUPlicate TOS

Push the current top of the stack (S0), thereby duplicating it.

0x000F   POP   -   POP TOS

Pop the top element S0 and load it into the return register RR.

0xA012   STACK   N   -   adjust STACK

Move the stack pointer SP by N machine words:

SP := SP - N*BPW.

Moving the stack pointer `down' (N>=1) allocates space on the stack, moving it `up' (N<=-1) deallocates space. STACK is primarily used to allocate and release dynamic memory in procedures.

0x0011   SWAP   -   SWAP stack members

Exchange the values of S0 and S1.

Previous:
4.9 Context Manipulation
TOC | Index | Back Next:
4.11 Arithmetic Instructions