Next: Branch and Comparison
Up: The Instruction Set
Previous: Class Instances and
Stack manipulation instructions directly manipulate the operand stack.
- pop. Pop one word from the operand stack.
No operands. Stack: ..., word ....
- pop2. Pop two words from the operand stack.
No operands. Stack: ..., word2, word1 ....
- dup. Duplicate one word on top of the operand stack. No operands.
Stack: ..., word ..., word, word.
- dup2. Duplicate two words on top of the operand stack. No operands.
Stack: ..., word2, word1 ..., word2, word1, word2,
word1.
Other stack manipulation instructions are available to duplicate one or two
words on the operand stack and put them a number of words down and to swap
two words on the operand stack.
mark@bottom.xs4all.nl