Synthetcic Programming on the HP 41C series Calculators

Introduction

The HP 41C calculator was released in 1979 and was the first calculator with an alpha display. It also had a card reader that could plug into one of the four expansion ports that matched the calculator profile, a thermal printer that could also plug into an expansion port and a series of HPIL peripherals that used an HPIL (HP Inderface Loop, a serial implementation of the IEEE488 protocol) that also pluged into an interface port. The card reader was so designed that of the three remaining ports one was open to allow the printer or HPIL interface to be attached at thye same time.

The calculator had what was called "keystroke" programming. In short the user could switch to program mode, enter any series of legal keystrokes which could be repeated at will by executing the program. The programming language on the HP 41C was extremely powerful and could be extended by ROMS or peripherals that plugged into any of the four expansion ports. The user also had access to memory locations, including the stack, memory, and extended memory in the case of the extended memory or extended functions modules, both of which were internal in the HP 41CX. The programmer also had access to an alphanumeric character set for use with such things as labels, prompting the user, displaying results of games as well as for use with note taking and time functions. 

Synthetic Programing

There are also a number of internal registers that the calculator uses for flags, and temporaty results, for instance that the user does not have direct access to. In addition there are many combinations of the 16 segment display that are not available through the user interface.

Those who are familiar with assembly programming (low level programming on a CPU) will know that each CPU instruction consists of several bytes, you operator, and then operands. You operator for instance may be "store from register A into memory location X" This may be a two byte instrction. Instructions will vary in length and you program will consist of a series of these instructions. The HP 41C series is no different. Each line in your program is represented at a low level by a series of hex low level instructions. 

Now here is where it gets interesting. There are more instructions at a low level than there are avaiable to the user and there are more display characters than are available to the user using normal programming techniques. William C. Wickes discovered that a firmware bug in early HP 41C revisions allowed him to enter instructions that were not part of the known user instruction set. He started investigating what these insructions did and discovered a whole host of new undocumented instructions. Many were similar to existing instructions, such as the above "store" example but with operands that resulted in interesting outcomes.

Over time all of the extend instructions were investigated and documented resulting in what is now termed Synthetic Programming. The HP 41C was an extremely popular calculator, indeed I contend that it was the most successfull calculator being available unchanged except for the addition of more internal storage and functions, from 1979 through to 1991, twelve years. As a result of the popularity of the calculator and its audience, mainly eingineers and accademics, Synthetic Programming exploded with user groups dedicated to it and programs and expansion ROMs being made available through the user groups, mainly the PPC User's Group (Personal Program Center). 

The main advantages of synthetic programming were two. Programs could be shorter, more efficient and faster. Especially in the early days when memory was more of a premium, some programs were too long for the origonal HP 41C so through synthetic programming these programs could be run on the HP 41C. Also due to the speed of the calculator reducing the run time of a program was very important. The second advantage was to be able to display many more didplay characters. I have a Synthetic version of hangman which uses these additional display characters to build a gallows ising these additoinal characters.

The Synthetic Programming community grew as did the publications and resources but to this day the difinitive publication is "Synthetic Programming On The HP-41C" by William C. Wickes. This is like hens teeth but there are may resources avaialble by doing a  google search.