HP 41 - branching to local label and return stack - FINAL RESULTS AND PROGRAMS
06-22-2019, 01:01 PM (This post was last modified: 06-22-2019 07:43 PM by Artur - Brasil.)
Post: #36
 Artur - Brasil Member Posts: 132 Joined: Sep 2014
RE: HP 41 - branching to local label and return stack
(06-21-2019 10:11 PM)Bill Duncan Wrote:  I've read through many of the solutions and, I believe the "KISS" (keep-it-simple-..) is missing. See my program here:
https://www.hpmuseum.org/software/41/41tmgr15.htm

The sequence I use for softkeys simply places a number in X.

Code:
 .. LBL "A",   1, GTO 11 LBL "B",   2, GTO 11 LBL "C",   3, GTO 11 LBL "D",   4, GTO 11 LBL "E",   5, GTO 11 LBL "F",   6, GTO 11 LBL "G",   7, GTO 11 LBL "H",   8, GTO 11 LBL "I",   9, GTO 11 LBL "J",  10              # GTO 11 not needed here.  fall through... # ------------------------------------------------------------------------------ # All timer toggle keys A-J funnel through here... LBL 11 ..
Hi, Bill

That's the idea, but we have just one line in display, so I decided do not use the keys from F to H, as user can't see what variables are associated to them directly.
Instead, I make two sequences of menu. Beyond this, you can mix with a - e (shift keys). This gives you, in principle, 20 variables!

Let's study a simple caller programm:
I need to solve four problems:
First one: magnetic flux
φ = B.A --> φ - B.A = 0
φ = Fmm/R --> φ - Fmm/R =0 , let's make just one equation for both functions:
φ - B.A+Fmm/R = 0

But we can't have φ, B.A and Fmm at same time.
If we will calculate φ, only B.A or Fmm can be given; if we calculate B, only one of φ or Fmm, and so on.
So, an XOR on three combining two of them giving the another!!! And you don't know which one will be asked to be solved for!
Also, R can't be equals to 0: R<>0

Second one: permeability
u = B / H
ur = u/u0 --> u = ur.uo
(u + uo.ur) - B/H = 0
Same restrictions: XOR (u, uo.ur, B); H <> 0

Third one: relutance
R = L/(u.A)
ur = u/uo => u = ur.uo (relative permeability and absolute - uo is a constant)
R - L/(u+uo.ur).A = 0 (problems usually have ur, but...)
Again, XOR(R, u, uo.ur) A <> 0

The fourth one: magnetic field
H = N*I/L
Fmm = N*I
Let's put in order...
H - (Fmm+NI)/L = 0
XOR(H,Fmm, N*I). L <> 0.

Next post I'll present the variables/keys to these formulas (my wife wants to go window shopping now ...)

Have you seen, Bill, as the problem is bigger and we can't waste memory repeating so many menus?

See you soon!!

ARTUR MARIO JUNIOR
BRAZIL
 « Next Oldest | Next Newest »

 Messages In This Thread HP 41 - branching to local label and return stack - FINAL RESULTS AND PROGRAMS - Artur - Brasil - 05-20-2019, 02:18 PM RE: HP 41 - branching to local label and return stack - Craig Bladow - 05-20-2019, 03:00 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-20-2019, 04:30 PM RE: HP 41 - branching to local label and return stack - Dave Britten - 05-20-2019, 03:41 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-20-2019, 05:13 PM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-20-2019, 05:33 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-20-2019, 05:44 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-20-2019, 05:50 PM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-20-2019, 06:37 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-20-2019, 06:47 PM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-20-2019, 06:34 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-20-2019, 06:43 PM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-20-2019, 07:28 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-20-2019, 07:42 PM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-20-2019, 08:19 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-20-2019, 08:29 PM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-20-2019, 09:51 PM RE: HP 41 - branching to local label and return stack - Garth Wilson - 05-20-2019, 10:03 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-20-2019, 11:18 PM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-20-2019, 11:48 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-21-2019, 11:12 AM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-21-2019, 01:45 PM RE: HP 41 - branching to local label and return stack - Thomas Okken - 05-22-2019, 12:28 AM RE: HP 41 - branching to local label and return stack - rprosperi - 05-22-2019, 01:44 AM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-22-2019, 02:02 AM RE: HP 41 - branching to local label and return stack - Gene - 06-21-2019, 11:07 PM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-21-2019, 11:17 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-22-2019, 01:50 AM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-22-2019, 02:00 AM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-22-2019, 07:08 PM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-23-2019, 02:24 AM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 05-23-2019, 12:11 PM RE: HP 41 - branching to local label and return stack - Sylvain Cote - 05-23-2019, 11:38 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 06-21-2019, 01:42 AM RE: HP 41 - branching to local label and return stack - Bill Duncan - 06-21-2019, 10:11 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 06-22-2019 01:01 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 06-22-2019, 04:16 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 06-22-2019, 07:31 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 06-22-2019, 09:59 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 06-22-2019, 11:00 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 06-23-2019, 02:24 AM RE: HP 41 - branching to local label and return stack - FINAL RESULTS AND PROGRAMS - Sylvain Cote - 06-23-2019, 04:03 PM RE: HP 41 - branching to local label and return stack - Artur - Brasil - 06-23-2019, 02:40 AM

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