Entering a Program


The learn mode of the calculator enables you to enter a sequence of keystrokes into program memory. Once entered, a program remains in memory until you clear it or replace it with another program


Activating the Learn Mode

Before you can enter a program, the calculator must be in the learn mode. To activate the learn mode:

1. Press [ CLEAR ]

The following screen is displayed.
D_A82Lnr
{ 1st } : Positions the cursor to the first step in program memory.
{ PC } : Positions the cursor to the step specified by the current setting of the program counter.
{ END } : Positions the cursor to the last instruction stored in program memory.
{ ESC } : Clears the learn mode menu.

2. Select the option for the program location you want to display. The calculator displays the program location you want to display. The calculator displays the program counter (PC) on the second line of the display. The PC value corresponds to the address of the step marked by the cursor.

Clearing the Program Memory

The key sequence [ 2nd ] [ CP ] clears all keystrokes from program memory. When you clear program memory, the calculator fills all program steps with NOP (no operation) instructions. To prevent the accidental clearing of a program, the clear program function works ONLY in the learn mode.

Entering the Program

After selecting the learn mode, enter your program by pressing the desired sequence of keys. When a key (or key sequence) is pressed, the calculator enters that function into program memory and displays the mnemonic that represents that function.

As you enter your program, consider the following points.
  • Enter the instructions in the order that you want them executed. (It is possible to change the order in which instructions execute by using transfer instructions. Transfer instructions are discussed in Chapter 4.)
  • Include every instruction that you want executed. If you omit an instruction, your program will probably not run as intended.
  • End your program with a [ HALT ] instruction. The [ HALT ] function instructs the calculator to stop program execution and return to keyboard operation.
  • If you make a mistake in entering a program, you can correct it by using the editing keys discussed later in this chapter.

Exiting the Learn Mode

After entering the keystrokes that make up your program, you must exit the learn mode before you can run the program.

To exit the learn mode, press [ LEARN ] again.

When the calculator exits the learn mode, it displays the contents of the numeric display register. Any alpha message that was in the display when the learn mode was entered initially is not redisplayed. (Alpha messages that you have created can be recalled, as explained in Chapter 3.)

Exiting the learn mode does not affect the contents of program memory or change the location of the program counter. The program counter remains where it was last positioned, until you perform an operation that changes it.

Example

To illustrate the process of programming the calculator, write a program to calculate the cube of a number. To make this calculation manually, you would:
  • Enter the number to be calculated.
  • Press [ yˣ ] to specify the power function.
  • Press 3 to specify the power.
  • Press [ = ] to complete the calculation and display the result.
The last three actions in the list are the actions that you want to put into the program. Do not put the number to be cubed into the program, or you will have to change the program every time you want to cube a different number.

You write this program by entering the learn mode and duplicating the keystrokes in the list. The program design assumes that the number to be cubed is already in the display when the program is started.

To write the program, dupilcate the keystrokes shown below.

Procedure

Press

Display

Activate learn mode[ LEARN ]D_TvuICW
Display first step{ 1st }D_x3biEI
Clear program memory[ 2nd ] [ CP ]D_x3biEI
Enter function[ yˣ ]D_vWdMa6
Specify power3D_oLrmUc
Calculate result[ = ]D_TqHXak
Stop execution[ HALT ]D_3R1Nef
Exit learn mode *[ LEARN ]D_CfGEth

* The value displayed is the value that was in the numeric display register before you activated the learn mode.

The program is stored in the calculator. The procedure for running the program is described on the following pages.

Back