HP35s meaning of indirect address 0/hp32sii keyboard


Hi Forum,

proud owner of the new 35s since a few days, I'm a bit puzzled by the indirect variables 0-800. I came accross the VIEW(I)/VIEW(J) bug, but that was already described earlier in

the 48g forum

I'd also like to apologize if this has been brought up before, but I could not find it back in the forum. It seems that some editing took place, e.g.

for this message.

Now, I wrote the little program to delete all indirect variables

Length=30, CHKSM=EE33

C001 LBL C
C002 0.800
C003 STO I
C004 0
C005 STO (I)
C006 ISG I
C007 GTO C004
C008 RTN

to obey the point 2. on page 14-24 of the manual. However, after runnung the program, the number of variables is still > 700 according to the MEM menu, and only after saying


(which takes .5 seconds or so) the memory used by indirect variables
is gone. (memo to HP: in the HP35Sii, there should be a CLR INDIRECT or so in the MEM menu.)

So, is there a special meaning for (0)?

On another point: I bought the 35s, which appeard at the right moment, as a replacement for my 32Sii, whose keys started to fail. I took it apart following

these instructions

an will glue in a little slice of rubber to make the case press against the board.

On that occasion, I noticed that the 32S can also display messages using equations and flag 10. Was this a documented feature?

Thanks for reading this up to here,

yours sincerely, Peter.


I made that point (about clearing indirect registers) before, but the post seems to disappeared... Assuming we've got 50 in reg 50 that makes MEM to report 51 indirect regs. As you've noticed those can be cleared and memory reclaimed at once only if you did store 0 in reg 0 *after* doing so for the rest of them ???

This works:

U001 LBL U
U002 50
U003 STO I
U005 STO(I)
U006 DSE I
U007 GTO U005
U008 STO I
U009 STO(I)
U010 RTN




I made that point (about clearing indirect registers) before, but the post seems to disappeared...

It will show up again. Meanwhile, Google cache has it, or most of it:




Thanks Gerson, now I saw it there.


p 1-5 CLVARx to clear indirect bank.


I've missed that, thanks; MEM still reports 1 indirect register available - the *0* one :) so - back to

and also CLVARx does not work in a program... so - back to the above :)

Edited: 18 Aug 2007, 5:46 p.m.


Yes, CLVARx clears the indirect registers GREATER than the number given to it as an argument.

So, give it a 0 and it clears 1 and up.

It is mentioned on page two of the indirect register learning module found here:

Indirect register learning module for the 35s


Thanks, Gene, but that's not the point; The point is (given we have 50 in reg 50) - after :

Q001 LBL Q
Q002 0.05
Q003 STO I
Q005 STO(I)
Q006 ISG I
Q007 GTO Q005
Q008 RTN
MEM reports 50 regs and :

doesn't give an error messsage


Edited: 18 Aug 2007, 6:30 p.m.


To be fair, having the calculator report 50 registers makes complete sense.

When you store a value in to a register, the indirect register memory block is essentially a contiguous array of values.

If you stored a value in register 50, the calc allocates a block of memory up to and including 50. That's why you don't get an error for accessing register 49 -- it's already there (I dunno if you would get an error for 51, I've not played with a 35s).

Otherwise it would have to keep track of not just stored values, but "dirty" values, which would simply consume yet more memory, and access would be even slower than it may be now.

If the calculator kept track of individual registers, it would need to track their number and their location in memory. If you wanted to fetch the value, the calculator would then have to look up the list of "used" registers for the register you wanted, and look up it's actuall address, and finally the value. That's a lot of looking up!

Instead, HP traded memory for speed, being conscious of the fact that most folks would be doing most of their register dancing at the lower limits (who uses register number 743 in normal work anyway?), and that they'd most likely use contiguous blocks of registers (since they're easily leveraged as arrays).

This technique simply gives better performance, a reasonable trade off, and makes overall memory management much easier.


You've missed the point - 0 has been stored in all indirect registers and still the system reports their existence. Storing 0 in I and 0 in (I) fixes it, system reports 0 indirect registers.


Hmm. Yes, I had seen the point you were making. I was just commenting on the CLVARx portion. :-)

Try this...do the loop counting down rather than up and see if that does it differently.


I did, just look a few posts up; Looping down lives 1 register intact - reg 0; Looping up leaves all 50; In both cases if you don't store 0 in I and then indirectly 0 in (I) *at the end of the process* you don't get the expected 0 indirect regs. That makes me and the original poster to think about "special" meaning of the 0 register, features, bugs, misprints etc, etc, etc... :)




Thanks! And thank you for not posting RTFM!

Cheers, Peter.


I have question about indirect variables. I read manual, but I little confused. It say it variable that not defined beforehand. Is this like temp variable in programming that only there when program run and gone after. Or is this like not declaring a variable? Then further in manual it say is useful for controlling loops. So is it like array?

