Adding Instructions within a Program. HP 12C Platinum Financial Calculator, 12c

Add to My manuals
278 Pages

advertisement

Adding Instructions within a Program. HP 12C Platinum Financial Calculator, 12c | Manualzz

142 Section 10: Program Editing

Keystrokes

(ALG mode)

15000t

Display

12,000.00

Net income after 20% tax is subtracted from $15,000 income.

Adding Instructions within a Program

If an instruction is to be added within a program, simply keying it in will replace the instruction previously stored in that program line, as described above; the contents of all higher-numbered program lines remain unchanged.

To add instructions within a program, you could simply key in the new instructions, beginning at the proper program line, followed by the original instructions from that program line through the end of the program. This method is described below under Adding Instructions by Replacement. When instructions must be added in the middle of a long program, however, using this method will require you to key in numerous instructions — namely, the original instructions from the point at which the new instructions are added through the end of program memory. Since keying in these instructions may require a significant amount of time, in such situations you may prefer to use the method described below under Adding Instructions by

Branching.

That method basically involves branching to the new instructions which are stored at the end of program memory, then branching back to the program line immediately following the line from which you branched out. Adding instructions by branching is not so simple as adding instructions by replacement; however, it generally will require fewer keystrokes whenever there are more than four program lines between (and including) the first line to be executed after the new instruction(s) and the last line you keyed into program memory. Furthermore, if program memory includes branches to program lines following the point at which the new instruction(s) are being added, adding instructions by branching will not require that you change the line numbers specified in the i instructions, which may be necessary when you add instructions by replacement.

Adding Instructions by Replacement

1. Press fs to set the calculator to Program mode.

2. Press gi. followed by three digits that specify the last program line to be executed before the added instruction(s). This sets the calculator to the proper program line for adding the new instruction(s) in the next step.

3. Key in the new instruction or instructions.

File name: hp 12c pt_user's guide_English_HDPMF123E27 Page: 142 of 275

Printed Date: 2005/8/1 Dimension: 14.8 cm x 21 cm

Section 10: Program Editing 143

4. Key in the original instruction or instructions, beginning with the first instruction to be executed after the added instruction(s), and continuing through the last instruction you keyed into program memory.

Note:

If program memory includes branches to program lines following that at which the first new instruction is being added, remember to change the line number(s) specified in the i instruction(s) — as described above under Changing the Instruction in a Program Line — to the actual new line number(s).

Example: Assuming you have made the program modifications as in the preceding example, suppose you now wanted to insert a t instruction before the program calculates net income after tax so that the program will display the amount of the tax before displaying the net income after tax. The program should be modified by making the changes below:

Keystrokes

(RPN mode)

Display fs gi.008 t

-

Sets calculator to Program mode.

008, Sets calculator to last program line to be executed, which contains the b instruction.

009, Keys in new instruction. fs

15000t t

010, Keys in original instruction, which was replaced by new instruction added.

12,000.00

3,000.00

Sets calculator back to Run mode.

Twenty percent tax on $15,000 income.

12,000.00 Net income after tax.

Keystrokes

(ALG mode)

Display fs gi.011 t

Sets calculator to Program mode.

011, Sets calculator to last line keyed into program memory for original program.

012, Keys new instruction into program line 012.

File name: hp 12c pt_user's guide_English_HDPMF123E27 Page: 143 of 275

Printed Date: 2005/8/1 Dimension: 14.8 cm x 21 cm

advertisement

Key Features

  • Financial Pocket Black, Silver
  • 10 digits
  • Memory registers: 20

Related manuals

advertisement

Table of contents