HP HP-12C Classic, HP-12C Platinum Calculator Programming Guide
PDF
Dokument
Reklama
Reklama
Programming Basis A program in The HP-12C calculator is simply a sequence of keystrokes that is stored in the calculator. Whenever you have to calculate with the same sequence of keystrokes several times, you can save a great deal of time by incorporating these keystrokes in a program. Then pressing only one key the keystrokes sequence starts and the calculator does the rest automatically!. Creating a Program: 1) In the Platinum model, specify the Logic mode you want to use “ALG” or “RPN pressing or . The Classic model always works in “RPN” mode. 2) Press to set the calculator to “Program” mode. In this mode, functions are not executed when they are keyed in, but instead are stored inside the program memory. The display will show the “PRGM” indicator lit, and the program line number (from 000 to 999) with the key codes of keystrokes. 3) Press clear to erase any previous programs that may be stored inside the calculator. If you want to create a new program without erasing a program already stored, skip this step. 4) Key in the sequence of keystrokes that conform the program. 5) When the keystrokes sequence finish, press to set the calculator back to “Run” mode. The display will be normal showing the stack-X registers and the “PRGM” indicator will vanish. Running a Program: Once a program is created, key in any data that the program uses and just by pressing the key, the program start and the calculator does the rest automatically. When a program is running, touching any key will stop execution after the current line. Programming Special Keys The calculator has several special keys that only have meaning when you are dealing with programs. Some of them are programmable and others don’t. The not programmable ones are for reviewing or debugging a program. The programmable ones are for controlling the program execution, like display intermediate results, perform a conditional jump o continue the execution at specific program line. Non Programmable Commands: Command Description In Program Mode: Sets the calculator to “Run” mode and reset the program line to 0. In Run Mode: Sets the calculator to “Program” mode and displaying the current program line. clear In Program Mode: Clears the program memory and stores the current logic mode (ALG or RPN) command in program line “000”. In Run Mode: Sets program line to the beginning of the program memory, program line “000”. In Program Mode: Advances the calculator to the next program line in the program memory. In Run Mode: Shows the current program line, executes it and advances the calculator to the next program line. In both modes, sets the calculator to the previous line in program memory. In both modes, followed by three digits “DDD”, sets the current program line to the designated “DDD” line in program memory. Programmable Commands: Command Description In Program Mode: Enters the Run-Stop command. In Run Mode: Starts the program execution from the current program line in program memory. In a Program Execution: Stops program execution and shows the normal display (stack-X). In Program Mode: Enters the Pause command. In Run Mode: Does nothing. In a Program Execution: Stops program for about 2 seconds showing the normal display (stack-X), and then resumes the program execution. In Program Mode: Followed by three digits “DDD”, enters the Go to line “DDD” command. In Run Mode: Followed by three digits “DDD”, sets the current program line to the designated “DDD” line in program memory.. In a Program Execution: Jumps the program execution to the designated program line. In Program Mode: Enters the comparison command. (stack-X ≤ stack-Y?) In Run Mode: Does nothing. In a Program Execution: (stack-X = 0?) If condition is False -the program execution skips the next line. If True, the next line is executed. NOTE: A running program automatically stops if a instruction or is executed. It also stops if an Error condition arises from a improper operation or if any key is touched during the execution or if the next line to execute is empty. Example: Variable Tax Rate Program The following program calculates income tax and the net value applying different tax rates depending on the value entered. If the value if less than or equal to a test value, the tax rate stored in R1 is used, otherwise the tax rate stored in R2 is used. The test value is stored in R0 . Enter the program in the calculator following the next sequence: (RPN mode) Keystrokes Display Description Sets the calculator in “Program” mode clear 000, 42 001, 45 0 Recall the test amount for comparison. 002, 003, Clear the program memory and enters the RPN 16 code in line 000. 34 Swap stack-X and stack-Y 43 34 Compare the entered value with the test value. Execution continues at line 007 if the entered 004,43,33,008 value is less than or equal the test value. Recall the tax rate for amounts greater than the 005, 45 2 test value. 006,43,33,008 Jump to line 008 to calculate the tax amount Recall the tax rate for amounts of less than or 007, 45 1 equal to the test value Calculate the tax amount applying the proper tax 008, 009, 25 rate to the entered value. 43 31 Pause execution to display the tax amount Subtract tax amount from the entered amount 010, 30 and program stops showing the net amount. 0.00 Sets the calculator in “Run” mode (ALG mode) Keystrokes Display Description Sets the calculator in “Program” mode clear 000, 42 Clear the program memory and enters the RPN 26 code in line 000. 001, 44 9 Stores the input number to further use. 002, 45 0 Recall the test amount for comparison. 003, 34 Swap stack-X and stack-Y 004, 10 amount 005, Enter multiply operation to calculate the tax 43 34 Compare the entered value with the test value. Execution continues at line 009 if the entered 006,43,33,009 value is less than or equal the test value. Recall the tax rate for amounts greater than the 007, 45 2 test value 008,43,33,010 Jump to line 010 to calculate the tax amount Recall the tax rate for amounts of less than or 009, 45 1 equal to the test value 010, 25 Divide the proper tax rate by 100. 011, 36 Calculate the proper tax amount. 012, 43 31 Pause execution to display the tax amount Change the sign of the tax amount to subtract it 013 16 from the entered value. 014, 40 Enter add operation. 015, 45 9 Recall the entered value. Subtract tax amount from the entered amount 016, 36 and program stops showing the net amount. 0.00 Sets the calculator in “Run” mode If the test value is $20,000; the tax rate for values less than or equal to test value is 20%, and for grater values is 25%. What is the tax amount and the net amount for $15,000; $20,000 and $25,000 incomes?. Keystrokes Type “20000” Type “20” Type “25” Type “15000” Type “20000” Type “25000” Display 20,000.00 Description Type the test value and store it in R0. 20.00 Type the tax rate for values ≤ test value and store it in R1. 25.00 Type the tax rate for values > test value and store it in R2. “running” 3,000.00 “running” 12,000.00 Type the Income value and run the program. The program pauses to display the tax amount, then continues and ends showing the net amount. “running” 4,000.00 “running” 16,000.00 Type the Income value and run the program. The program pauses to display the tax amount, then continues and ends showing the net amount. “running” 6,250.00 “running” 18,750.00 Type the Income value and run the program. The program pauses to display the tax amount, then continues and ends showing the net amount. NOTE: For a complete explanation, details and program examples, please download the HP-12C Platinum Owner’s Manual from the Hewlett-Packard website at “www.hp.com” As a special feature, the calculator has a very convenient Program Execution tool to review and debug a program. To show it, expand the calculator pressing the key and in the "Option Selection Menu", select the "Program Execution” option. ">
/
Pobierz
Tylko małe przypomnienie. Możesz wyświetlić dokument tutaj. Ale co najważniejsze, nasza sztuczna inteligencja już go przeczytała. Może wyjaśnić złożone rzeczy w prosty sposób, odpowiedzieć na Twoje pytania w dowolnym języku i pomóc w szybkiej nawigacji nawet po najdłuższych lub najbardziej skomplikowanych dokumentach.
Reklama