The Museum of HP Calculators

HP Forum Archive 21

 Sleek approach to Register Exchange on HP-29CMessage #1 Posted by Matt Agajanian on 15 Mar 2012, 6:37 p.m. Hello there. I'm looking to port over my SR-56, TI-58C programs to my 29C. One of the memory functions which is missing on the 29C is the register exchange. Has anyone come up with a sequence which is efficient and doesn't disrupt the stack too much? If a method loses the T register and leaves the exchanged register's old value in the X register, I don't mind. But, if I can retain the stack with the T register undisturbed and the exchanged register's old value in the X register, that's even better. Edited: 15 Mar 2012, 11:08 p.m.

 Re: Sleek approach to Register Exchange on HP-29CMessage #2 Posted by Jeff O. on 16 Mar 2012, 8:42 a.m.,in response to message #1 by Matt Agajanian I assume you have already developed the following (or similar) un-sleek and inefficient approaches: ```Without Preserving t, does preserve Last x: RCL n x<>y STO n Rv (Roll down) Preserves t, loses Last x: Rv Rv Rv ABS (or INT, or FRAC) CLx RCL n x<>y STO n CLx LAST x Rv Preserves t and Last x: (requires use of register 0 or other for temporary storage of t) Rv Rv Rv STO 0 CLx RCL n x<>y STO n CLx RCL 0 Rv ``` ...

 Re: Sleek approach to Register Exchange on HP-29CMessage #3 Posted by Matt Agajanian on 16 Mar 2012, 11:43 a.m.,in response to message #2 by Jeff O. Thanks indeed! I didn't think of your 4-step approach but, on my own, I did ironically come up with the 5-step approach found in the HP-35A's Math Applications book (although I lose the T-register): RCL N X<>Y STO N CLx + BUT, you got me there! Your first algorithm proves to be the winner even if I need to lose T. Even though, in both yours & my approaches, further down the line, provided I don't lose the Z register, the Z register (which is the last T register value) gets pushed back up to T anyway. So, with that in mind, the next pop will save T and copy to Z. Thus, the net effect will be as if I didn't lose T in the first place. If I can streamline my SR-56/TI-58C progs enough for the 29C, I'd be willing to use your version that preserves both the T and LASTx registers. Edited: 16 Mar 2012, 12:27 p.m. after one or more responses were posted

 Re: Sleek approach to Register Exchange on HP-29CMessage #4 Posted by Jeff O. on 16 Mar 2012, 12:26 p.m.,in response to message #3 by Matt Agajanian Glad they were of some help. I started thinking about this a bit last night after I read your post. I used to have 29C, which I used for about 3 years from 1979 to 1982. Then I lost track of it before I came to realize that I'd like to collect. In any case, going from memory of how the 29C worked, my first ideas for saving stack-t involved using Roll-up. Surely the 29C had Roll-up, right? Wrong, so three Roll-downs are needed instead. Darn.

 Re: Sleek approach to Register Exchange on HP-29CMessage #5 Posted by Matt Agajanian on 16 Mar 2012, 12:39 p.m.,in response to message #4 by Jeff O. I have an old book from (of all places) TK Enterprises, entitled "Everything You've Always Wanted to Know About RPN (But Were Afraid to Pursue)" and from there I got the idea for the R^. But, I dumped the R^ idea because I was looking to shorten keystrokes. After that, I just jumbled around to come up with the least amount of keystrokes for the exchange and the pop to use a zero value, although I'd lose Last X. But, even as I was thinking about saving the T register, I realised my approach would lose the T registed. But, ironically, the 'CLx +' pop preserves T as the RCL n op pushes Z to T anyway (presuming Z still has the last value of T). So, all I really lost was Last X in my version. But, you did help in all ways, including reducing my method to four strokes in the first method. Edited: 16 Mar 2012, 12:45 p.m.

 Re: Sleek approach to Register Exchange on HP-29CMessage #6 Posted by Peter Murphy (Livermore) on 16 Mar 2012, 2:21 p.m.,in response to message #5 by Matt Agajanian Googling on {sic} yields a link to a PDF of that old book (Copyright 1976), which is aimed (according to its cover) at the Corvus 500, the APS 55, the Omron 12-SR, and others. "HP" does not appear anywhere in the book, which runs to 113 pages plus index.

 Re: Sleek approach to Register Exchange on HP-29CMessage #7 Posted by Matt Agajanian on 16 Mar 2012, 3:55 p.m.,in response to message #6 by Peter Murphy (Livermore) I entered that into Google AND, in addition, I saw the following listing "The Joys of RPN." no, not an April Fools' Joke (check your calendar). I watched some of the video. Pretty nifty stuff. Here's the link:Edited: 16 Mar 2012, 4:02 p.m.

 Re: Sleek approach to Register Exchange on HP-29CMessage #8 Posted by Matt Agajanian on 16 Mar 2012, 4:16 p.m.,in response to message #6 by Peter Murphy (Livermore) Hey there! Thanks for the tip on that 'Everything You've Always Wanted to Know...' book as a PDF. That will come in very handy. Now if I could just find either a PDF or physical copy of "Tips & Programs for the HP-32S". Any ideas? Edited: 16 Mar 2012, 4:18 p.m.

 Re: Sleek approach to Register Exchange on HP-29CMessage #9 Posted by Marcus von Cube, Germany on 16 Mar 2012, 1:04 p.m.,in response to message #3 by Matt Agajanian Can you publish your old programs? If they are on the original programming sheets, a scan to PDF would be perfect. My first programmable was the SR-56, so you know why I'm interested...

Go back to the main exhibit hall