Older calculators like the HP 41 use numbered storage registers to store data. Usually the registers are numbered from zero to N, where N represents the highest register number. In the case of the HP 41 the number of data registers is set by the SIZE function. The HP 41 may be SIZEd to store up to 319 data. Normally, however, the size is not set beyond 100 (normal default value - registers 0 thru 99) because the less convenient store or recall indirect function is needed for "three digit" register numbers.
Emulating numbered storage registers to store data on the HP 48 is easy, and the following programs may be used to do this. Any object may be stored, including text objects and program objects. The programs utilize lower case names to avoid conflict with the HP 48 reserved variable names SIZE, STO, and RCL. The byte count and check sum (#) in Hexadecimal is given for each program.
'Sto' << 1 + REG SWAP ROT PUT 'REG' STO >>
'Size' << 1 'REG' Created by 'Size' program, List of stored objects.
'Rcl' << 1 + REG SWAP GET >> |
'Size' creates a list of zeros as place holders for the objects that are stored. If you view this list by pressing the REG menu key it is desirable to be in STD display mode to avoid excessive zeros in the display. See Table 1 for 'Size' speed and memory measurements. Memory is the primary limit for the number of registers.
'Size' (1) | SX | GX | REG (2) | GX (3) |
10 | 0.132_s | 0.089_s | 30 Bytes | 0.713_s |
100 | 0.366_s | 0.254_s | 255 Bytes | 0.879_s |
1000 | 2.941_s | 2.061_s | 2505 Bytes | 2.689_s |
SPD (4) | 1.972 Mhz | 3.756 Mhz | 3.752 Mhz |
To store an object place the object on level two of the stack with the register number on level one and press Sto (STO in the menu). Pressing ENTER is not required if the register number is on the command line. To recall an object to level one press the register number followed by Rcl (RCL in the menu). Sto and Rcl will appear as STO and RCL in upper case letters because the menu characters are small size - size one. Character size one uses only upper case.
This "register" storage technique may also be used to avoid menu clutter when programs are called by other programs. If a program calls another program stored in "register" n, the sequence: n Rcl EVAL runs the program. Be sure to have any program required inputs on the stack. If you frequently want run programs add the following program to your menu. It checks the recalled object. Itf it is aprogram it is run, if not, the object is tagged with "Not Prog.".
'Run' << Rcl DUP TYPE IF 8 SAME THEN EVAL ELSE "Not Prog." TAG END >>
If you remember register numbers easily, this storage method may be used to store names, addresses, dates, notes, etc., without the object names showing up in the menus. Many different "data bases" may be stored in the machine at the same time. Store your alternate REG List under another name. When you use a particular "data base" store its name in REG.
If you want to eliminate register zero and start counting from one simply remove the 1 + in 'Sto' and 'Rcl'. This is better in some ways. If the size is 100 the registers are 1 thru 100. Unmodified, the registers start from zero instead of one and the the registers are 0 thru 99. You may have it either way. The programs in this Technical Note are designed to emulate the HP 41.