Re: HP35s Programming Help Message #2 Posted by Marcus von Cube, Germany on 23 Apr 2008, 3:43 a.m., in response to message #1 by Chuck
Hi Chuck,
nobody is willing to comment on this? Let me try!
It looks like your loop is perfectly ok. You can save some steps if you redefine F to use the stack instead of K:
F001 LBL F
F002 X^2 ' RPN instead of an equation
F003 1/X
F003 RTN
A001 LBL A
A002 0
A003 STO S
A004 INPUT A
A005 INPUT B
A006 1E3 ' shorter than 1000 (may use the same memory, though)
A007 ÷
A008 STO+ A
A009 RCL A
A010 INTG ' value on stack, not in register
A011 XEQ F002 ' no need to execute the label
A012 STO+ S
A013 ISG A
A014 GTO A009
A015 VIEW S
A016 RTN
I replaced 1000 by 1E3 which might save a byte but need not (I didn't check it).
Marcus
|