HP 9100B Operating & Programming Manual page 99

Hide thumbs Also See for 9100B:
Table of Contents

Advertisement

PROGRAMMING THE 91008
PROGRAM KEYS- CONDITIONAL BRANCHING
Sets the 'YES' condition which is tested by the IF FLAG
instruction. May be set either from the keyboard, when
the program is stopped, or as a program step.
The 'YES' (SET FLAG) condition is cleared (to 'NO') when the
IF FLAG instruction is encountered in a program; it is also
cleared when a CLEAR instruction is encountered, either as a
program step or (when the program is stopped) from the key-
board.
The following program calculates the average value (X) of N
data points, x i :
X
1
+x
2
+
X
3
+ ----
X
n
N
This program illustrates the following:
2:Xj
-
==
X
N
a)
use of I F FLAG, with the SET FLAG tnstruction
set from the keyboa rd
;
b)
generation of a program counter (the number of
data potnts ts counted by adding 1 to the
pro-
gram counter each time a data point is entered)
;
c)
use of the accumulative
registers
(
-1
-)
e
and
(+
)f
;
d)
use of the CLEAR to in itial ly clear (
+
)
e
,
(
+
)
f
and the SET
FLAG.
FLOW CHART
r----__..
Enter x
1
,
or, if no
data, set the flag
~
(YES)
(clears
the)
fla
IF FLAG
(is the flag flying?)
,_
g
~
(NO)
------..~
sum x
i
[
L:x
1 ._..
(+
)e
]
sum 1 [N ._..
C
+
)f
]
divide:
L
X
i
N
,~
di
splay:
X
9

Advertisement

Table of Contents
loading

Table of Contents