The Stack; Review Of Stack Concepts - HP -28S Manual

Advanced scientific calculator
Hide thumbs Also See for HP-28S:
Table of Contents

Advertisement

19
The Stack
This chapter reviews what you've learned about the stack and de-
scribes commands for manipulating objects on the stack. Also briefly
described is the use of local variables to simplify stack manipulations.
Review of Stack Concepts
The stack is a sequence of numbered
levels,
each holding one object.
The objects you key into the command line are put on the stack when
you execute ENTER. The first object in the command line is the first
object put on the stack. Each object is put in levell, lifting other ob-
jects to the next higher stack level. The stack can grow indefinitely
(within the limits of calculator memory), so you don't need to think
about how many objects are on the stack before entering more
objects.
In general, a command removes input objects (called
arguments)
from
the stack and replaces them with output objects (called
results)
to the
stack. For example, the function
+
removes two arguments from levels
1 and 2, replacing them with their sum in level 1.
The arguments must be present on the stack before the command is
executed. This type of logic, where the command comes after the ar-
guments, is called
stack logic, postfix logic,
or
RPN,
for
Reverse Polish
Notation,
in honor of the Polish logician Jan Lukasiewicz (1878-1956).
The results of a command are available as arguments for the next
command. If you're not ready to use the results yet, simply leave
them on the stack-they'll be available when you're ready for them.
176
19: The Stack

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents