How to write hp 41cx programs


















Thirty-four years later, my good old CV is sitting on my desk at work, with a CX bought a month ago next to it. So what follows goes for both. The love has grown over the years - this machine helped me through 3 years of high school and 5 years of engineering studies, and has been my companion for all the years after that.

HP has made awesome calculators over the years, but I keep coming back to the I have and use all of these regularly, which is another testament for the legendary HP quality.

Back to the 41 though - it has a keyboard that's the best ever, bar none. Thousands of user-written programs are available for it, it still has active internet groups and several websites dedicated to it. It has been on several space shuttle flights.

Yes, today's calculators are an order of magnitude faster. Yes, they have graphical displays and loads more memory. Yes, they're cheaper than a year old 41! When programs are written, the calculator also records any key assignments of labels in the program, however, these assignments will only be restored if the calculator is in USER mode when the card is read.

When the card is read, the program it contains will be written into the program memory between the last END instruction and the end of the calculator's memory.

This means that if your last program doesn't have an END instruction, it will be overwritten by the program on the card. Pressing GTO.. If you want the key assignments on the card to be read, be sure to activate USER mode before reading the card. When the calculator is not in USER mode, the calculator ignores the key assignments on the card. This can be handy when you don't want the card to change your current USER keyboard.

Now insert track one of the card label side up. If the program is longer than 16 registers, the calculator will display RDY nn OF tt where nn is the number of the next track to be read and tt is the total number of tracks that will be read. Reverse the card direction for the 2nd track and continue as needed. The registers and the stack are not changed when a program is written or read.

A card can be marked as private which means that it can be read and the program can be executed, but the program can't be viewed, edited, or copied onto another card. The calculator will then give you the RDY nn OF tt prompt and you proceed as in writing a normal program card. The RSUB read subroutine function can be used in a program to read in a card which replaces the last program in memory. The RSUB function simply reads the card and returns to the program. The program can then XEQ any label loaded from the card.

The MRG merge program function may be used from the keyboard or in a program and causes instructions on a card to replace the instructions following the current location of the calculator the instructions after the MRG if MRG is used in a program.

The program position is unchanged by the MRG. The current program must be the last program in memory, meaning it must end with the permanent. The calculator prompts you with RDY nn OF tt see above messages until all the registers have been recorded. WDTAX is a more complex command that gives you control over which registers are written. A number of the form bbb.

For example If eee is greater than the highest register, the calculator writes to the end of the allocated registers. The overwrite flag 14 discussed in the programs section above may also be set to overwrite protected data cards.

Data is loaded starting at R00 which may not be what you want so the RDTAX instruction may be used to get more control. This command takes a number of the form bbb. It is essentially the same as inserting data card without any command as the data is read starting at R When reading data CARD ERR will be displayed if there are not enough storage registers allocated to hold the data on the current track. Use SIZE to increase the number of registers. Program memory is not changed when data is written or read.

To read a status card, just make sure the calculator is not in PRGM mode and insert the card. WALL can't be keyed in as part of a program. When reading back cards, the calculator configuration optional modules, and peripherals should be identical to the configuration present when the cards where written. Then insert the card. Press for the lower-case shifted labels. Thus, the calculator must be positioned within that program for these keys to be used. When the card is read, the HPC sets the calculator to point at the newly loaded program.

The optical wand plugs into one the ports on the HPC and allows it to read barcode programs, data and even keystrokes. The wand should be plugged into a higher numbered port than any memory modules in use. Before loading a program, check its register requirements and execute a SIZE function if necessary. Place the tip about 1 cm in front of the row of codes to be read, press the scan switch and scan across the barcodes at a relatively fast and constant speed.

Most speed problems are caused by scanning too slow. Make sure to the wand doesn't drift above or below the row of bars and after you've swept beyond the end of the row, release the scan button. If the data was successfully read, the HPC sounds a short tone.

If the scan was unsuccessful, a longer error tone is sounded. After you scan data or a keystroke, it is entered or executed. Most programs require multiple rows of bar codes and the calculator will display W: RDY nn where nn is the number of the next row to be read.

HP's program bar codes have a human readable label which indicates the row number and range of steps it contains in the form "ROW first - last ". As with the card reader, a program read from the card reader overwrites the last program in memory.

To preserve the last program in memory, press GTO.. Bar codes can also contain simple keystrokes and data as well as programs. You can drive your HPC by scanning codes and never touching the keyboard. The WNDDTA program can be used in a program to cause the program to pause and prompt the user to enter a single row a barcode. The user is prompted to scan the data bardcode rows with W: SC TO nn where nn is the register in which the data about to be scanned will be placed.

