Flags .Ot E E - HP -11C Owner's Handbook Manual

Hide thumbs Also See for HP-11C:
Table of Contents

Advertisement

Section 7: Program Decisions and Control
111
X=y
tests to see if the value in the X-register is equal to the
value in the Y-register.
tests to see if the value in the X-registeris less than zero.
tests to see if the value in the X-register is greater than
zero.
tests to see if the value in the X-register is not equal to
zero.
(g][x=0]
tests to see if the value in the X-register is equal to zero.
Flags
Another type of decision-making test for use in programs is a flag
test. A flag is actually a status indicator that is in either a set (true)
or clear (false) status. A running program can test a flag and make
a decision based upon whether the flag is set or clear. Flag tests
affect program execution in the same way as conditionaltests.
The two flags in your HP-11C are numbered 0 and 1. To set a flag,
press 9 ][SF](set flag) followed by the proper digit key (0 or 1) of the
desired flag. To clear a flag, press
(clear flag) followed by
the proper digit key. To test a flag use (g
][F?](is flag set?) followed
by the digit key specifying the flag to be tested.
A flag that has been set by a [9][SF]n command remains set until it
is cleared by a [g]
n command or until Continuous Memory is
reset.
Is flag 1 set (True)?
Yes
Instruction
l_
No
(g])F2)1
Instruction
Instruction
;
Instruction

Advertisement

Table of Contents
loading

Table of Contents