[comp.sys.hp] Minimum SIZE Utility

dex@hpcvlx.HP.COM (Dex Smith) (11/16/88)

                  A Minimum SIZE Utility for the HP-42S

For those memory-conscious HP-42S programmers out there that would rather
use storage registers than variables, here's a utility that is essentially
a programmable "minimum SIZE."  (The calculator's SIZE function cannot use
indirect addressing; nor does it need to be since the storage registers are a 
matrix and there are matrix functions to accomplish the same thing.)

Suppose you are writing a program that uses storage registers R00 through
R32.  For your program to run, the minimum SIZE is 33 registers.
Start your program like this ...

                    01 LBL "WHATEVR"
                    02 33
                    03 XEQ "MSIZE"
                        .
                        .
                        .

The "MSIZE" (Minimum SIZE) utility determines the current SIZE and increases
it if neccessary.  Here's the listing:

                    00 { 35-Byte Prgm }
                    01 LBL "MSIZE"
                    02 SF 25
                    03 RCL "REGS"
                    04 FC?C 25
                    05 GTO 00
                    06 DIM?
                    07 x
                    08 X<Y?
                    09 X<>Y
                    10 LBL 00
                    11 1
                    12 DIM "REGS"
                    13 END

"MSIZE" never decreases the SIZE, and therefore, never destroys any data.
If REGS does not exist (detected with flag 25, ignore next error), it
is created.  Also note that if REGS is complex, it remains complex. (If
you want REGS to be complex and it's not, add 0+i0 to it like this:
0 [ENTER] <shift>[COMPLEX] [STO] [+] |REGS|.)


Hack away!

Dex Smith
Corvallis Workstation Operation
Corvallis, Oregon

P.S.  For you HP-42S flamers:  The HP-42S was never meant to be an HP-41 
"replacement."  It is an HP-15C replacement that happens to have the
following characteristics:

    *  An enhanced, upward-compatible HP-41C/CV programming language (thus,
       the product number: 42).

    *  Powerful and easy-to-use matrix and complex number operations.

    *  Object-oriented data types (similar to the HP-28).  Variables and
       stack registers can hold any type of data.

    *  Built-in applications for equation solving, numerical integration,
       matrices, statistics, and base converstions.

    *  An affordable price tag:  $120 list (especially appealing to students).

(For those that require I/O and customized expansion, the HP-41CV and HP-41CX
are still available.)

Jake-S@cup.portal.com (Jake G Schwartz) (11/19/88)

Thanks, Dex, for your info on the thinking behind the 42S. Any additional
insight into the handhelds is always appreciated.
               Jake Schwartz