Post Reply 
HP 41 - branching to local label and return stack - FINAL RESULTS AND PROGRAMS
05-20-2019, 06:34 PM
Post: #9
RE: HP 41 - branching to local label and return stack
Hello Artur,

You could use the LR (Lengthen Return stack) and SR (Shorten Return stack) FOCAL programs from the PPC ROM.
I modified your program with something that should work like you want it.

Sylvain

MAIN:
Code:
01 LBL "AUTO"
02 "BA:POT:IMP:CUR:"
03 XEQ "SFTMEN"
04 X=0?
...
SFTMEN program:
Code:
01 LBL "SFTMEN"
02 AVIEW
03 5                           // destination register for LR
04 XROM "LR"                   // saving 5 return addresses into register 5 & 6
05 CLA
06 STOP
Code:
07 LBL A    
08 1    
09 STO 42
10 GTO 10
11 LBL B    
...
XX GTO 10
...
Code:
XX LBL 10
XX 5                           // source register for SR
XX XROM "SR"                   // restoring 5 return addresses from register 5 & 6
XX END
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 - Sylvain Cote - 05-20-2019 06:34 PM



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