HP -16C Owner's Handbook Manual page 78

Table of Contents

Advertisement

76
Section 7: Programming Basics
A
instruction will stop the program indefinitely at the line
after the [R/S]. You can resume program execution (from that line)
by pressing
in Run mode—thatis, from the keyboard.
Data Input
Every program must take into account how and when data will be
supplied. Data input can occur before executing the program or
during planned interruptions in the program.
Prior Entry.
1.
You can store the values (with [STO]) into a storage register,
from which they will be recalled (with a programmed [RCL))
within the program.
For example, the concatenation program could recall a value
for the word size instead of writing it into the program:
Keystrokes
[e](LBL]A
1
Recalls the word size from R;.
If data will be used in the first line(s) of a program, you can
enter it into the stack before starting the program. Don't
start the program with [ENTER]—the [LBL], [GSB], and
functions terminate digit entry and enable stack lift.* This
method was used in the preceeding example.
The presence of the stack makes it possible to load more than
one variable prior to running a program. Keeping in mind
how the stack moves with subsequent operations and how
the stack can be manipulated (as with [xxy] and [R¥]), it is
possible for you to write a program to use variables which
have been keyed into all four registers.
This is the method used on page 75, where the two numbers
were placed into the X- and Y-registers before running the
program. In fact, you could store the lower and higher order
* Note, however,that
is neutral with respect to stack lift. There is a complete list of
neutral and lift-disabling functions in appendix B.

Advertisement

Table of Contents
loading

Table of Contents