Page 3 of 4
the program catalog (Prgm 0 through 9) and 290 bytes of prog-ramming space available on the machine.
Note however that program memory cannot be backed up to any external device.
Programs can be assigned to primary keys, shifted keys and shift-hold key positions. Six conditionals are
present comparing two values. Each comparison pushes a 1 if true or 0 if false to the stack. Conditional
transfers are goto if true (displayed as GT in a program, but GOTOT on the keyboard overlay) and goto if
false (displayed as GF in a program, but GOTOF on the keyboard overlay), but note that these
conditionals consume the argument on the stack. A quick test for x=0? and a branch to a label if true is
(of all things) merely to place a GF XY instruction in a program and if the value in X is equal to zero, a
branch to label XY will occur. This works because a zero is a false argument and GF will branch to the
indicated label if the display contains a zero. An unconditional goto is also provided. Destinations for
these gotos are any of 100 global numeric labels, 00 through 99. Four levels of subroutines are available
using the CALL and RTN commands. Values can be displayed while a program is running using the
DISP command. Even a short prompt of letters can be displayed using the MSG command. This has
been put to good use to make a “high – low” number guessing game more fun.
If viewed as primarily a “macro recording” ability then some of the operating characteristics of HP 30b
programming will make more sense. For example, to access the inverse sine function in the Math menu,
the program steps will look like this:
:sI<=
, which will take four program steps, take
four bytes, and show as Math Input Down = on four lines in the program listing. Each key press required
to navigate through a menu is recorded as a separate step and uses a byte. Some commands are merged
and shown as one step. Examples are store, recall, and gotos.
How useful are 290 bytes? More than you might think. It is very easy to use these abilities to bring
functions buried in menus out to the keyboard for much easier access. If you find yourself needing access
to the inverse trig functions, short programs can pull them out of the Math menu and be assigned to the
shift-hold locations for sine, cosine and tangent . If you find the need to use the built-in probability
distributions, they can be brought out of the Math menu and assigned to keys. This is a great time saver.
Short programs have also been written for things such as a prime factor finder, a translation of the HP 25
lunar Lander game, base conversions for bases 2-10 and more.
Found? HP Solve.
The solver is accessible by first writing a program that evaluates an equation such
that it would equal zero, using memory registers to represent variables in the equation. For example, an
equation of X – Y = Z would be rewritten as X – Y – Z = 0 and entered as a program like this: RCL 1
RCL 2 – RCL 3 – RTN. Memory 1 would represent X, memory 2 represents Y and memory 3 represents
Z. Store values into memories 2 and 3 and SOLVE 1 will find the value of memory 1 that makes the
equation equal to zero. This forms the basis for the generalized odd days loan solver program found in
the HP Solve examples learning module. This program includes conditional tests and branching and is an
indication of the usefulness of the included HP Solve functionality.
What other goodies are included?
The mode menu settings can now be stored and recalled by pressing
store or recall and then
:u
. This key sequence brings up a 12 digit number with each position
corresponding to a mode menu item and its setting. The two rightmost digits for example control the
number of decimals displayed. Pressing
4:$:u
in run mode or in a program will change the
number of decimals displayed to four regardless of the original value. Pressing
314:$
:u
will change the operating mode to RPN and since 14 is an invalid value for the number of
decimal digits displayed, will not change the display setting. This is described and a table of these values
shown in the Programming Reference learning module.