The WNDLNK wand link function causes the program to halt so the user can scan a subroutine that will be loaded and executed. If additional rows are needed, the calculator prompts with the standard W: RDY nn. After the subroutine is scanned, it is automatically executed. It is the wand analogue to RSUB. USER mode remains active even if the calculator is turned off and on. ALPHA The blue legends on the keys are active for specifying strings including prompts and program names.

The label on the bottom of the calculator shows other shifted alpha functions. PRGM The calculator is ready to record programs. The PRGM annunciator also shows along with a moving busy indicator when a program is executing. The calculator executes the white and shifted yellow functions immediately. In most of the following text, where normal mode is called for, USER mode is also acceptable.

Normal mode often just means not PRGM mode. Program Memory Programs and storage registers share the same memory in the calculator. Stopping, Interrupting and Entering Data Many programs only require data to be entered at the beginning as the one above did. Stepping And Editing programs The following commands are used to edit or step through programs and are not recordable. If you don't specify a name i.

SST steps one instruction ahead. In normal mode the next instruction is displayed when the key is held down and then executed when it is released. The X register is then displayed making this instruction useful for debugging. As with other keys, holding it for more than a second will cause it to display NULL and not execute the next instruction or step ahead. It can also be used for moving forward without execution in PRGM mode.

BST backs up one instruction. DEL prompts you for a three-digit number and then deletes that many instructions from the current point downward.

It will not delete past the END instruction. The display will show 00 REG which indicates the number of registers that are available in program memory and step number within this program It also places an END at the end of the last program if one is not already present.

This may be used in both PRGM and normal mode. No execution takes place in either mode. Very long programs could contain more than lines. In this case, GTO. EEX nnn is used to go to line 1nnn. The point before alhalbl keeps this instruction from being recorded in PRGM mode. Your program can set, clear or test them as needed. Special Purpose Flags 11 through 20 These flags can also be set tested and cleared in your program, however they have special meaning to the calculator and sometimes it controls them.

Automatic Execution Flag If flag 11 is set the HPC automatically begins executing the current program whenever the calculators turned on. Card Reader Overwrite Flag When set, flag 14 allows you to overwrite write-protected cards with the optional card reader. Printer Enable Flag 21 This flag is used to enable or disable printing. Printing is enabled when this flag is set. Data Entry Flags 22 and 23 These two flags detect keyboard input.

The calculator sets flag 22 when numeric data is entered from the keyboard and flag 23 when alpha data is entered. Both flags are cleared each time calculator is turned on. If flag 24 is set range errors are ignored and numbers such as 9.

Flag 24 remains set until you clear it. If flag 25 set other errors are ignored. Flag 25 is cleared each time an error occurs. Audio Enable Flag 26 This flag controls whether tones are produced. User Mode Flag 27 This flag is used to place the calculator in user mode. Number Display Control Flags 28 to 29 Flag 28 controls the radix and separator marks. It may be set for American or European styles. When flag 29 is set groups of three digits are separated with commas or points depending on the setting of flag Catalog Flag 30 For internal use.

Peripheral Flags 31 through 35 These flags are used internally for the operation of certain peripherals. Number Of Digits 36 through 39 These flags are used internally to control the number of digits displayed. Display Format Flags 40 and 41 These flags control the display mode. When flag 43 a set the calculator is in RAD mode. If it is clear the calculator will turn off after 10 minutes of inactivity.

System Data Entry Flag 45 Used internally and always tests clear. Partial Key Sequence 46 Used internally and always tests clear. Shift Set Flag 47 Used internally and always tests clear. Low Battery Flag 49 When this flag is set battery power is low. The BAT annunciator will also show in the display when this flag is set.

Message Flag 50 If set, the display contains some message not the Alpha or X register. SST Flag 51 Used internally and always tests clear. In this case register Y Store 20 in the register indicated by the Y stack register. C, FC? This is a key sequence not a program! The indirect register can contain a non-integer number but only the integer part is used. Looping Constructs Two looping functions are available: ISG nn: increment register nn, skip if greater DSE nn: decrement register nn, skip if equal For both functions, register nn is loaded with a number of the form iiiii.

The following example counts from 0 to by 5s displaying each number for about a second. Alpha strings below , allow inputs and outputs to be labelled.

CLD clears the display and the register that is currently being displayed X or Alpha. Keys assigned by the user keyboard via ASN override the labels printed on the calculator. The blue legends on the keys are active for specifying strings including prompts and program names.



0コメント

  • 1000 / 1000