Storingdata; Selecting Different Routines - HP -11C Owner's Handbook Manual

Hide thumbs Also See for HP-11C:
Table of Contents

Advertisement

218
Section 11: Programming Techniques
2.
Selecting execution of different routines within a program.
3.
Selecting execution of different programs in program
memory.
The first two applications are used in the Finance program.
Storing Data
In the Finance program, there are five possible inputs: periodic
interest (i), number of periods (n), present value (PV), periodic
payment (PMT), and future value (FV). Because there are five
user-definable keys, we can assign a routine that stores input
data in specific registers to each of these keys. For example, the
routine associated with key
begins with
(c],
(3],
(R/S]. Each time key
[C]is pressed, the value in stack register X is
stored in R3. Up to 5 values, one associated with each key, may be
stored in this way. In addition, these values may be stored in any
order. Just key in the value to be stored and press the appropriate
user-definable key.
Selecting Different Routines
A program may be written to calculate more than one value. The
selection of which value is to be calculated may be done using the
user-definable keys. The key pressed would indicate which value is
to be calculated. In the Finance program, for example, the value
PMT is calculated by pressing the following sequence: [D] (select
PMT),
(calculate). When [D] is pressed, the user is telling the
calculator to execute the routine beginning with
(D). In this
program, an inconsequential value is stored in R; and the
calculator is positioned to the proper place to calculate PMT. The
value stored is inconsequential because when
is pressed, PMT
will be calculated and the value in R4 will be over-written.
As you can see, the user-definable keys are very useful and can
serve more than one purpose.

Advertisement

Table of Contents
loading

Table of Contents