Post Reply 
HP 41 - branching to local label and return stack - FINAL RESULTS AND PROGRAMS
05-20-2019, 03:41 PM
Post: #3
RE: HP 41 - branching to local label and return stack
The typical way I've seen it done (such as in the TVM program on the Advantage module) is to have the appropriate A-E local labels for input/output variables, and another local label (usually J) that displays the soft-menu. To enter values in the variables, just type a value into X and press the corresponding key.

The rough structure of the program would be like this:

LBL "TVM"
...various program-specific setup steps (clear key assignments, turn on USER, etc.)...
XEQ J //Display the soft-menu and stop
RTN
LBL A
FC?C 22 //Check for user input
XEQ "N" //No user input, call the solve/computation routine for this variable
STO 01 //Store X into 01 (n, in the case of TVM), whether user input or the newly computed value
RTN
...similar labels for B-E, and a-e if you want shifted functions...
LBL J
"N I% PV PMT FV"
AVIEW
RTN

This is a pretty user-friendly way to do it that doesn't require a lot of extra program steps, and the UX is very similar to the TVM and soft-menu solvers on other models.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 41 - branching to local label and return stack - Dave Britten - 05-20-2019 03:41 PM



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