I guess I just not understand what I and J be. Can someone give me simple explanation and why I might use it.


Vincze, refer to the link in Gene's post in this thread. You really need to be looking at those training modules since he has already done the work of explaining these topics to those who do not understand them.


Thank you my friend, I will do.


Ok, I read Gene's article, but now I more confused. On page two of Gene's article, it say

This becomes very useful is when you need to work with a lot of numbers, often within programs, or or when you may not be able to know in advance where the number you wish to use is stored.

How you not know where to store value? When I write program, I create variables that I name, and I store value there. How someone not know where to store value if you declare variables. I think I missing very fundamental point of this, so please excuse me being ignorant.


Google "indirect addressing"


Okay, I say fervent prayer to Saint Google and see what he have to say.


Okay, I understand now. It basically an indirection array. That make sense to me now. Not sure when I would use on calculator, but, it nice to have.



You might enjoy reading about programming on the HP-41C. There was a link not long aog here to a complete HTML facsimilie of the manual.

The 41 makes large use of "indirection" as it is known. It is useful for more than just getting to the "extra" registers.

Best regards,



My friend Bill, thank you for that suggestion. Yes, I do remember that link, and I shall see if I can track it down and look into that. It would be nice to conceptualize why I might use indirection on calculator. In programming I have used many times, but I just can't grasp why I would use on calculator.


Hi Vincze,

It would be nice to conceptualize why I might use indirection on calculator. In programming I have used many times, but I just can't grasp why I would use on calculator.

Indirection is great to use to pass a parameter of several memory locations to a subroutine.

For example:

Several years ago, I was writing a program to calculate the psychometric properties of air. I had several subroutines that would be called for each of the air streams - Outside Air, Room Air and Mixed Air. Instead of trying to pass all the variables on the stack, I would pass only the single index value. For example, 10 for Outside air, 20 for Room Air and 30 for Mixed air.

For each of the air streams, the parametes were stored in sequential memory locations - R11-15, R21-25, and R31-35. The subroutine would then use the index variable to extract and work on the respective air stream. The results could be stored in R16-19, R26-29, R36-39.

A similar method was then used to printout the results - a single subroutine that used the index to determine which air stream to print.

It worked great. Unfortunatelly, I got sidetracked about halfway through the project and never finished the program. Still want to get back to it one of these days.



Hi Vince,

another use of the indirect variables is to use it as a parameter stack when recursively calling a subroutine. (Like a higher language does for you in the background.) As an example, see

Towers of Hanoi on the HP32s

(I apologise for this self-promotion)

which shifts around the towers of Hanoi using a recursive prescription:

void move (int n, int source, int target) {
if (1 == n) {
std::cout << "Move disk from " << source << " to " << " target
<< std::endl;
move (n-1, source, 6-target-source);
move (1, source, target);
move (n-1, 6-target-source, target);

Or, maybe a bit simpler: Factorials: n! = n * (n-1)!

int factorial (int n) {

if (n <= 1) // we're done and know the answer
return 1;

return n * factorial (n - 1);

Of course, these are more academic examples, in real life things might be done differently.

Other (more down to earth application) could be a chi-square test

(wiki article here)

where you use the indirect variables to represent a histogram with a previously unknown number of bins.

Cheers, Peter.

Possibly Related Threads...
Thread Author Replies Views Last Post
  HP35s Program Four Slings Lift Calculation Jean-Marc Biram (Australia) 2 1,098 12-16-2013, 07:21 PM
Last Post: Jean-Marc Biram (Australia)
  HP35s Calculator Max Rope Tension Program Jean-Marc Biram (Australia) 10 2,201 12-12-2013, 12:03 AM
Last Post: Jean-Marc Biram (Australia)
  New website address for Meindert Kuipers' MLDL2000? Garth Wilson 2 647 08-11-2013, 01:43 PM
Last Post: Meindert Kuipers
  HP41 Functions Address Table (F.A.T.) Antoine M. Couëtte 6 1,036 07-21-2013, 02:48 AM
Last Post: Antoine M. Couëtte
  WP34s indirect addressing of alphanumeric labels Eduardo Duenez 4 857 06-06-2013, 08:29 PM
Last Post: Eduardo Duenez
  Trouble entering a HP35s program line Arno 2 766 04-05-2013, 06:28 PM
Last Post: Arno
  HP35s scientific calculator GREG W THOMAS 4 909 03-22-2013, 06:49 AM
Last Post: Thomas Radtke
  Cheap hp32sii in bad condition on sale on Taobao Waon Shinyoe (China) 1 635 03-01-2013, 08:35 PM
Last Post: Raymond Del Tondo
  HP35s "MEMORY CLEAR" flashes Mark Paris 1 616 08-31-2012, 07:35 PM
Last Post: Bart (UK)
  HP32SII takes 120 to process a command Bruce Larrabee 2 580 08-25-2012, 05:42 AM
Last Post: Bruce Larrabee

Forum Jump: