Download Print this page

HP 35s User Manual page 2

Scientific calculator - indirect register data packing program
Hide thumbs Also See for 35s:

Advertisement

hp calculators
HP 35s Indirect register data packing program
The HP 35s and indirect registers
The HP35s contains registers or variables that can be referenced directly or indirectly. Variables A through Z can be
directly addressed, as in a ºeA instruction. Indirect addressing uses two of these direct variables as indices that
hold the location or address where an operation is to be performed. The two variables that are used this way are I and
J. The indirect registers begin at address 0 and can go up to 800, if the user allocates that many. That is 801 additional
storage registers compared to the earlier HP 33s calculator.
It is also possible to address the direct variables and the statistics variables indirectly using addresses of -1 through -32.
Address -1 would refer to the direct variable A, address -26 would refer to the direct variable Z, and -27 trough -32
would refer to the statistical summation registers. This is shown in a table on page 14-22 of the HP 35s user's guide.
The way indirect addressing works is to store the number corresponding to the register you wish to use in either I or
J. Then you perform a ºe7 or ºeA (or any other allowed operation). For example, if you wish to
recall a value stored in direct register A, you can either press hA or store -1 into I by ºe7 and then
perform a h7. Both will recall the value stored in A.
At first glance, that may not appear to be worth doing, since it takes more key presses to use the indirect method.
However, where it becomes very useful is when you need to work with a lot of numbers, often within a program, or when
you may not be able to know in advance where the number you wish to use is stored.
Saving program memory space
For example, suppose you have 20 numbers you wish to sum. A direct program might be written having these numbers
stored in A through T. The program to sum them (which would take 41 lines of code and at least 120 bytes of
memory), might look like:
A001 LBL A
A002 RCL A
A003 RCL B
A004 +
On the other hand, a program using the indirect registers might have the numbers stored in indirect locations 1 through
20. The program to sum the 20 values might look like this one. This program only takes 10 lines of code and only 32
bytes of code. Sure, developing the second program might take a little more time than the first, but it comes at a great
reduction of program memory space used.
A001 LBL A
A002 20
A003 STO I
A004 RCL (I)
Saving indirect storage space
To allocate a portion of the HP 35s memory to hold indirect registers, store a non-zero value into the highest register
needed. If you need 100 registers to hold numbers and if locations 0 to 99 will work for your need, storing a non-zero
value into indirect storage location 100 will allocate HP 35s calculator memory to create the block of indirect registers 0
through 100. Warning: If you store a zero into memory location 100, the HP 35s will dynamically reclaim all zero indirect
hp calculators
A005 RCL C
A006 +
A007 RCL D
A008 +
A005 DSE I
A006 RCL (I)
A007 +
A008 DSE I
- 2 -
...
A039 RCL T
A040 +
A041 RTN
A009 GTO A006
A010 RTN
HP 35s Indirect register data packing program - Version 1.0

Advertisement

loading