Re: HP 33S programming [flag functions] Message #9 Posted by Karl Schneider on 7 Apr 2006, 1:53 a.m., in response to message #7 by Vieira, L. C. (Brazil)
Hi, Luiz --
Your snippet of code won't quite work exactly as written, because the HP-33S has no "is flag clear? [FC?]" function. Only the HP-41 and HP-42S have six functions -- SF, CF, FS?, FC?, FC?C, FS?C -- the rest, to my knowledge, have only three: SF, CF, FS?.
However, your idea is good, and I had incorporated something very similar in the final version of the the AC Power Transfer program for the HP-32S, HP-32SII, and HP-33S (RPN and ALG modes) in the MoHPC Software Library:
I replaced something like:
S0007 FS? 2
S0008 GTO T
S0009 INPUT R
S0010 INPUT X
S0011 INPUT B
S0012 GTO C
T0001 LBL T
T0002 XEQ Z
T0003 CF 2
T0004 GTO C
C0001 LBL C
with the following:
S0007 FS? 2
S0008 XEQ Z
S0009 FS? 2
S0010 GTO C
S0011 INPUT R
S0012 INPUT X
S0013 INPUT B
S0014 GTO C
C0001 LBL C
C0002 CF 2
thereby saving a line and a label. I'm rather proud of that program, and don't mind saying so:
- It is modular -- each of the four labels serve as bona fide entry points to a specific part of functionality which can be directly accessed by the user.
- Its input is user-friendly -- each input variable is prompted by INPUT, and the user may alter the entire stack for interactive calculations when the program is paused, without affecting the program's results.
- It makes generous use of the the four models' complex-number functionality, which is admittedly awkward for interactive calculations, but very nice to have for programming.
- The four versions I have prepared are optimized for the respective three calculator models, but the HP-32S version is completely portable to the HP-32SII and HP-33S.
I concede that only those in the field of power engineering (or studying it) would have any use for the program. However, some good programing concepts can be found in the code listings.
Cheers,
-- KS
Edited: 7 Apr 2006, 2:23 a.m.
|