EXC/ x<>Rn for stack efficiency
06-14-2017, 07:38 PM
Post: #17
 Matt Agajanian Senior Member Posts: 986 Joined: Dec 2013
RE: EXC/ x<>Rn for stack efficiency
(06-14-2017 06:39 PM)Dieter Wrote:
(06-14-2017 10:19 AM)Matt Agajanian Wrote:  I've been trying to figure this out and I'm getting confused and forgetting the stack at the exchange steps. So, please help me. Maybe you've already responded with the answer. But, the ends I'm trying to accomplish removes the former value from the stack and leaves the exchanged value on the stack with Y, Z, and (if possible) the T registers intact.

This â€“ leaving the whole stack or most of it unchanged â€“ usually is not required at all. At least after some slight recoding usually you do not have to hold three intermediate values on the stack.

Example: Calculate R1 + R2*R3^R4 while pushing pi into R4

Code:
AOS      RPN -------------- RCL      RCL 3 01       RCL 4 +        Pi RCL      STO 4 02       Râ†“ *        y^x RCL      RCL 2 03       * y^x      RCL 1 Pi       + EXC 04 =

RPN is different. You can do most calculations without having to keep track of lots of intermediate results â€“ you always work with just two numbers. ;-)

(06-14-2017 10:19 AM)Matt Agajanian Wrote:  All I'm trying to do is leave the exchanged value in the X register without the forner register content in the Y register.

?!? After the exchange the former register content is in X of course.
That's what the EXC command does. As well as the four-step-code in my first post. Y and Z are preserved.

Dieter

Dieter, again, sorry for my mixup. Yes, your methods accomplish what I need. For some reason, a mental block on my part is gettiing in the way of imagining/picturing the stack. Perhaps, I should create an Excel or Word six-row table to help me physically visualise these.

Thanks
 « Next Oldest | Next Newest »

 Messages In This Thread EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-11-2017, 08:58 PM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-11-2017, 10:07 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-11-2017, 10:23 PM RE: EXC/ x<>Rn for stack efficiency - Paul Dale - 06-11-2017, 11:08 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-11-2017, 11:57 PM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-12-2017, 12:08 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-12-2017, 07:48 PM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-12-2017, 08:51 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-11-2017, 11:54 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-12-2017, 03:50 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-13-2017, 07:26 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-14-2017, 10:19 AM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-14-2017, 06:39 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-14-2017 07:38 PM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-14-2017, 08:46 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-14-2017, 09:40 PM RE: EXC/ x<>Rn for stack efficiency - Paul Dale - 06-14-2017, 10:36 AM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-14-2017, 03:04 PM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-14-2017, 06:23 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-14-2017, 11:31 PM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-15-2017, 09:01 AM RE: EXC/ x<>Rn for stack efficiency - Paul Dale - 06-15-2017, 09:09 AM RE: EXC/ x<>Rn for stack efficiency - SlideRule - 06-16-2017, 12:39 PM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-16-2017, 06:59 PM RE: EXC/ x<>Rn for stack efficiency - rprosperi - 06-16-2017, 09:12 PM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-17-2017, 07:17 PM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-15-2017, 11:05 AM RE: EXC/ x<>Rn for stack efficiency - Paul Dale - 06-15-2017, 10:29 AM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-16-2017, 06:32 PM RE: EXC/ x<>Rn for stack efficiency - Paul Dale - 06-17-2017, 06:03 AM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-17-2017, 11:46 AM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-17-2017, 12:49 PM RE: EXC/ x<>Rn for stack efficiency - Paul Dale - 06-18-2017, 12:59 AM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-15-2017, 05:28 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-16-2017, 02:57 AM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-16-2017, 05:25 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-17-2017, 05:38 PM RE: EXC/ x<>Rn for stack efficiency - Dieter - 06-17-2017, 06:10 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-17-2017, 08:00 PM RE: EXC/ x<>Rn for stack efficiency - GrampaDave - 06-19-2017, 05:44 PM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-27-2017, 09:42 PM RE: EXC/ x<>Rn for stack efficiency - Thomas Okken - 06-28-2017, 12:42 AM RE: EXC/ x<>Rn for stack efficiency - Matt Agajanian - 06-28-2017, 01:37 AM RE: EXC/ x<>Rn for stack efficiency - Thomas Klemm - 07-20-2022, 07:03 PM

User(s) browsing this thread: 2 Guest(s)