HP-41C
The HP-41C series are programmable, expandable, continuous memory handheld RPN calculators made by Hewlett-Packard from 1979 to 1990. The original model, HP-41C, was the first of its kind to offer alphanumeric display capabilities. Later came the HP-41CV and HP-41CX, offering more memory and functionality.
The alphanumeric "revolution"
The alphanumeric LCD screen of the HP-41C revolutionized the way a pocket calculator could be used, providing user friendliness and expandability. By using an alphanumeric display, the calculator could tell the user what was going on: it could display meaningful error messages instead of simply a blinking zero; it could also specifically prompt the user for arguments instead of just displaying a question mark.Earlier calculators needed a key, or key combination, for every available function. The HP-67 had three shift keys ; the competing Texas Instruments calculators had two and close to 50 keys. Hewlett-Packard were constrained by their one byte only instruction format. The more flexible storage format for programs in the TI-59 allowed combining more keys into one instruction. The longest instruction required eleven keypresses, re-using the shift keys four times. The TI-59 also made use of the Op key followed by two digits to access another 40 different functions, but the user had to remember the codes for them. Clearly, a more convenient and flexible method of executing the calculator's instructions was needed. The HP-41C had a relatively small keyboard, and only one shift key, but provided hundreds of functions. Every function that was not assigned to a key could be invoked through the XEQ key and spelled out in full, e.g. XEQ FACT for the factorial function.
The calculator had a special user mode where the user could assign any function to any key if the default assignments provided by HP were not suited to a specific application. For this mode, the HP-41C came with blank keyboard templates; i.e. plastic covers with holes for the keys, so the user could annotate customized keys. Hewlett-Packard even sold a version of the calculator where hardly any keys had function names printed on them, meant for users who would be using the HP-41C for custom calculations only ; this version of the calculator was colloquially known, within HP's Corvallis calculator team, as a "Blanknut".
Alphanumeric display also greatly eased editing programs, as functions were spelled out in full. Numeric-only calculators displayed programming steps as a list of numbers, each number generally mapped to a key on the keyboard, often via row and column coordinates. Encoding functions to the corresponding numeric codes, and vice versa, was left to the user, having to look up the function-code combinations in a reference guide. The busy programmer quickly learned most of the codes, but having to learn the codes intimidated the beginners. In addition to this, the user had to mentally keep function codes separate from numeric constants in the program listing.
The HP-41C displayed each character in a block consisting of 14 segments that could be turned on or off; a so-called fourteen segment display. The HP-41C used a liquid-crystal display instead of the ubiquitous LED displays of the era, to reduce power consumption.
While this allowed the display of uppercase letters, digits, and a few punctuation characters, some designs needed to be twisted arbitrarily and lowercase letters were unreadable. HP's competitor Sharp, when introducing the PC-1211, used a dot matrix of 5×7 dots and displayed the characters in principle as we see them today on computer screens ; this was later used by HP with the HP-71B handheld computer.
The HP-41CV and CX
Many users had used all four ports for memory expansion, leaving no room for other modules. HP designed the Quad Memory Module with four times the amount of memory, providing the maximum available memory and leaving three empty ports available. The HP-41CV included this memory module on the main board, thus providing five times the memory of the HP-41C, and four available slots.The internal architecture prohibited the addition of more memory, so HP designed an extended memory module that could be seen as secondary storage. You could not access the data directly, but you could transfer it to and from main memory. To the calculator, data located in the extended memory looked like files on a modern hard disk do for a PC.
The final HP-41 model, the HP-41CX, included extended memory, a built-in time module, and extended functions. It was introduced in 1983 and discontinued in 1990.
Programming
The HP-41C is keystroke programmable meaning that it can remember and later execute sequences of keystrokes to solve particular problems of interest to the user. These keystroke programs, in addition to performing any operation normally available on the keyboard, can also make use of conditional and unconditional branching and looping instructions, allowing programs to perform repetitive operations and make decisions.The HP-41C also supports indirect addressing with which it is possible to implement a Universal Turing machine and therefore the programming model of the HP-41C can be considered Turing complete. The combination of indirect addressing and gotos easily led to spaghetti code.
Program steps are numbered starting from 1, but this numbering has no intrinsic meaning and changes as new instructions are added or removed in the middle of a program. A special LBL instruction is used to create a label that is then referenced by the user to invoke the program, or by the program itself as target of a GTO or XEQ instruction.
Programming example
Here is a sample program that computes the factorial of an integer number between 1 and 69, that integer being passed as a parameter via the X register. The program takes up 2 registers which is ≈14 bytes.Step Op-code Comment
01 LBL'Fac ALPHA label makes program callable by 'XEQ Fac'
02 STO 00 Store X=parameter in register 0
03 1 Enter 1 in X, "lifting", or "pushing", the stack; Y=parameter
X=1
04 LBL 00 Label for goto
05 RCL 00 Recall register 0 into X, lifting the stack; Z=parameter
Y=1 or interim or final factorial
X=parameter or N-I decrement
06 * Multiply X and Y, "dropping", or "popping", the stack; Y=parameter
X=interim or final factorial
07 DSE 00 Decrement register 0 and Skip next command when register value is Equal to 0
08 GTO 00 Go to label 0
09 END End program - result displayed in X
FOCAL
Though the programming language used on the 41 series is a version of the keystroke programming languages used all preceding programmable HP calculators, the range of technologies, and programming-related usability and extensibility features available in 41 series models, led some users to propose a new name for the language, resulting in a competition that was won by "FOCAL" for "Forty One Calculator Language". As the name FOCAL was already in use by the Digital Equipment Corporation, the name was never formally adopted by HP.Synthetic programming
A large users' community was built around the HP-41C. Enthusiasts around the world found new ways of programming, created their own software and expansion modules, and sped up the clock. Most of these activities were coordinated by the PPC club and its president, Richard J. Nelson. The PPC club published the PPC Journal and produced the PPC ROM, a collection of highly optimized low-level programs for the HP-41C.One of the discoveries of the community was that, because some FOCAL instructions were stored in memory as more than one byte, it is possible to exploit a bug in the program editor to assign strange functions to keys. The most important function was known as the byte jumper, a way to step partially through programming instructions and edit them in ways that were not otherwise allowed. The use of the resulting instructions was called synthetic programming.
Through synthetic instructions, a user could access memory and special status flags reserved for the operating system, and do very strange things, including completely locking the machine. It was possible to create sounds or display characters, and create animations not officially supported by the operating system. The system flags were also accessed as low-level shortcuts to boolean programming techniques. Hewlett-Packard did not officially support synthetic programming, but neither did it do anything to prevent it, and eventually even provided internal documentation to the user groups.
Reception
In its December 1980 issue, BYTE magazine described the HP-41C as "the most versatile machine ever". The author praised HP's documentation as "among the best in the industry", and reported that the calculator was "much easier to program and debug" than the TI-59. Stating "I found the HP-41C far more pleasurable to program and use than its predecessors" because of its alphanumeric display, the author concluded that it was "maybe not quite" a pocket computer. In the next issue, another author wrote that "The HP-41C ... is among the programmable calculators that lie closest to the computer borderline. It comes close enough for the jargon of computers to be useful in describing it", and praised the simplicity and reliability of the card reader and compatibility with HP-67 and HP-97 software. The review criticized the inaccuracies in calculations from the lack of guard digits; "There is something absurd about the world's fanciest calculator not being able to give results accurate to more than seven or eight decimal places". Hewlett-Packard responded that the alleged imprecision was inherent to arithmetic on any computer with finite precision.Use on the Space Shuttle
A HP-41C that flew on nine early Space Shuttle missions is on display in the National Air and Space Museum in Washington, D.C. HP-41Cs with some special hardware configurations were carried on early Shuttle missions for the purpose of performing mundane but necessary calculations, such as calculating the change to the center of gravity due to fuel consumption. The HP-41C was also programmed to handle calculations usually performed by the main on-board computer, such as determining ignition times for re-entry, in the case of a main computer failure.Expandability
The functions of the calculator could be expanded by adding modules at the top of the machine. Four slots were available to add more memory, pre-programmed solution packs containing programs covering engineering, surveying, physics, math, finance, games, etc. As such, an HP-41 could in fact be tailored to the personal needs of the user. Hardware extensions included a thermal printer, a magnetic card reader, and a barcode "wand".Extension modules could also add new instructions to the machine. The standard set of mathematical functions of the 41-series was somewhat limited when compared to the functionality of some contemporary HP calculators. Among others, the standard function set offered no integration or root-finding capabilities and lacked support for matrices and complex numbers; these extra functions could be added by an extension module.
Another module, known as the Interface Loop allowed for connection of more peripherals: larger printers, microcassette tape recorders, 3½-inch floppy disk drives, RS-232 communication interfaces, video display interfaces, etc. The Interface Loop could also be used with the HP-71B, HP-75 and HP-110 computers.
HP-41 extension modules allowed the user of a HP-41 programmable calculator to extend the functionality of the machine. The HP-41 had room for up to four expansion modules at the back of calculator.
The HP-41 was not the only calculator of its generation that allowed expansion modules. The TI-58 and TI-59 also had pluggable ROM modules. The HP-41 modules were however much more versatile.
Memory modules (HP-41C only)
Memory modules added RAM main memory to the calculator, allowing more programming steps and/or more data registers.The original HP-41C had a main memory of 63 registers of 7 bytes each. Each register could hold either a number, a 6-character string, or up to seven program steps in the FOCAL language.
Each memory module added 64 registers, and the calculator could hold up to four of them, for a grand total of 319 registers. While this was considered huge for the time all expansion slots were used. User groups found a way to merge two memory chips in a single module, thus freeing two expansion slots. HP designed a module holding all four in one slot, the so-called Quad Memory Module. The later HP-41CV had the quad module built-in.
Application pacs
The ROM-based application 'pac' modules added up to 4 kilobytes of read-only memory. Most modules held dozens of programs written in the HP-41C programming language, FOCAL.Programs in the ROM modules could be called from a user program, using the ubiquitous XEQ function. In the program code, XEQ appeared as "XROM" when it was used to call a ROM program.
82104A card reader
The card reader was a device able to read and write small rectangular plastic cards with two magnetic strips. The card reader could copy contents of memory onto magnetic cards, and later read back the data into memory.As the HP-41C had non-volatile memory there was no absolute need for a permanent storage device, so the card reader was optional.
Each card held two strips of 112 bytes each, that could hold 16 data registers or up to 112 program steps. This limited capacity resulted in typical programs requiring five or more magnetic cards to be saved. A full backup of the machine's 319 memory registers plus internal data required 11 magnetic cards
The card reader could read magnetic cards from the earlier model HP-67. HP-67 programs were translated into HP-41C instructions, as the HP-67 and HP-41 share the same programming model and operation stack. Some instructions however were specific to the HP-67, and the card reader provided additional instructions to emulate the 67.
Magnetic cards could be write-protected, and programs saved as private: once loaded back, the source code for the program could not be displayed. This made magnetic cards an obvious choice for program distribution.
However, the electric motor put a heavy strain on the calculator batteries, and the price tag for blank cards put an even heavier strain on the user's wallet.
82182A time module
The time module added a real-time clock. The clock allowed use of real-world time in programs. The user could set alarms that triggered calls to user programs. The alarms were able to switch the calculator on, so it was possible to create programs that executed at some point during the day, then switch the calculator off until the next alarm. As the HP-41 was often used as a data-gathering device in labs, this allowed the calculator to read data from monitored devices at specific times every day, without having to remain fully powered up in between readings.The HP-41CX had the time module built in.
82143A thermal printer/plotter
The printer used rolls of thermal paper to print lines of up to 24 characters. The thermal paper provided for a bluish printout, but was somewhat unstable, as the printout could vanish or the whole paper turn blue due to excessive heat.The printer had some graphical capabilities, to allow the user to design character shapes, or even turn on or off individual pixels. However, the buffer memory could not hold sufficient information to print a whole line in graphic mode, and could not alter line spacing, so it was impossible to print continuous graphics in horizontal mode. The printer, nevertheless, provided some printing utilities that were able to graph a function vertically onto the narrow strip of printer paper.
82242A infrared printer interface
Instead of using the aforementioned printer, this module could be used to interface a thermal printer with an infrared interface, namely the HP 82240A and the HP 82240B. This allows for on-the-go printing without using cables - but the printer itself needs batteries as well.82153A optical wand
The optical wand was a barcode reader shaped like a thick pen, and was designed to read lines of HP-proprietary standard barcodes into the calculator memory. The barcodes, printed in e.g. HP solutions books, could consist of programs, numeric or alphabetical constants, and even keypresses — useful for diagnosing calculators where the keyboard was suspected to be faulty.82180A extended functions module
The Extended Functions module added many functionalities the users had wanted for ages, as the ability to programmatically assign functions to keys, repartition memory, etc.But the most important new function was the management of extended memory: while the HP-41C could theoretically access up
to 1024 registers, the early design limited main memory to 319 registers only. The Extended Functions module added instructions
to manage a bank of additional memory in the available addressing space of the machine. As this memory was not directly
addressable by user programs, it was seen as a set of named files containing either programs or data. Programs and data registers could
be copied back and forth from the extended memory to the main memory, where they could be accessed as usual.
Extended memory could also hold ASCII files, and a rudimentary text editor was added also.
The Extended Functions module contained 124 registers of Extended memory. More could be added by... Extended Memory modules.
The HP-41CX contained the Extended Functions module as standard.
82181A extended memory module
Extended memory modules added more extended memory to the HP-41C. They required an extended functions module to be present, or theHP-41CX version of the calculator.
Each module added 238 registers of extended memory. Up to two extended memory modules could be inserted, for a grand total of
124 + 2*238 = 600 registers. Added to the 319 registers of main memory, this covered practically all of the machine's 1024
addressable registers, for a total of 919 registers, or 6433 bytes.