EasyManua.ls Logo

HP HP-20S - Sample Program: Pythagorean Theorem

HP HP-20S
132 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...
Keys:
Display:
Description:
(=)
A
Moves
program
pointer
to
label
A.
5
5_
Enters
5
in
the
display.
(=)
(]
(hold)
01-
61 41
A
Label
A.
(release)
5.0000
(=]
[v]
(hold)
02-
51
11
Squares
input.
(release)
25.0000
(=]
(V]
(hold)
03-
55
Multiplies
25
by
...
(release)
25.0000
(9]
(v]
(hold)
04-
61
22
..
(release)
3.1416
(=]
[v]
(hold)
05-
45
Calculates
intermedi-
(release)
78.5398
ate
result.
(\)
(]
(hold)
06-
4
...+~
4.
(release)
4_
(=)
(Y]
(hold)
07-
74
—
(release)
19.6350
(=]
(V]
(hold)
08-
61
26
End
of
program.
Result
(release)
19.6350
is
correct.
Sample
Program:
Pythagorean
Theorem
You
can
use
most
of
the
HP-20S
features
in
Program
mode
just
like
you
use
them
manually.
To
illustrate
how
and
are
used
to
recall
data
from
registers
in
a
program,
enter
the
following
Pythago-
rean
theorem
program.
It
calculates
the
length
of
the
hypotenuse
(side
c)
of
a
right
triangle,
given
the
lengths
of
sides
a2
and
b.
The
formula
used
is
¢
=
\/a?
+
b2.
Assume
that
the
calculation
begins
with
side
a
in
R;
and
side
b
in
R,.
6:
Programming
73

Table of Contents