My ASM is FORTH; my FORTH has no ASM. What am I? Drum roll. I am, I am, 5061-7269, of course! Also known as the 41-Translator for the HP-71B. I wrote about the HP-71B several time already (here, here, and here) and claimed arguably it is one of the best pocket computers ever made.
Today’s what am I riddle references yet another successful computational platform developed by Hewlett-Packard, the HP-41. This platform was so successful and appreciated by its users that even today, HP-41 clones are produced. A testimony to its success: NASA astronauts flying the Space Shuttle were complaining so much about the memory-crippled on-board computer system that they used HP-41C calculators in nine missions to carry out a few computations, including backup re-entry computations (here). Last evidence, if you need one, try buying a working model for less than a few hundred bucks.
Therefore, it is not surprising that newer HP calculators had to have some transition options to carry over the 41 users and their immense software library. When HP launched the 71B in the early ‘80s, the 41-translator module was that facilitator. All right, all this is fine, but what the link to the riddle?
It would help if you remembered that the 71B is an open computer, meaning highly configurable and expandable. The preferred mechanism to do so is using ROM modules to plug into the four expansion ports available. The 41-translator fits in one of those.
There was another remarkable module available for the 71B: the FORTH/Assembler (5061-7234). This module adds to the 71B a full-fledged FORTH system (FTH) based upon the FORTH-83 standard with HP extensions, including IEEE floating-point support, of course. It also includes an Assembler (ASM). An interesting adaptation to FORTH is imposed by the custom CPU of the 71B, which uses 4-bit words (nibbles) but has 64-bit wide registers. Regardless of how you parse this information, it doesn’t allow for a byte-oriented with 16-bit addresses FORTH as most were in that era. Instead, it is a nibble-oriented machine with 20-bit addresses. When possible, HP kept the familiar name of memory handling FORTH words and introduced nibble-flavored ones otherwise. Armed with such a module, you can develop complex software packages with the highest possible performance. Mainly because of the use of the ASM and the efficiency of the FORTH language.
When HP designed the 41-translator, they – wisely – decided to re-use the FORTH implementation of the FORTH/Assembler to run the 41-translation software (FTH41). Hence my ASM is FORTH. In fact, FTH41 is FTH with the ASM vocabulary replaced with the HP41 vocabulary. Simple and elegant, as FORTH can be. Using FORTH allows high-speed execution (three to eight times faster) of existing HP-41 code while relying upon an efficient software layer for the 71B. The module brings a true HP-41CV to the user, including its Reverse Polish Notation (RPN) entry (which is slightly different from an actual 41 and closer to a FORTH external interpreter, but that’s splitting hairs). If you enter an algebraic expression without using spaces alongside an RPN expression, that sub-expression is evaluated correctly! With this module plugged-in, you can switch seamlessly from the BASIC to the 41 and the FORTH environments. The cherry on the cake: variables created in an environment can be accessed in the others! Really cool and fills the RPN entry gap of the BASIC/Algebraic interpreter.
The name of the 5061-7269 module tells it all: this module translates existing HP41 software either entered via the editor or read from an HP-41 via HP-IL. The module is not really an emulator but a translator. This is the reason why, to make it almost usable, several copies of the HP41 code is maintained in the memory-based filesystem at different stages of the translation. Otherwise, we could not edit the code once it has been translated into FORTH, etc. The translator module has several limitations. Foremost, there is no SST (step debugging). It cannot translate ROM-based 41 software (besides the HP-IL and TIME modules), and – heresy – you cannot use it at the same time with the FORTH/Assembler ROM. But why would you want to do that first place? Then, due to the scarcity of these two modules, the odds that you own both are extremely low. To me, since the 41-translator’s FORTH doesn’t have an assembler (hence my FORTH has no ASM), both ROMs are desirable simultaneously. What a dilemma.
The reason behind this incompatibility resides in the implementation of the FORTH by HP: the memory location of the FORTH ROM is fixed and non-relocatable (hard-configured ROM, from E0000 to EFFFF). Since both modules use the same addresses, the HP-71B fails to boot because of the conflicts. To be fair to HP-41 users, this was not a problem at all since they only wanted to transition to the 71B platform without having to re-write their software library. I solve the dilemma this way: one HP-71B with FORTH/Assembler for hardcore rainy coding days, and another HP-71B with 41-translator for 41 fun days. Luxurious!
Note: space photos are © by NASA and The Smithsonian National Air and Space Museum