Both routines are based on the "Ferris wheel principle." The program
has a circular structure. When the program is started, it loops through
a cycle (or series) of
input
prompts. You repeatedly ignore the
prompts (by pressing IR/s I) until the prompt that corresponds to the
units of your input comes up. For instance, if you wanted to input
kelvins, you would start the temperature program by pressing I
XEQ
IT
and
then by pressing IR/s Iuntil the K? prompt appeared. At the
prompt you would key in the temperature in kelvins
and
press IR/SI
until you come to the prompt indicating the units that you desired
(F?
for Fahrenheit, for example). The value displayed with
the
prompt would be the temperature in degrees Fahrenheit. To
end
the
program, press
l"c"l.
input
/output
£=JT-273.15
input
/output
-<-
n
*=P
CI
0
Rl
/"
=
jjff*32
Fl
< »
input
/output
*=/"♦
459.67
input/output
Ferris
Wheel
Structure
for
Temperature
Conversion
The program
has
been designed to minimize
the
use of the stack.
When the program is terminated, the values you
had
in the X-
and
Y-
registers are left in the Y-
and
Z-registers, respectively, and the
converted value is displayed. If the value that you wish to convert is
in the X-register (the display) when you start the program, press
IR*
I
to retrieve it
when
you get to the correct prompt.
The length-
and
area-conversion routines give good examples of flag
usage. Note
that
flag 2
was
selected so
that
the
2 annunciator in
the
display would indicate
that
the unit is
squared.
230
14:
Miscellaneous
Programs