HP -67 Owner's Handbook Manual page 251

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

Advertisement

Using the I-Register for Indirect Control
247
Rapid reverse branching using
(i and (2
(i are extremely
useful instructions as part of your programs. Rapid reverse branching
permits you to transfer execution to any step number of program
memory. With a negative numberstored in the I-register, the resulting
step number can always be found by combining the negative number
in I with the step number of the
(@ or (7
(@ instruction.
Execution can even be transferred backward past step 000. To find
the resulting step number of program memory, find the sum of the
negative numberin the I-register and the step number containing the
@ or
{@ instruction, then add 224. Thus, if the I-register
contained —12 and a
(@ instruction were encountered in step
007, execution would be transferred to step 219 of program memory
(7 — 12 + 224 = 219).
Example: Named after a 13™-century
mathematician, the Fibonacci series is
a series of numbersthat expresses many
relationships found in mathematics,
architecture, and nature. (For example,
in many plants, the proliferation of
branches follows a series of Fibonacci
numbers.) The series is of the form
0,1,1,2,3,5,8, 13 ..., where each
element is the sum ofthe two preceding
elements.
The program on page 248 contains an infinite loop that generates and
displays the Fibonacci series. Although you normally would probably
not set up a single routine that began in step 211 and continued
through step 008, the routine illustrates how the
[ instruction
coupled with a negative numberin the I-register can transfer program
execution back in program memory, even past step 000.

Advertisement

Table of Contents
loading

Table of Contents