Test Operations - HP -65 Owner's Handbook Manual

Hide thumbs Also See for HP-65:
Table of Contents

Advertisement

If the pointer is at the bottom, and you try to insert a step, the
code(s) will be generated in the display, but will not go into
memory. Deleting the bottom step also deletes the step ahead
of it. For a critical case like this, be sure to reinsert the last step.
Test Operations
To complete the discussion of programming the HP-65, we will
consider the test operations summarized in Figure 4-5. The test
operations are particularly valuable for performing iterative cal-
culations.
Using the Flags for Programmed Decisions
The calculator has two flags (called flag 1 and flag 2) available
for your use. A flag is an invisible piece of information with just
two possible conditions: on or off. The flag operations are given
in Figure 4-5, p. 63. You can set a flag on or off by using the
Set Flag operations. These operations can be executed from the
keyboard or from a program. The reason for setting a flag is so
that a program can later make a decision based on the condition
of the flag (using the test flag operations).
Sample Case: Flags. Create a function B that computes (1/x)?
if flag 1 in on and computes (x?) if flag 1 is off. Assume that the
desired condition of flag 1 has been previously set.
= Switch to W/PRGM
= Clear memory bypressing [f]
.
= Key in the following steps.
Keys
Comment
o
W [
Test flag 1 for on.
9
*
If on,calculate (1/x).
b2
Square x or 1/x.
0]
Stop.
*If flag 1 is on, these steps are not skipped. If off, they are skipped and x is not
replaced by 1/x.

Advertisement

Table of Contents
loading

Table of Contents