EasyManua.ls Logo

HP HP-20S - Subroutines

HP HP-20S
132 pages
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...
A
subroutine
is
a
routine
that
is
called
from
(executed
by)
another
routine
and
returns
control
to
that
same
routine
when
it
finishes.
The
subroutine
must
start
with
a
LBL
and
end
with
a
RTN.
A
subroutine
can
call
other
subroutines.
If
a
subroutine
is
at
the
end
of
program
memory
and
does
not
end
with
(>][RTN],
control
is
still
transferred
to
the
step
after
the
originat-
ing
when
the
routine
completes.
It
is
as
if
the
subroutine
had
ended
with
(]
[RTN].
Calling
Subroutines
(XEQ)
Use
label
to
call
a
specific
subroutine.
The
subroutine
must
start
with
the
label
A
through
F
or
0
through
9.
Searching
begins
at
the
and
proceeds
down
the
program,
wrapping
around
through
line
00
until
the
label
is
found.
Within
a
program,
label
transfers
exe-
cution
of a
running
program
to
the
program
line
containing
that
label,
wherever
it
may
be.
The
program
continues
running
from
the
new
location.
Then,
at
the
next
[>]
statement,
execution
returns
to
the
line
after
the
originating
and
continues.
For
example,
to
write
a
program
that
calculates
the
average
slope
be-
tween
x;
and
x,
on
the
graph,
where
y
=
x>
sin
x,
you
would
use
the
formula:
(x,”
sin
x,)
(x,°
sin
x;)
slope
=
X,
X
6:
Programming
77

Table of Contents

Related product manuals