EasyManua.ls Logo

HP HP-16C - Section 9: Program Branching and Controls; Example

HP HP-16C
140 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Section
9:
Program
Branching
and
Controls
89
often
placed
right
after
a
conditional
test,
making
it
a
conditional
branch;
that
is,
the
branch
is
executed
only
if
the
test
condition
is
met.
Program
Execution
After
Test
If
True
If
False
015-[f](LBL]2
l 016-
R
9
017-[g](x<y]
-
018-(GT10]2
019-
[
————
——_J
020-
_\/
Do
if
True’”’
Testing
for
Set
Flags
and
Set
Bits
Additional
tests
for
conditional
branching
are
provided
by
the
(flag
set?)
and
(bit
set?)
functions.
Following
these
instructions—as
with
the
other
conditional
tests—program
execu-
tion
follows
the
“Do
if
True”
rule
(illustrated
above):
it
proceeds
sequentially
if
the
flag
(or
bit)
is
set,
and
skips
one
line
if
the
flag
(or
bit)
is
clear.
As
discussed
in
section
3,
the
flag
numbers
and
their
meanings
are:
0
1
User
flags
(used
to
control
programming).
2
3
Controls
display
of
leading
zeros.
4
Carry
or
borrow
condition.
5
Out-of-range
condition.
Although
flags
4
and
5
are
set
automatically
by
the
calculator,
the
user
can
also
set
them.
If
you
set
flag
4,
the
carry
bit
is
set
to
1.
Refer
to
section
3
(page
36)
for
a
full
discussion
of
setting
flags,
and
section
4
(page
50)
for
a
full
discussion
of
setting
bits.

Table of Contents

Related product manuals