Indirect Branching Using The Index Register; Conditional Tests - HP -16C Owner's Handbook Manual

Table of Contents

Advertisement

88
Section 9: Program Branching and Controls
Indirect Branching Using the Index Register
By placing an index value in R; (the Index register), you can
indirectly branch to a location ([GTO] [1]) and indirectly call a
subroutine (
).
These functions
will transfer execution to the label that
corresponds to the absolute value of the number in the Index
register according to the table below.* (In Floating Point mode,
only the integer portion of the number in R; is used.) There are 16
possible labels: 0to9and Ato F.
For instance, if the Index register contains -14,, ([STATUS]: 2-08-
0000), then a
instruction would transfer program
execution to
E (|—14,9| = Eqp).
Indirect Branching
If R; Contains:
[GTO) (I or wnll
transfer execution to:
0
(O16)
(LBL]O
9
(916)
9
10
(A1e)
(LBLJA
15
(F1e)
F
Conditional Tests
Another way to alter the sequence of program execution is by a
conditional test, a true/false test which compares the number in
the X-register either to zero or to the number in the Y-register. (In
1's Complement mode, these tests consider -0 equal to 0.)
The
HP-16C
provides
eight
different
tests
(all
[g]-shifted
functions):
(x<y] (x<0] [x>y] [x>0] [x#y]
[x#0]
[x=y]
[x=0
Following a conditionaltest, 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
instruction is
*The absolute value is computed using a word size of 68 and the current complement
mode.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the HP-16C and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF