HP Forums
Program 1976 - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: Program 1976 (/thread-95501.html)



Program 1976 - mountain - 07-05-2006

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

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

Is this how it works?


Re: Program 1976 - Etienne Victoria - 07-05-2006

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

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


Re: Program 1976 - Kiyoshi Akima - 07-05-2006

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 - mountain - 07-05-2006

Thank you!


Re: Program 1976 - mountain - 07-05-2006

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.