
First a word about key codes. When you enter a key sequence
into the calculator while in “
W/PRGM
” mode, you will see
up to three 2-digit numbers in each instruction line. For
example:
31 25 11
.
Each of these is a row/column code that maps to your
keyboard. “
31
” means row 3 column 1 - which is the “
f
”
shift-key, and so-forth for “
25
” and “
11
”.
The one exception is the digit keys. These will be the actual
value such as ’
01
’ for the
1
digit, ’
09
’ for the
9
digit. Since
there is no row “0”, this doesn’t interfere with the other key
codes, and it makes reading the program a little easier, as
numbers are simply the values you enter. However it takes
one line per digit, so try to store large numeric constants in a
register to keep your programs shorter.
Your Own Program
Now let’s try something a little more involved. To calculate
the surface area of a sphere, the formula
A
=
π
d
2 can be used,
where:
•
A
is the surface area of the sphere,
•
d
is the diameter of the sphere,
•
π
is the value of pi, 3.141592654.