EasyManua.ls Logo

HP HP-20S - Branching and Conditionals; Branching (GTO)

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...
To
execute
the
program
using
3
and
4
as
x;
and
x,,
press
3 4
C.
The
result
is
7.8979.
To
exit
Radians
mode,
press
(=]
(oEG].
Nested
Subroutines.
A
subroutine
can
call
another
subroutine,
and
that
subroutine
can
call
yet
another
subroutine.
This
“nesting”
of
subroutines—the
calling
of a
subroutine
from
within
another subrou-
tine—is
limited
to
four
levels
of
subroutines.
The
operation
of
nested
subroutines
is
shown
below:
MAIN
PROGRAM
(Top
level)
(1st
level)
(2nd
level)
(3rd
level)
(4th
level)
LBL
A
+
|LBL
B
+
|LBL
C
+
{LBL
D
+
||LBL
E
XEQ
B
XEQ
C
XEQ
D
XEQ
E
RTN
{
‘|
RTN
‘|
RTN
‘|
RTN
w
RTN
END
OF
PROGRAM
If
you
attempt
to
execute
a
subroutine
nested
more
than
four
levels
deep,
the
message
Error
-
Sub
appears
in
the
display.
Branching
and
Conditionals
Branching
(GTO)
As
we
have
seen
with
subroutines,
it
is
often
desirable
to
transfer
execution
to
a
part
of
the
program
other
than
the
next
line.
This
is
called
branching.
Unconditional
branching
uses
the
GTO
(go
to)
instruction
to
branch
to
a
program
label.
Use
the
keys:
(%]
label.
80
6:
Programming

Table of Contents

Related product manuals