Post Reply 
HP 41 - branching to local label and return stack - FINAL RESULTS AND PROGRAMS
05-20-2019, 04:30 PM (This post was last modified: 05-20-2019 04:41 PM by Artur - Brasil.)
Post: #4
RE: HP 41 - branching to local label and return stack
(05-20-2019 03:00 PM)Craig Bladow Wrote:  I believe 'prompt' is looking for the user to enter a number.

This works (i.e. returns) where the user enters a number from 1-4 corresponding to the menu item.

SFTMEN program:
01 - LBL "SFTMEN"
02 - PROMPT
03 - STO 42
06 - RTN

Actually, this prompt expects:
A number (data) and corresponding key - will get the register number to store this data; next will store data in it; so, will turn on a control flag and will return to menu;
Just the corresponding Key pressed - will get the register number that holds the data and will display (PSE) it; so, will turn on a control flag and will return to menu;
R/S - if the user informed data or get the data diplayed before, the control flag will be ON and this last variable input/viewed saved. So, pressing R/S will solve for this last variable.
R/S without previous data input or data viewing - an error (BEEP) and returns to menu.

It mimics the HP-12C for solvind financial data, but with some increments...

Quote:Also in USER mode the top two rows of keys will directly execute routines if they have the LBL A-J in the current program.
That would look like:
MAIN:
01 - LBL "AUTO"
02 - "BA:POT:IMP:CUR:"
03 - AVIEW
04 - STOP
05 - LBL A
.......
This is what I was expecting to happen and 41 actually does it, but with a big mistake: it kills the return stack, so, I can't go back to the main program!
I was reading about Synthetic Programming and return stack is kept in registers a and b. If I could save these registers before the PROMPT and restore them back in the labels A, B, C ... this would be one (uggly) solution for this problem. But such routine in Synthetic Program is for big guys...

ARTUR MARIO JUNIOR
BRAZIL
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 - Artur - Brasil - 05-20-2019 04:30 PM



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