Introduction


The calculator normally executes program steps in the same order in which you stored them. For problems that are relatively simple, you can write a "straight-line" program that executes a sequence of keystrokes once, from beginning to end. Many problems, however, cannot be solved efficiently by a straight-line program.


Why Change the Sequence?

You may have a problem, for example, that requires the same key sequence to be executed many times. Although you could probably repeat the key sequence every place it is needed, the program could become very large, perhaps exceeding the memory capacity of the calculator. You could also spend a lot of time storing the program in memory.

Transfer instructions allow you to solve problems involving repetition by directing the calculator to execute a key sequence as many times as needed. By using these instructions, you can shorten a program and make it easier to enter and edit.

Besides enabling a program to repeat a key sequence, transfer instructions allow a program to skip a sequence of keystrokes. This feature is particularly powerful when transfer instructions are used in conjunction with decision-making instructions, as described in the next chapter.

The Transfer Functions

The transfer functions are listed below.

Mnemonic

Action

GTLIn a program, GTL (goto label) transfers control to a program step you have labeled.
From the keybaord, GTL sets the program counter to a program step you have labeled, but does not start program execution.
GTOIn a program, GTO (goto) transfers control to the specified program step.
From the keyboard, GTO sets the program counter to a specified program step, but does not start program execution.
SBLIn a program or from the keyboard, SBL (subroutine label) transfers control to a subroutine you have labeled.
SBRIn a program or from the keyboard, SBR (subroutine) transfers control to the subroutine at the specified program step.


Note: Within a program, RUN can be used with a transfer instruction to transfer control between programs that are stored in separate areas. For information on this use of transfer instructions, refer to Chapter 8, Reference section.

The DFN Instruction

The DFN (define) instruction lets you create your own function-key menus. These menus, referred to as user-defined menus, control the order of program execution based upon the function keys that you press.

The DFN instruction can only be used within a program.

Back