Re: 35s prompt for multi-character variables in program like "low footprint" root finder Message #4 Posted by Bart (UK) on 14 Feb 2012, 1:05 p.m., in response to message #3 by Chris C
As I mentioned, the "low footprint" program first loads variable values onto the stack, then stores them.
So firstly to use the stack you must be in RPN mode. Secondly, as the stack is only 4 levels, you can only do 4 variable values in one go.
LABEL STEP COMMENT
A001 LBL A
A002 SF 10
A003 H1, H2A, H2S the three inputs, enter them in sequence pressing ENTER after the first two and R/S after the last one
A004 CF 10
A005 STO C stores H2S into C, the last entered value is at the bottom of the stack (X-register)
A006 Rv This is the Roll Down arrow, roll the stack down so H2A is in X-register
A007 STO B stores H2A into B
A008 Rv This is the Roll Down arrow, roll the stack down so H1 is in X-register
A009 STO A stores H1 into A
A010 (A-B)/(A-C) the actual formula, note the answer is put on the stack (X-register)
A011 SF 10
A012 NC= displayes "NC="
A013 PSE but only briefly
A014 CF 10
A015 RTN
You will see the answer in the X-register (bottom line), and the values of the entered variables above. If you want a "clean" display showing zero's and the answer, then do a "clear stack" before executing the formula:
LABEL STEP COMMENT
A001 LBL A
A002 SF 10
A003 H1, H2A, H2S the three inputs, enter them in sequence pressing ENTER after the first two and R/S after the last one
A004 CF 10
A005 STO C stores H2S into C, the last entered value is at the bottom of the stack (X-register)
A006 Rv This is the Roll Down arrow, roll the stack down so H2A is in X-register
A007 STO B stores H2A into B
A008 Rv This is the Roll Down arrow, roll the stack down so H1 is in X-register
A009 STO A stores H1 into A
A010 CLSTK
A011 (A-B)/(A-C) the actual formula, note the answer is put on the stack (X-register)
A012 SF 10
A013 NC= displayes "NC="
A014 PSE but only briefly
A015 CF 10
A016 RTN
Regards
|