The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

Program 1976
Message #1 Posted by mountain on 5 July 2006, 2:38 p.m.

RCL 1 RCL 2 RCL 3 RCL 4 + x + STO 9

R9 = ((R1+R2)*R3)+R4

Is this how it works?

      
Re: Program 1976
Message #2 Posted by Etienne Victoria on 5 July 2006, 2:45 p.m.,
in response to message #1 by mountain

R9=((R3+R4)*R2)+R1

Edited: 5 July 2006, 2:50 p.m.

      
Re: Program 1976
Message #3 Posted by Kiyoshi Akima on 5 July 2006, 2:49 p.m.,
in response to message #1 by mountain

No, you get R9=((R3+R4)*R2)+R1

A stack diagram may make this clearer (top of stack to the right, X to the left):

Op         X               Y   Z   T
RCL 1     R1
RCL 2     R2              R1
RCL 3     R3              R2  R1
RCL 4     R4              R3  R2  R1
+         (R3+R4)         R2  R1
*         R2*(R3+R4)      R1
+         R1+(R2*(R3+R4))

Each RCL puts a new item on the stack, pushing up the old contents. The operators work on the bottom one or two items.

Hope this didn't confuse you even more...

            
Re: Program 1976
Message #4 Posted by mountain on 5 July 2006, 3:03 p.m.,
in response to message #3 by Kiyoshi Akima

I'm trying to decipher a 1976 HP program and I find it a little confusing. In 1976, I was writing programs for the TI equivalent. But the diagram of the stack helps a lot. Thank you.

      
Re: Program 1976
Message #5 Posted by mountain on 5 July 2006, 2:55 p.m.,
in response to message #1 by mountain

Thank you!


[ Return to Index | Top of Index ]

Go back to the main exhibit hall