92
Section 8: Program Branching and Controls
Following a conditional test, program execution follows the "Do if True"
Rule: it proceeds sequentially if the condition is true, and it
skips one
instruction if the condition is false.
A
t
instruction is often placed right
after a conditional test, making it a
conditional branch;
that is, the
t
branch is executed only if the test condition is met.
Flags
Another conditional test for programming is a
flag
test. A flag is a status
indicator that is either
set
(= true) or
clear
(= false). Again, execution
follows the "Do if True" Rule: it proceeds sequentially if the flag is set, and
skips one line if the flag is clear.
The HP-15C has eight
user
flags, numbered 0 to 7, and two
system
flags,
numbered 8 (Complex mode) and 9 (overflow condition). The system flags
are discussed later in this section. All flags can be set, cleared, and tested as
follows:
|
F
n
will
set flag
number
n
(0 to 9).
|
"
n
will
clear flag
number
n
.
|
?
n
will
check
if flag
n is
set.
A flag
n
that has been set remains set until it is cleared either by a
"
n
instruction or by clearing (resetting) Continuous Memory.
Содержание HP-15C
Страница 1: ...HP 15C Owner s Handbook HP Part Number 00015 90001 Edition 2 4 Sep 2011 ...
Страница 17: ...Part l HP 15C Fundamentals ...
Страница 64: ......
Страница 65: ...Part ll HP 15C Programming ...
Страница 118: ...118 ...
Страница 119: ...Part lll HP 15C Advanced Functions ...