18 ÷
19►STOP
Finally we enter the last part of the program and after this we have
27 ×
28►÷
If you move using the cursors you will find .END. in line 29 (which is the end of the program) and
in line zero we find 00►{ 31-Byte PRGM }. Almost 1 byte per line of program.
As we said the HP-42S has about 7200 bytes of memory. Not bad! Just for comparison, the HP-32S
had 390 bytes and spent about 1.5 bytes per line. The HP-20S had only 99 lines/steps and the HP-9G
had 400 steps while HP-33S has 31KB (but hardly can take advantage of this due to a limit of 26
memories/labels, which is the same of 32S, and it spends about 3 bytes per line).
After entering the program just press EXIT. Now enter the numbers a, b and c of the equation into
R
00
, R
01
and R
02
. For example for the equation x
2
– 5x + 4 =0 we enter 1 STO 00 5 +/– STO 01 4
STO 02. Now we just press R/S (to run the program) and we get 1, and pressing it again we have 4.
6.2 More than one program in the memory
If we want to have more than one program in the memory we can use more than one program space.
To create another program space just press GTO . . .
The GTO command can be used in two different situations:
1. You are not in the programming mode. In this case you can use GTO . . to create
another empty program space, but this happens only if the current mode is not already empty.
• You can use GTO “label”. (We will see this below)
• You can also use GTO followed by “END” or “.END.” etc to move among
program spaces. (In this case I must admit 33S is better because the lack of this
complication)
2. You are in programming mode. In this case you cannot change the program space.
• You can use GTO ._ _ _ _ to move to a line where in the “_”'s you put the number
of the line where you want to go. (This will happen and it is not programmed)
• You can use GTO “label” (This will be programmed and will cause the program
when executed to jump to that label)
But what is a label? A label is a name we give to a position in the program using the LBL command
which is available in PGN.FCN (“program functions”) menu. To create a label you must be in the
programming mode ( PRGM) and then just press LBL and then enter a name (1 to 7 letters). If you
use only one letter it is local to the current program and not visible elsewhere, and thus won't appear
automatically when you press XEQ (just for comparison, in the 33S all labels are just one letter).
Example: In the programming mode PGN.FCN LBL AAA creates a label “AAA” which appears as
LBL “AAA” in the program. So when the program is running a statement such as GTO “AAA” is
encountered (for example), the program will jump to the line which has the LBL “AAA” instruction.
(Please note we don't need to press ALPHA to access the A, B, C, etc in this case). For example:
01 LBL “AA”
02 GTO “AA”
03 .END. (you don't enter this)