Download Print this page

HP 9100A Operating & Programming Manual page 23

Hide thumbs Also See for 9100A:

Advertisement

PROGRAMMING
PROBLEM:
Calculate the average value (X) of N data
points,
Xj.
Use the SET FLAG to Lnd1cate entry of the last
data pomt.
SOLUTION
ENTER PROGRAM
STEP
KEY
PRESS:
GO TO
(0) (0) (or END)
00
CLEAR
PRESS:
CONTINUE
01
1
ENTER DATA:
Xi
---.X
02
t
PRESS:
CONTINUE
03
STOP
After Last Data Entry,
04
IF FLAG
PRESS:
SET FLAG
PRESS:
CONTINUE
05
0
Display:
06
b
X --.y
07
ACC
+
n ---+X
08
GO TO
( I ( I
09
0
Oa
1
Ob
RCL
Oe
x:.y
Od
-
10
END
NOTE
The only sequence of instructions after a cond1tional
branch instruct1on which will not g1ve the expected results
is a numeric or alphabetic mstruct1on followed by a non·
arithmetic or non·alphabetic instruction.
The program
will branch
to the
address (J) (K) given by the numenc
or alphabetic instruct10n (J) and the second dig1t (K) of
the
address of
the third
instruct1on followmg the cond1
·
tional
branch instruction. The program will also execute
the
instruction in
the
second program step following the
conditional
branch
instruction.
EXAMPLE:
STEP
KEY
04
IF
x<Y
05
2
06
ROLL "'
07
-;-
lf the
contents of
X
-
3. and
the
contents of Y
5., the
condition (I
F X
<
Y)
is
met; the
program will continue
to
step
05.
The ROLL
~
instruction will be executed and
the
program will then branch to
step
27
(determined by
the
2 in step
05
and
the
second dig1t of
the
address in step
07)
rather than
entering 2 in
the
X
register
and performing
the ROLL
~
.
23

Advertisement

loading