
hp calculators
HP 35s Writing a Simple Program
hp calculators - 5 - HP 35s Writing a Simple Program - Version 1.0
the new label’s name at the beginning of each line. Figure 7 shows an example of this; if both program A and program B
were typed, then after the RTN in program B, the first line of program A is displayed on the calculator screen.
Figure 11
Each label can be used only one time, and the HP 35s treats the lines from one label until the next label as a separate
program. It is also possible to have a program with no label, from the “PRGM TOP” until the first label.
To list the programs in the HP 35s, press the keys ¹u to get the “Memory” menu, and then 2to get a display
of programs. If the algebraic version of the circle program has been entered then the calculator screen will look like
Figure 12. If only program A was typed, the screen will be as in Figure 13.
Figure 12
This means that the program with label B is the first program in memory, and that it is 25 bytes long. A byte is a piece of
calculator memory made up of 8 bits, and a bit is the smallest piece of memory, a single “0” or “1”. The HP 35s has more
than 29,000 bytes of memory available to hold programs and equations entered by the user. Given this much memory, a
long program could have up to 999 program lines, and that is why program line numbers are 3 digits long. The up and
down arrows at the right of the screen mean that there are more programs in the calculator – information about each
program in turn is displayed if the up or down arrow keys are pressed. If both the programs A and B have been entered,
press Øto see information about program A.
Figure 13
Another tool to help in writing programs is the program checksum. To see the checksum for program A, press
¹Î. While the Îkey is held down, the calculator will show:
Figure 14
CK=DAF1means that the checksum for program A is the hexadecimal number DAF1. (The checksum for program B is
AD0A.) If the program was not typed correctly, then the checksum will be different. Press the key labeled Åat the
bottom left of the keyboard to cancel the display of information about programs.
The checksum has several purposes:
•If a program is correctly copied to the HP 35s from a web page or a book – the HP 35s manual has many useful
example programs – then the checksum on the HP 35s will be the same as the checksum given with the
program. If the checksum is not the same, a mistake was made and the program should be checked and
corrected before it is used.