The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

HP33s and HP32sII programmation difference
Message #1 Posted by David Boileau on 13 July 2006, 3:41 p.m.

First, excuse me for my bad english.

I just bought a HP33s as a replacement for my HP32sII which if fallen from my desk

I use the HP33s in RPN mode and I have just written a small program that I used 20 times a day with the 32sII

The aim of the program is to compute the total area in cm² of y circles of radius x (in mm) This is very, very useful for my job (steel reinforcement in concrete)

I enter data in this manner : number of circles ENTER diameter in mm then XEQ A

The program :

A0001 LBL A A0002 x² A0003 400 A0004 / A0005 pi A0006 x A0007 x

And that's all.

With the HP32sII the answer was only in the x register of the stack. With the HP33s, the answer is in both register x and y. And this is a BIG problem for me (I use the program several times in a row and I sum the answers) I have tried the program by entering manually the instructions, and so I only get the answer in the x register ! So my program is correct !

I've tried 36 tips in the program to change this (for example, A0008 R(low)). But with every tip I get answer in both X and Y or no answer at all

Precision : I begin data introduction when all registers of the stack are at zero

Does someone has an idea ? Does the stack behave differently between HP32 and HP33 ?

Thanks a lot

David

      
Re: HP33s and HP32sII programmation difference
Message #2 Posted by Paul Brogger on 13 July 2006, 3:59 p.m.,
in response to message #1 by David Boileau

So the program is:

   A0001 LBL A 
   A0002 x2 
   A0003 400 
   A0004 / 
   A0005 pi 
   A0006 x 
   A0007 x

correct?

You might want to put

   A0008  RTN
at the end. (With a "RTN", my copy of the above gives the answer in x only.)

(How is it there are 400 mm2 / cm2? Maybe I'm missing something . . . )

Anyway, a version that uses less stack would be:

   A0001 LBL A 
   A0002 x2 
   A0003 x 
   A0004 pi 
   A0005 x
   A0006 400 
   A0007 /
   A0008 RTN 

Hope it works for you . . .

Edited: 13 July 2006, 4:20 p.m.

            
Re: HP33s and HP32sII programmation difference
Message #3 Posted by David Boileau on 14 July 2006, 2:44 a.m.,
in response to message #2 by Paul Brogger

Now it works !

I've added a simple "A0008 RTN" statement and it works

Many thanks from Belgium !

David

                  
RTN
Message #4 Posted by bill platt on 14 July 2006, 9:02 a.m.,
in response to message #3 by David Boileau

Hi David,

the RTN function is useful and sometimes but not always necessary. It takes the program pointer back to line000 and stops execution. It is a guaranteed way to stop at a certain place. Without it, the machine will continue to execute each succeeding line.

Now for another refinement:

If you put your program into memory so that it is the first program (starting immideatly after "PRGM TOP", then you don't need to hit "execute A" except for the 1st use. Since RTN will bring the pointer back to "PRGM TOP", all you need to do for the next run is enter the values, and press "R/S".

If you are doing summation, you could also put a "STO+A" command at the end of the program. As long as you clear A before beginning, you will have a an automatic summation in the A register, at the end of your series calculations.

Edited: 14 July 2006, 9:03 a.m.

                        
Re: RTN
Message #5 Posted by David Boileau on 14 July 2006, 10:14 a.m.,
in response to message #4 by bill platt

Thanks for the explanation

In fact the program worked well on the HP32sII without RTN, but the HP33s needs it. Strange, but it is so. I was not aware of the role of the RTN statement. I must apply "RTFM" for myself...

Your tip with R/S works and you've made me win one key press ! Cool ! I was not fully aware of the role of R/S too...

For the sommation, your tip with STO+ is a good idea, but I rarely must sum more than 3 results, so this is not so useful.

Thanks to everybody who have read the posts

                              
Re: RTN
Message #6 Posted by bill platt on 14 July 2006, 10:22 a.m.,
in response to message #5 by David Boileau

If you take Paul Brogger's advice and conserve stack, then you'll be able to carry two previous results and a current result. (See my stack history table for an explanation.)

Edited: 14 July 2006, 10:23 a.m.

      
Re: HP33s and HP32sII programmation difference
Message #7 Posted by bill platt on 13 July 2006, 4:00 p.m.,
in response to message #1 by David Boileau

my batteries died a few days ago. I'll put new ones in and try tonight.

You are entering the diameter in mm, not the radius.

You did not list the "RTN" final statement.

This *should * work identically.

It seems to me that you must have an <enter> command floating in the end of your sequence on the 33s. In RPN mode there would be no reason for it to DUP to the Y register.

Here is a step-by-step stack activity for your program: (empty fields are zeros. Sorry for listing in "upside down".

Given 750 bars of 6mm Diameter rod:

750
ENT
6
x^2
400
/
3.14
X
X
RTN

x 0 750 750 6 36 400 0.09 3.14159 .28274 212.05 y 0 0 750 750 750 36 750 .09 750 z 0 0 750 750 t 0 0

            
Re: HP33s and HP32sII programmation difference
Message #8 Posted by Paul Brogger on 13 July 2006, 4:05 p.m.,
in response to message #7 by bill platt

Quote:
You are entering the diameter in mm, not the radius.

That explains the 400 . . .


[ Return to Index | Top of Index ]

Go back to the main exhibit hall