Next: Control Instructions Up: The Instructions Previous: Equality

Stack Manipulation

pop simply removes the top stack element. This instruction is only used in non-functional programs, e.g. in loops, where the result of the loop body is simply discarded.

remove removes elements from the stack, except the topmost one. This instruction is used at the end of a let statement where the local variables have to be discarded.

dup duplicates the element of the stack. This is used to push a function argument or a local variable (as an operand) on the stack.

set-nth replaces the element with the top stack element. This instruction is used for assignments (e.g. via setq). The set-nth- instruction additionally removes the top stack element (see section 6.3).


Harold Boley & Michael Sintek (sintek@dfki.uni-kl.de)