(35S) Save/Recall Stack - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (35S) Save/Recall Stack (/thread-8358.html) |
(35S) Save/Recall Stack - Forty-Bot - 05-17-2017 05:16 AM These programs save and recall the stack on the 35s. This has already been tackled by MarkHaysHarris777, but I think I have made a few improvements. These programs store the stack relative to the current value of I, rather than at a fixed location. This allows the user to save several stacks and recall them in sequence. In addition, no variables are clobbered except I and J. A downside to this approach is that it is non-trivial to exchange two stacks, as this is a fundamentally stack-based approach (with regard to indirect variable usage). Simply execute LBL S to save the current stack (non-destructive), and LBL R to recall it. The user can even pop individual values off the stack by entering 0 [DSE] I [x<>] (I), though they must be careful to ensure I is a multiple of 4 before restoring another stack. Code: S001 LBL S Code: R001 LBL R |