Program Boundaries (Lbl And Rtn) - HP -20S Owner's Manual

Scientific calculator
Hide thumbs Also See for HP-20S:
Table of Contents

Advertisement

Checksum. After you have entered a program you can check to see
if the keystrokes are entered correctly by comparing the checksum
listed in this manual to the checksum created by your program. The
checksum is a unique hexadecimal value assigned to the specific key-
strokes that you entered. To view the checksum, press and hold (]
for a moment while you are in Program mode. The checksums
for the examples in this manual are valid if there is only one program
in memory. The checksum for the pipe area program on page 63 is
9Ad7.
Program Boundaries (LBL and RTN)
If you want to store more than one program in your
HP-20S, then the program needs boundaries—a label to
mark its beginning and a return to mark its end.
Program Labels. Programs and segments of programs (called
routines) start with a label that acts as a name. Use a label to separate
programs any time you have more than one program in memory. The
keystrokes to create a label are [¢>]
followed by A through F or 0
through 9. A label is used to execute a specific program or routine.
When you press
label, the program pointer moves to the speci-
fied label and begins execution. (The program pointer is an internal
pointer that marks the line that is displayed while in Program mode.)
All of memory is searched for the specified label, starting at the pro-
gram pointer. If no label is found, the message Error - LbL is
displayed.
Return. Programs end with a return ([>][RTN]) instruction. When a
program finishes running, the RTN instruction returns the program
pointer to line 00. If the last line of the program is not a RTN instruc-
tion, the program pointer automatically returns to line 00. The
keystrokes are (] [RTN]. Using [¢>]
in subroutines is discussed
on page 76.
66
6: Programming

Advertisement

Table of Contents
loading

Table of Contents