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.
{ 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.
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 ] | |
Display first step | { 1st } | |
Clear program memory | [ 2nd ] [ CP ] | |
Enter function | [ yˣ ] | |
Specify power | 3 | |
Calculate result | [ = ] | |
Stop execution | [ HALT ] | |
Exit learn mode * | [ LEARN ] |
* 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