Programming the Function Keys


By "defining" the function keys, you can create a menu that lets you transfer control to any of several locations in the program, depending on the function key you press.


Definable Function Keys

During normal calculator operation, the function keys are defined by the system menus. For example, when you press [ CONV ], the calculator defines the function keys to provide a variety of conversions.

You can create your own function-key definitions by executing a [ 2nd ] [ DFN ] instruction within a program (DFN cannot be used as a keyboard command). The DFN (define) instruction is followed by a field that specifies:
  • The function-key to define.
  • The three-character message to display above the key. (This lets you display information to describe the definition of the key.)
  • The label of the program segment to execute when you press the function key. (The sequence of instructions following the label determines what operations are performed when you press the key.)

The three-character message above the function key is not displayed until program execution is stopped or paused.

Storing the Instruction

To include a DFN instruction in a program:
  1. Press [ 2nd ] DFN.
  2. Press the function key ( [ F1 ] - [ F5 ] ) you are defining.
  3. Enter the three character message you want displayed above the key. If your message has fewer than three characters, use spaces as blank characters.
  4. Enter the label where you want to start execution when the function key is pressed.

Example

The following keystrokes store a DFN instruction in program memory. This instruction displays "SUB" above [ F1 ] and instructs the calculator to transfer program execution to label AA when you press [ F1 ].

Procedure

Press

Display

Define [ F1 ] key[ 2nd ]
[ DFN ]
D_8E9BnA
Select the function key[ F1 ]D_x6WI4t
Enter descriptionSUBD_EaqKnk
Enter labelAAD_jOv71f
The calculator automatically accepts alpha characters for the function description and label name. It also supplies the ":" after you enter the first character of the function description and the "@" after you enter the last character of the description. You can read this instruction as "Define key F1 as SUB at label AA."

Back