EasyManua.ls Logo

HP HP-16C - Loop Control with Counters

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...
90
Section
9:
Program
Branching
and
Controls
Loop
Control
with
Counters:
and
The
(decrement
and
skip
next
line
if
counter
equals
zero)
and
(increment
and
skip
if
zero)
functions
can
control
loop
execution
by
referencing
and
adjusting
(incrementing/decre-
menting)
a
counter
value
in
the
Index
register.
Then,
when
that
counter
value
reaches
zero,
program
execution
skips
one
line.
Each
time
one
of
these
functions
is
encountered
in
a
running
program,
the
given
counter
value
in
the
Index
register
is
either
decremented
([DSZ])
or
incremented
([1SZ])
by
one.
If
the
resulting
value
equals
zero,
the
next
instruction
is
skipped.
This
allows
exit
from
a
loop
if
the
skipped
line
was
a
branch
into
a
loop.
Conditional
Branch
with
or
False
(R;
#
0)
True
(R}
=0)
>
EBUA
|
\
instruction
(9052
o
|
|
continue
loop
L_.y
A
exit
loop
instruction
l__J
“Skip
if
True”
The
value
in
R}
is
interpreted
according
to
the
current
complement
mode.
It
can
be
positive
or
negative,
in
integer
or
floating-point
format.
The
instructions
and
do
not
affect
the
status
of
the
carry
and
out-of-range
flags.
Example
A
“checksum”
routine
can
be
used
to test
the
integrity
of
stored
data
values.
Using
you
can
determine
the
sum
of
a
bit
pattern
and
then
compare
that
sum
to
the
sum
of
the
same
bit
pattern
at
a
later
time.

Table of Contents

Related product manuals