|
Section 14: Flags212
|
|
To begin learning how to use the flags, set flag 00:
|
|
|
|
Flag decisions are made using the test flag functions
( FS? , FC? ,
FS?C , and FC?C ). Each of these
functions asks a question about the status of the specified flag. In a program, if the
answer to the test question is TRUE, the calculator executes the next line in the
program (this is the ‘‘DO if TRUE’’ rule
again). If the
answer to the question is false, the calculator skips the next line in the program
before execution continues.
|
|
For example, if you use the FS?
‘‘flag set’’ test) function to check the status
of flag 01 in a program and the flag is set, the next line in the program is
executed. If the flag is clear, the next line in the program is skipped.
|
|
|
|
Is flag 01 SET?
|
|
|
|
|
|
|
|
|
If YES (flag 01 is set),
continue with the next line.
|
|
|
|
|
|
|
|
|
|
If NO (flag 01 is not set),
skip one line.
|
|
|
|
|
|
Pressed from the keyboard, these flag functions will show an answer to the test
question in the display. If the answer is true, the display shows
YES; if the answer is false, the
display shows NO.
|
|
Two of the flag test functions perform an additional function other than asking
a question. These functions,
FS?C
(‘‘flag set’’ test and clear) and
FC?C
(‘‘flag clear’’ test and clear), also clear the
specified flag in addition to testing it.
|
|
If at any time you are unsure as to the status of the flags, there are
two ways to tell whether a flag is set or clear. (Remember, the status of some
flags is maintained by the Continuous Memory of the HP-41C.)
|
|
First, and most simply, you can check the status of flags 00 through 04 by
simply looking in the display at the flag annunciator. If any of these five flags
are set, the corresponding number will show in the display annunciator at the
bottom of the display window.
|
|
Second, you can test the flag with FS? or
FC? without changing its status. Pressed form the
keyboard, these functions return a YES or
NO answer in the display.
|