Post Reply 
Which calculators run RPL under the hood?
11-29-2019, 03:47 PM (This post was last modified: 12-09-2019 09:08 PM by Giuseppe Donnini.)
Post: #11
RE: Which calculators run RPL under the hood?
(11-27-2019 02:16 PM)Dave Britten Wrote:  Which calculators run RPL under the hood?

Very interesting question! Let's take a closer look at it.


I will only cover what I would like to call the "classic RPL period," which—at least for the public outside HP—begins in June 1986 with the introduction of the HP-18C, and ends in May 1999 with the introduction of the HP-49G, the first calculator developed without any involvement of the former Corvallis team. Others, who are much better qualified than myself to talk about the following era, may add information about the ACO calculators as well as the more recent machines.

As a matter of fact, the HP-48G+, introduced in March 1998, was already an ACO project; nevertheless, it is included in this discussion, since it is, apart from the bigger RAM chip (128K), identical to the HP-48G. This leaves the HP-38G, introduced in April 1995, as the last true brain-child of the old Corvallis team.

According to Bill Wickes, leader of the team that designed the RPL operating system, one of their prime objectives was

"to streamline calculator development and support a new generation of hardware and software"

and, more specifically,

"to support a variety of business and technical calculators."

(see William C. Wickes, "RPL: A Mathematical Control Language" in: Lawrence P. Forsely (Ed.), Proceedings of the 1988 Rochester Forth Conference: Programming Environments, Rochester, New York: Institute for Applied Forth Research, pp. 27–32. Part of the article is reproduced in the RPLMAN.DOC file accompanying HP's official RPL compiler and SATURN assembler tools.)

As explained by Charlie Patton—one of the key architects of RPL—, the operating system is flexible enough to adapt to the specific needs of different target machines:

"RPL provides scaffolding for the construction of a system, as well as a basis for operation. The complete version has considerably more structure and functionality than was used in developing either the HP-18C or the HP-28C, although the subsets used in these two machines are rather different. There are explicit points at which the system can be either contracted or expanded and still maintain logical coherence and system integrity. This allows RPL to be used in a variety of situations."

(see Charles M. Patton, "Symbolic Computation for Handheld Calculators" in: Hewlett-Packard Journal, Vol. 38 no. 8, August 1987, pp. 21-25.)

Between June 1986 and May 1999, HP introduced 22 machines fitting Bill Wickes' description, which makes them all potential candidates for being internally based on some version of the RPL operating system. In chronological order, these are:

     | MODEL #  |  CODE NAME  |    CLASS    |   INTRO    |
|  1 | HP-18C   | Champion    | CLAMSHELL   | 1986.06.01 |
|  2 | HP-28C   | Paladin     | CLAMSHELL   | 1987.01.05 |
|  3 | HP-17B   | Trader      | PIONEER     | 1988.01.04 |
|  4 | HP-19B   | Tycoon      | CLAMSHELL   | 1988.01.04 |
|  5 | HP-27S   | Mentor      | PIONEER     | 1988.01.04 |
|  6 | HP-28S   | Orlando     | CLAMSHELL   | 1988.01.04 |
|  7 | HP-22S   | Plato       | PIONEER     | 1988.06.01 |
|  8 | HP-32S   | Leonardo    | PIONEER     | 1988.06.01 |
|  9 | HP-14B   | Midas       | PIONEER     | 1988.10.31 |
| 10 | HP-42S   | Da Vinci    | PIONEER     | 1988.10.31 |
| 11 | HP-10B   | Ernst       | PIONEER     | 1989.01.03 |
| 12 | HP-20S   | Erni        | PIONEER     | 1989.01.03 |
| 13 | HP-21S   | Monte Carlo | PIONEER     | 1989.01.03 |
| 14 | HP-17BII | Trader II   | PIONEER     | 1990.01.06 |
| 15 | HP-19BII | Tycoon II   | CLAMSHELL   | 1990.01.06 |
| 16 | HP-48SX  | Charlemagne | CHARLEMAGNE | 1990.03.06 |
| 17 | HP-32SII | Nardo       | PIONEER     | 1991.03.01 |
| 18 | HP-48S   | Shorty      | CHARLEMAGNE | 1991.04.02 |
| 19 | HP-48G   | Alcuin      | CHARLEMAGNE | 1993.06.01 |
| 20 | HP-48GX  | Hammer      | CHARLEMAGNE | 1993.06.01 |
| 21 | HP-38G   | Elsie       | CHARLEMAGNE | 1995.04.06 |
| 22 | HP-48G+  | Plus        | CHARLEMAGNE | 1998.03.30 |
| N.B. If the date of introduction is the same, business |
|      calculators precede scientific calculators, less  |
|      capable machines precede more capable ones.       |

In addition, a few prototypes of an HP-38G+ (an upgraded version of the HP-38G with twice the amount of RAM [64K]) were produced, but the project was cancelled before the introduction of the HP-49G.

|(23)| HP-38G+  | ?           | CHARLEMAGNE | cancelled  |
|    |          |             |             | before May |
|    |          |             |             | 21st, 1999 |

In order to facilitate the discussion, we may adopt the following classification and terminology—based on criteria such as calculator functionality, entry logic, target market, price, integrated circuit specifications, available memory, display size, and overall form factor:

                                              |  Algebraic  |      RPN       |
| PIONEERS    (11) | Bus. (4) | Low-End   (1) | 10B         |                |
|                  |          | Mid-Range (1) | 14B         |                |
|                  |          | High-End  (2) | 17B         | 17BII(*)       |
|                  | Sci. (7) | Low-End   (2) | 20S, 21S    |                |
|                  |          | Mid-Range (3) | 22S         | 32S, 32SII     |
|                  |          | High-End  (2) | 27S         | 42S            |
| CLAMSHELLS   (5) | Bus. (3) | High-End  (3) | 18C, 19B    | 19BII(*)       |
|                  | Sci. (2) | High-End  (2) |             | 28C, 28S       |
| CHARLEMAGNES (7) | Sci. (7) | Low-End   (2) | 38G, (38G+) |                |
|                  |          | Mid-Range (3) |             | 48S, 48G, 48G+ |
|                  |          | High-End  (2) |             | 48SX, 48GX     |
 (*) Switchable between algebraic and RPN modes.


(In the following, all certified RPL machines are marked in red.)


It goes without saying that machines offering RPL directly to the user (by providing access to a LIFO stack on which RPL objects can directly be manipulated) must themselves be based on the new operating system. This is well documented by HP themselves (for example in RPLMAN.DOC mentioned above) and needs no further justification.

This first group comprises all scientific Clamshells:


and all mid-range to high-end Charlemagne class machines:

HP-48S, HP-48G, HP-48G+
HP-48SX, HP-48GX


In the case of the HP-38G, not only did HP publicly acknowledge that:

"The HP-38G is built on the same software platform as the HP-48G family of graphing calculators, but has a simpler user interface and feature set,"

(see Ted W. Beers, Diana K. Byrne, James A. Donnelly, Robert W. Jones, and Feng Yua, "A Graphing Calculator for Mathematics and Science Classes" in: Hewlett-Packard Journal, Vol. 47 no. 3, June 1996, pp. 45-58.)

but they also published an officially supported entry point list for HP-38 System RPL programmers, thus allowing indirect access to the underlying RPL operating system with the help of a PC.

This adds the HP-38G to our list, as well as the HP-38G+ prototype, which is essentially the same machine, except for the RAM chip (and perhaps a microscopic change in ROM to adapt to the latter).


In a number of cases, the presence of an underlying RPL operating system has been officially recognized by HP, although the machines do not provide access to RPL in any way.

Indeed, in the article already cited, Bill Wickes writes (p. 27):

"The resulting operating system, known unofficially as RPL (for Reverse-Polish Lisp), made its first public appearance in June 1986 in the HP-18C Business Consultant calculator. Subsequently, RPL has been the basis for the HP-17B, HP-19B, HP-27S, HP-28C and HP-28S calculators, demonstrating that it meets the objective of supporting a variety of calculators. The HP-17B, 18C, and 19B are designed for business applications; they and the HP-27S scientific calculator offer an "algebraic" calculating logic, and the underlying operating system is invisible to the user. The HP-28C and HP-28S scientific calculators use an RPN logic, and many of the facilities of the operating system are directly available as calculator commands."

In RPLMAN.DOC this passage was updated to read as follows:

" [...] Subsequently, RPL has been the basis for the HP-17B, HP-19B, HP-27S, HP-28C and HP-28S, and HP-48S and HP-48SX calculators. [...] The HP-28/HP-48 families of scientific calculators use an RPN logic, [...] "

We may therefore safely add to our list two out of three business Clamshells:


and the algebraic high-end Pioneers:



One might wonder why the HP-17BII, the HP-19BII, and—most notably—the HP-42S are omitted from RPLMAN.DOC, a document first published in summer 1991 when all these calculators had been on the market for quite some time (in the case of the HP-42S, for almost three years). Should this mean that they are non-RPL machines? Despite the HP-42S being very similar to the other high-end Pioneers: same integrated circuits, same memory, same display, same menu-driven user interface, etc.? And despite the fact that the twin brothers of the two business calculators unquestionably are RPL-based?

The answer is a clear no.

No less an authority than Raymond Del Tondo has repeatedly confirmed (most recently in the following thread: Post #1, Post #2)—and I too can confirm—that these three machines do indeed run their own RPL operating system.

What really happened here is that portions of Bill Wickes' original article from 1988 were hastily copied into RPLMAN.DOC (at the time, people were eagerly awaiting the release of the RPL compiler they had heard so much about), with only the most obvious inconsistency being corrected, namely that the target machine of the new product, the HP-48, was not even mentioned. By contrast, none of the three calculators had been introduced when the original article was published.

We may therefore conclude that all business Clamshells—including the HP-19BII—and all high-end Pioneers—including both RPN models, the HP-17BII and the HP-42S—are indeed RPL-based machines.


To my mind, all the remaining calculators, i.e. all mid-range (14B, 22S, 32S, 32SII) and low-end (10B, 20S, 21S) Pioneers, are non-RPL machines. And here is why.

1. The argumentum e silentio.

No mid-range or low-level Pioneers are mentioned in Bill Wickes' article, although the HP-22S and the HP-32S—introduced in June 1988—might have been on the market when the paper was written.

Admittedly, this is a rather weak argument, because the submission date of the article could very well have preceded the introduction of the calculators.

2. The Size Argument.

Low-end Pioneers have 10KB of ROM, mid-range Pioneers 16KB. Now, according to Bill Wickes and Charlie Patton,

"the RPL operating system [...] occupies about 18K bytes of the system ROM [in the case of the HP-48SX]."

(see William C. Wickes and Charles M. Patton, "The HP-48SX Scientific Expandable Calculator: Innovation and Evolution" in: Hewlett-Packard Journal, Vol. 42 no. 3, June 1991, pp. 6-12.)

Even if one considers that a low-end or mid-range Pioneer would require a much smaller subset of the complete RPL operating system than the HP-48SX, it would still be too large to leave room for the calculator's actual surface functionality. For ROM chips of that small size, the whole idea of using an operating system written in a high-level language is just not practical.

3. Address #028FCh or Assembler Opcode CF 820? The Double Entendre Argument.

One of the most innovative features of RPL is that any object may be represented either indirectly by a pointer (like in Forth) or directly by itself. In other words, object pointers as well as anonymous inline objects may coexist within the same instruction stream. This

"enables the straightforward management of nameless objects that are created during execution,"

which is a key element in providing symbolic math capability, since

"during the course of symbolic algebraic manipulations, it is common to create, use, and discard any number of temporary intermediate results."

(see William C. Wickes, "RPL: A Mathematical Control Language", ..., p. 29)

In order for this scheme to work, the prologue code of each object type must be interpretable both as an assembler opcode sequence (for ordinary, indirect execution) and as the memory address of a special meta-prologue designed to handle direct object execution (along with its side effects—for instance, the need to skip over a whole object in the middle of the instruction stream, which is very different from simply advancing the interpreter pointer to the next address, as is done during indirect execution).

In all openly accessible implementations of RPL, this scheme was put into practice by letting the prologue code of each object type (like DOBINT, DOREAL, DOCOL, etc.) start with the following 5 nibbles: <CF820>. This 20-bit sequence would then either be interpreted as an assembler opcode (during indirect execution):

      CF                D=D-1   A   * Decrement available-memory.
      820               NOP3        * No operation.
      ...               ...

or as a ROM address (during direct execution)—namely address #028FCh (remember that addresses are written backwards in memory) where the special meta-prologue resides:

028FC          =PRLG
028FC 31A0              LC(2)   #A   * 10d
02900 B6A               A=A-C   B    * Subtract 10 from prologue address.
02903 808C              PC=(A)       * Execute object skipping code.

Those unfamiliar with the mechanics may find a complete description in Bill Wickes' article, in RPLMAN.DOC, or—in even greater detail—in the corresponding U.S. Patent. For a quick, but complete, overview I strongly recommend Jonathan Busby's excellent article "The RPL inner loop explained," recently posted on this forum.

It seems reasonable to assume that once you have worked out a structure of that complexity, you would want to keep it unchanged for a while—at least as long as you can use the same CPU with the same opcodes.

Now, since all 23 calculators under consideration use the same Saturn CPU (with small variations negligible for our purpose), we should expect to find two highly characteristic patterns in the ROM of any RPL-based machine:
  • Between one and three dozens of <CF820> patterns, not far away from each other: they are the reflection of the different types of RPL objects implemented in that particular version of RPL.
  • The 11-nibble pattern <31A0B6A808C> at address #028FCh, which reflects the implementation of the special meta-prologue.

And sure enough, all the Charlemagne class machines, all the Clamshells, and all the high-end Pioneers I have inspected show the predicted bit patterns, whereas none of the low-end or mid-range Pioneers do (though I am unable to confirm this for the HP-22S and the HP-32S, since there is no easy way to get a ROM dump of these machines).

4. Confirmation from the Dark Side of the Force.

At least with respect to the HP-10B, the HP-14B, and the HP-32, my results have just been confirmed by an HP employee (maybe Cyrille can tell us whether he meant the 32S or the 32SII, or both):

(11-28-2019 05:59 AM)cyrille de brébisson Wrote:  10b, 14B, 32... do not have RPL inside...
I have seen the sources...

We may therefore fill in the following chart with some confidence:

                                              |  Algebraic  |      RPN       |
| PIONEERS   (11)  | Bus. (4) | Low-End   (1) | 10B         |                |
|                  |          | Mid-Range (1) | 14B         |                |
|                  |          | High-End  (2) | 17B         | 17BII(*)       |
|                  | Sci. (7) | Low-End   (2) | 20S, 21S    |                |
|                  |          | Mid-Range (3) | 22S         | 32S, 32SII     |
|                  |          | High-End  (2) | 27S         | 42S            |
CLAMSHELLS  (5)  | Bus. (3) | High-End  (3) | 18C19B    | 19BII(*)       |
|                  | Sci. (2) | High-End  (2) |             | 28C28S       |
CHARLEMAGNES (7) | Sci. (7) | Low-End   (2) | 38G(38G+) |                |
|                  |          | Mid-Range (3) |             | 48S48G48G+ |
|                  |          | High-End  (2) |             | 48SX48GX     |
 (*) Switchable between algebraic and RPN modes.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Which calculators run RPL under the hood? - Giuseppe Donnini - 11-29-2019 03:47 PM

User(s) browsing this thread: 1 Guest(s)