HP 12C Basic Programming
|
09-09-2024, 06:53 AM
(This post was last modified: 09-09-2024 07:21 AM by C.Ret.)
Post: #3
|
|||
|
|||
RE: HP 12C Basic Programming
Bonjour,
The example given by Steve Simpkin is the best implementation for three independent programs to reside in the single program memory area of the HP-12C. Indeed, unlike other Voyagers more suited to this situation, the HP-12C lacks any user labels. The best way to manage this situation is indeed to use a sequence g GTO nn R/S to launch each program where nn corresponds to the first step of the destination program. This situation, which therefore requires typing a certain number of keys, can quickly become annoying with a large amount of data and slow down operations… or even call into question the practical interest of using a program! Below I put the keystroke's counts according to three scenarios: Code: Program entry (16 steps) {31} No program No program 0 DISPLAYED RESULTS: As we can see easiness greatly depend of the situations. If it happens that the two numbers are identical, obtaining the results of the three programs can require a lot of keystrokes with the use of the three programs launched by their respective GTO. In, this perhaps irrelevant case, where the two numbers are often the same for the three programs, it may be more judicious to consider a single program that gives the three results in sequence. In this case, and unique if we are mainly dealing with the same two numbers from which we want to have one or often more results from the three programs, the following example may be more appropriate: CODE: Press f P/R f CLEAR PRGM to enter Program Mode, clear Program memory and enter following programming from scratch Code: 01- 44 2 STO 2 10- 45 1 RCL 1 17- 45 1 RCL 1 This program is longer and uses two memory registers. But in some cases, it may be more appropriate (or not), depending on the number of data to be processed for which the user want to compare or obtain the results of more than one of the three programs. Its principle is to take the two numbers entered by the user in the X: and Y: registers and to successively display the result for each of the three programs. It also place the successive results in the stack in order. To move to the next display, the user only needs to press the R/S key. Typical use: only 11 keystrokes 123 f CLEAR PRGM 456 R/S display 56,188.00 (result PRG#1) Pressing R/S again display -99.73 (result PRG#2) Next R/S display 115.80 (result PRG#3) Now the stack contain Z: 56,188.00 Y:-99.73 and X: 115.80 If the user press an extra time on R/S, the program loops and re-display result of PRG#1. The mandatory f CLEAR RPGM keystrokes advantageously remplace pressing ENTER since it also reset the PC counter to the beginning of the code. Not all R/S presses are needed: one may stop as soon as he get the result of the specific program number needed. I hope this helps somewhat to better consider the multiple possible solutions and their disadvantages in the case of a situation where multiple programs are needed by the user of an HP-12C. Of course, for my point of view, the exemple given by Steve Simpkin is certainly the best and more general practical solution. Despite using another Voyager model such as the HP-11C or HP-15C |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
HP 12C Basic Programming - avsebastian - 09-09-2024, 02:51 AM
RE: HP 12C Basic Programming - Steve Simpkin - 09-09-2024, 03:58 AM
RE: HP 12C Basic Programming - C.Ret - 09-09-2024 06:53 AM
RE: HP 12C Basic Programming - avsebastian - 09-11-2024, 01:31 AM
RE: HP 12C Basic Programming - Nihotte(lma) - 09-11-2024, 10:43 AM
RE: HP 12C Basic Programming - Steve Simpkin - 09-11-2024, 06:03 PM
|
User(s) browsing this thread: 1 Guest(s)