Which calculators run RPL under the hood?
11-27-2019, 02:16 PM
Post: #1
 Dave Britten Senior Member Posts: 1,928 Joined: Dec 2013
Which calculators run RPL under the hood?
Obviously the 48/49/50 line is built on RPL, and HP even made it available to users via both SysRPL and UserRPL, but it wasn't user-accessible at first.

18C - The first place it appeared
19B, 19BII
28C, 28S - UserRPL programming, limited SysRPL access through SYSEVAL
17B
17BII
27S
42S
48, 49, 50 - UserRPL and SysRPL
38, 39, 40 - These are all built on RPL, aren't they?

I think all the "high-end" Pioneers use RPL internally. What about the mid-range Pioneers like the 32S, 32SII, 14B, etc.? And I doubt the low-end models - 10B, 20S, 21S - use it.
11-27-2019, 03:04 PM
Post: #2
 rprosperi Senior Member Posts: 5,016 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
I believe ALL Pioneers are based on a SysRPL core, with varying maturity of the kernel as time progressed. It has been reported (I believe after an extensive disassembly) that the 42S used a larger amount of assembler code than other models, but this no doubt is due to being so early and requiring lower-level tweaks to accomplish the required 41 FOCAL compatibility. Creating all models on a common platform was one of the core goals when SysRPL was conceived. It is still cheaper/faster/safer to build a "low-end" model like the 20S on an existing platform than to create a new one, even if that model's demands are not high.

Also, the later derivatives of the 39g/40g series machines (39g+, 39gs, 40gs) were also RPL-based, but emulated on ARM, similar to the 48gii, 49g+ and 50g.

I believe the later derivatives of the Pioneers (10BII-Gold, 17BII-Silver, 33S, 17BII+, et. al.) were all re-implemented when outsourced to various firms in China. Later still, the 10bII-Silver and 10bII+ were then brought back in-house and done (in C?) by Tim I believe (the 10bII+ for sure).

--Bob Prosperi
11-27-2019, 03:52 PM
Post: #3
 Dave Britten Senior Member Posts: 1,928 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
(11-27-2019 03:04 PM)rprosperi Wrote:  I believe ALL Pioneers are based on a SysRPL core, with varying maturity of the kernel as time progressed. It has been reported (I believe after an extensive disassembly) that the 42S used a larger amount of assembler code than other models, but this no doubt is due to being so early and requiring lower-level tweaks to accomplish the required 41 FOCAL compatibility. Creating all models on a common platform was one of the core goals when SysRPL was conceived. It is still cheaper/faster/safer to build a "low-end" model like the 20S on an existing platform than to create a new one, even if that model's demands are not high.

That's interesting that they used it even on the 20S. What's it have, a couple hundred bytes of RAM at most?

The mid-range ones I had suspected didn't use RPL, which could explain the 32S being much faster than the 42S. But if it's also RPL, and the 42S is using a lot more assembly code, then that makes the speed difference more surprising.

(11-27-2019 03:04 PM)rprosperi Wrote:  I believe the later derivatives of the Pioneers (10BII-Gold, 17BII-Silver, 33S, 17BII+, et. al.) were all re-implemented when outsourced to various firms in China. Later still, the 10bII-Silver and 10bII+ were then brought back in-house and done (in C?) by Tim I believe (the 10bII+ for sure).

Yeah, I'd be very surprised if any of those had any RPL left in them.
11-28-2019, 12:24 AM
Post: #4
 Carsen Member Posts: 202 Joined: Jan 2017
RE: Which calculators run RPL under the hood?
According to the RPLMAN document, one of the reasons why HP created RPL was to streamline calculator development. So Bob's answer makes sense.
11-28-2019, 05:59 AM
Post: #5
 cyrille de brébisson Senior Member Posts: 1,047 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
hello,

10b, 14B, 32... do not have RPL inside...
I have seen the sources...

cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
11-28-2019, 07:13 AM
Post: #6
 Massimo Gnerucci Senior Member Posts: 2,351 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
(11-28-2019 05:59 AM)cyrille de brébisson Wrote:  hello,

10b, 14B, 32... do not have RPL inside...
I have seen the sources...

cyrille

Greetings,
Massimo

-+×÷ ↔ left is right and right is wrong
11-28-2019, 01:02 PM
Post: #7
 Dave Britten Senior Member Posts: 1,928 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
(11-28-2019 05:59 AM)cyrille de brébisson Wrote:  hello,

10b, 14B, 32... do not have RPL inside...
I have seen the sources...

cyrille

Thanks for clarifying, Cyrille. That might then explain the considerable speed advantage the 32S has over the 42S, as it doesn't have the extra baggage of an RPL kernel (nor the different object types that can go on the stack like the 42S).
11-28-2019, 03:29 PM
Post: #8
 rprosperi Senior Member Posts: 5,016 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
(11-28-2019 05:59 AM)cyrille de brébisson Wrote:  hello,

10b, 14B, 32... do not have RPL inside...
I have seen the sources...

cyrille

Wow, thanks Cyrille; pretty surprising.

What are they written in, 100% pure assembler from scratch on the raw Saturn h/w, or in C on some kernel, etc.?

Given they had the RPL core available, wonder why they would do these from scratch?

And since not based on RPL as assumed, it does explain some until now hard to understand things like the performance Dave noted, the different diags behavior, etc.

--Bob Prosperi
11-29-2019, 06:12 AM
Post: #9
 cyrille de brébisson Senior Member Posts: 1,047 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
Hello,

First, I LOVE blade runner, thanks for the clip!

Second, yes, these "lower end" calculators are in pure saturn ASM...
They share a LOT with the RPN calculators, including the interrupt kernel, the math library... but the UI is all in ASM instead of in RPN...

I assume that the 2 main reasons are memory constraints (RPN is much more resource intensive) and speed (RPN is not that fast)...

BTW, the current 17BII+ is 100% fully rewritten in C, there is no RPN behind there...

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
11-29-2019, 02:17 PM
Post: #10
 rprosperi Senior Member Posts: 5,016 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
Thanks Cyrille, we appreciate the insights. Still learning about these machines 30 years on...

Also, you have good taste in movies!

--Bob Prosperi
11-29-2019, 03:47 PM (This post was last modified: 12-09-2019 09:08 PM by Giuseppe Donnini.)
Post: #11
 Giuseppe Donnini Member Posts: 120 Joined: Feb 2014
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.

A. THE CANDIDATES UNDER SCRUTINY.

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.

B. THE VERDICT.

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

GROUP I - DIRECT ACCESS MACHINES.

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:

HP-28C
HP-28S

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

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

GROUP II - INDIRECT ACCESS MACHINES.

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).

GROUP III - CERTIFIED RPL MACHINES WITHOUT ACCESS.

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:

HP-18C
HP-19B

and the algebraic high-end Pioneers:

HP-17B
HP-27S

GROUP IV: OTHERWISE CONFIRMED RPL MACHINES.

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.

GROUP V: NON-RPL 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.
11-29-2019, 04:48 PM
Post: #12
 Dave Britten Senior Member Posts: 1,928 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
Quite the thorough analysis there! Thanks!
11-29-2019, 05:26 PM
Post: #13
 Christoph Giesselink Member Posts: 212 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
Yes nice analysis, but I'm missing the HP49G, 39G and 40G which still use the Yorke chip as last calculators with a Saturn core.

Even more, what about the 71B, the first calculator with the Saturn 1LF2 CPU which was later replaced by the 1LK7 CPU which was necessary for the HP18C. Major difference between 1LF2 and 1LK7 is the addional opcode

PC=(A)

necessary for RPL execution. To be complete, the other opcode new in the 1LK7 was RSI ("level 1" instruction set).

The HP28C was the last calculator with a Saturn CPU (1LK7) on a single chip. All later solutions use a chip combining a Saturn core and peripherals all equipped with the "level 2" instruction set.
11-30-2019, 03:07 AM (This post was last modified: 12-01-2019 01:06 AM by Giuseppe Donnini.)
Post: #14
 Giuseppe Donnini Member Posts: 120 Joined: Feb 2014
RE: Which calculators run RPL under the hood?
Hi Christoph,

Since you are one of the most knowledgeable persons in the field under discussion, and since over time I learnt a lot from reading your contributions, I feel compelled to reply to your comments.

I think that you greatly overestimate the scope of my article. All I set out to do was to answer a simple question: "Which calculators run RPL under the hood?".

In order to do so, I first set up a framework within which I felt at home, namely the calculators from the first RPL machine to the HP-49G (excluded). As this imposed limit coincides with the demise of the Corvallis division of lasting fame, it can hardly be seen as an arbitrary choice on my part, and since I'm simply not interested in later calculators, I explicitly stated that "others, who are much better qualified than myself ... may add information about the ACO calculators as well as the more recent machines". I don't use any of the calculators you mention (HP-49G, HP-39G, HP-40G), how could I comment on them?

Within the given framework, I then tried to provide as thorough an answer as possible, and I let the reader participate in the conclusions I draw by exposing all the intermediate links in my chain of thought. But as soon as there was enough evidence to determine whether a particular machine was RPL-based or not, I considered my job done, and moved on.

I was by no means trying to write a compendium on the genesis and evolution of RPL, nor on its relation to the Saturn CPU. And while the HP-71B plays indeed a key role in the development of RPL, it is itself not an RPL machine, nor does it help in identifying the RPL kernel in later calculators.

You will notice that in my charts I refrained from providing any information on ROM and RAM sizes, on LCD types, on the number of display lines, and so on, precisely because it would have forced me to discuss the different ICs. This was a conscious choice to keep the discussion focussed, otherwise the size of my answer would easily have doubled or tripled.

Much could also be said about the differences between RPL implementations, but that too would go way beyond the scope of the present discussion.
11-30-2019, 04:22 AM
Post: #15
 rprosperi Senior Member Posts: 5,016 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
Really, really nice detailed post Giuseppe, thank you for all the research work, the numerous convenient references & links and for sharing this here.

Hopefully as folks read this, some additional facts can be added to further clarify some of the remaining mysteries, but the evidence you present is pretty compelling.

But I still would like to know why, with the RPL system available, HP would choose to build all the lower-end machines from scratch. Was saving a little ROM and RAM in those models really less expensive than writing and testing code for those same models from scratch? It's hard to compare these economics today with the huge drop in price of hardware and always rising price of software development.

--Bob Prosperi
11-30-2019, 05:07 AM
Post: #16
 Paul Dale Senior Member Posts: 1,725 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
(11-30-2019 04:22 AM)rprosperi Wrote:  Was saving a little ROM and RAM in those models really less expensive than writing and testing code for those same models from scratch? It's hard to compare these economics today with the huge drop in price of hardware and always rising price of software development.

My guess would be: yes. It would still today when consumer devices are involved. Shaving a couple of cents off of the component cost matters when the device is being produced in the millions or when there is a tight price point to be met. I doubt these calculators were produced in that quantity but I'm certain that manufacturing cost was (and remains) a major concern.

Pauli
11-30-2019, 12:11 PM
Post: #17
 Christoph Giesselink Member Posts: 212 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
(11-30-2019 04:22 AM)rprosperi Wrote:  But I still would like to know why, with the RPL system available, HP would choose to build all the lower-end machines from scratch. Was saving a little ROM and RAM in those models really less expensive than writing and testing code for those same models from scratch? It's hard to compare these economics today with the huge drop in price of hardware and always rising price of software development.

I don't think that everything was build from scratch. The special Saturn CPU architecture was introduced with the 71B in this case with floating point math IEEE 754-1985 Standard. I don't know the hardware follower 18C, but the next calculator, the 28C uses BCD math. The basic math functions inside are written in Saturn assembler. There's somehow a misunderstanding of RPL. With RPL you have no access to the hardware. You cannot read or write to CPU registers or other peripherals like the LCD display with RPL directly. This could only be done by the CPU executing binary code. So all basic function of an RPL machine are written in assembler, but - with an interface for the RPL interpreter mostly implemented as PCO (Primitive Code Object). The other possibility is using a RPL object and embedding assembler code inside with a =DOCODE object. So all the basics with hardware reference are already written in assembler.

Some words about speed and memory. I massively expanded the entry-point list of the HP28S primary created by J-F and created an entry point list for the 28C rev. 1CC. Therefore I compared the implementations with the HP48SX rev.E. When you have the luck like me having parts of the HP48SX rev.E source code, you see that the HP48SX sources directly build from the HP28S sources and this one from the 28C. Even more, the HP48SX rev.E source sometimes contain disabled code from the HP28S and the code replacement directly in front or behind the disabled code. And there you find replacements from assembler to RPL for saving memory and from RPL to assembler to save time.

Another interesting find was a routine, I think it was assembler code, doing the same thing on the HP28S and on the HP42S but implemented in different ways. What a waste.

I know that HP began from scratch for the HP10BII and HP17BII+ calculators. Here both calculators use basic mathematical routines written in C.
12-08-2019, 07:24 PM
Post: #18
 Jonathan Busby Member Posts: 241 Joined: Nov 2014
RE: Which calculators run RPL under the hood?
(11-29-2019 05:26 PM)Christoph Giesselink Wrote:  Even more, what about the 71B, the first calculator with the Saturn 1LF2 CPU which was later replaced by the 1LK7 CPU which was necessary for the HP18C. Major difference between 1LF2 and 1LK7 is the addional opcode

PC=(A)

necessary for RPL execution. To be complete, the other opcode new in the 1LK7 was RSI ("level 1" instruction set).

The HP28C was the last calculator with a Saturn CPU (1LK7) on a single chip. All later solutions use a chip combining a Saturn core and peripherals all equipped with the "level 2" instruction set.

Are you sure? I don't remember if the 1LF2 even had a PC=A instruction. Even if it didn't, it still could have supported RPL, albeit with a big performance penalty :

Code:
A=DAT0        A AD0EX C=DAT0        A A=A+1         A AD0EX RSTK=C RTN

Code:
A=DAT0        A D0=D0+        5 PC=(A)

If the 1LF2 had a PC=A instruction, then one could do

Code:
A=DAT0        A AD0EX C=DAT0        A A=A+1         A AD0EX PC=C

which is still very slow, but saves one instruction

Jonathan

Aeternitas modo est. Longa non est, paene nil.
12-09-2019, 02:18 AM
Post: #19
 Christoph Giesselink Member Posts: 212 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
(12-08-2019 07:24 PM)Jonathan Busby Wrote:
(11-29-2019 05:26 PM)Christoph Giesselink Wrote:  Even more, what about the 71B, the first calculator with the Saturn 1LF2 CPU which was later replaced by the 1LK7 CPU which was necessary for the HP18C. Major difference between 1LF2 and 1LK7 is the addional opcode

PC=(A)

necessary for RPL execution. To be complete, the other opcode new in the 1LK7 was RSI ("level 1" instruction set).

The HP28C was the last calculator with a Saturn CPU (1LK7) on a single chip. All later solutions use a chip combining a Saturn core and peripherals all equipped with the "level 2" instruction set.

Are you sure? I don't remember if the 1LF2 even had a PC=A instruction.

Source Horn Disk 4 file SASM.DOC from the HPTOOLS package:

page 15:
Code:
6.  Saturn Assembler Format and Mnemonics This chapter describes the Saturn assembler instruction set. The Saturn CPU has three variations used in several products.  The 1LF2 was used in the first versions of the HP-71B.  The 1LK7 is a variation of the 1LF2 used in later versions of the HP-71B, the HP-18C, and the HP-28C.  The 1LR2 is an integrated CPU/ROM/RAM/Display Driver IC.  Each new version of the Saturn CPU added new instructions to the Saturn instruction set.  Instructions available in all Saturn CPUs are referred to as "level 0" instructions. Instructions available in the 1LK7 and 1LR2 but not the 1LF2 are referred to as "level 1" instructions.  Instructions available only in the 1LR2 are referred to as "level 2" instructions.  In this section, "level 1" instructions are marked with an asterisk (*), "level 2" instructions are marked with two asterisks (**).  Instructions with no mark are "level 0" instructions.

page 116:
Code:
PC=(A)      - Jump (Set PC) indirectly thru A field of A register ---------                             opcode:  808C                             cycles:    23 This instruction causes the CPU to jump to the address pointed to by memory at the address specified by the A field of the A register.  In symbolic form, the operation is PC=mem(A[A]).  This opcode is not available on the 1LF2 version of the Saturn CPU.

page 20:
Code:
PC=A       ** Direct jump; A(A) is the               destination address. PC=C       ** Direct jump; C(A) is the               destination address.

Both opcodes PC=A and PC=C are marked with two asterix so they belong to the "level 2" instructions.
12-09-2019, 06:48 AM
Post: #20
 cyrille de brébisson Senior Member Posts: 1,047 Joined: Dec 2013
RE: Which calculators run RPL under the hood?
Hello,

Down through memory lane we go...

- The double execution prolog thing was kind of a genius idea, I still remember when I discovered it/understood it myself. it was a woha moment...
- Rpl is great as it allows manipulation of "objects"... But it still lakes some stuff, like the ability to define new object types, which is sad...
- Rpl is definitely WAY better than ASM when you have to develop things as it is much less error prone, less likely to cause crashes...
- The main issue in my opinion is that the Saturn chip is NOT at all adapted to RPL. RPL, with its constant object creation/destruction is very memory intensive... But the Saturn chip is NOT good at memory movements, which is problematic and the cause of a lot of slow downs in the Rpl machines... However, I venture to guess that at the time, speed was not a big issue as UI was, at least initially very under developed. it did not become an issue until the 48 came along...
This is especially true as, at this point, most of the team seemed to only write RPL and did not seem to think about dropping to ASM for critical items. See the equation writter for example, which was nearly unuseable :-(

Anyhow, they did indeed reuse a lot. Here is the header from the basic math source code from the 38/39/40/48/49/50 series (it is the same file)... as you can see from the date, it is not a youngling!

TITLE Saturn Basic Math Routines 1.1
**miscdoc+*******************************************^******
************************************************************
**
** File: math0.a Version 1.1, 10/26/87
** Machine: Charlemagne
**
** Covered by GG 12-28-88
** UnCovered by GG 01-06-89
************************************************************
**+miscdoc**************************************************

Apart from the 38/48 series calculators, none of the ACO and later calculators are RPL based (starting with the newer 10BII, 17Bs, 32SII, 35...)
They are all developed in C, using a math library which is a "copy" in C of the math library used in the 95LX, which is itself a copy in Intel ASM of the saturn one...
Unfortunately, it is a a rather simplistic implementation, based, somewhat on a virtual implementation of the Saturn CPU. So it is slow as hell...
In 2004 or so, when it became clear that we would be working more and more with ARM chips for low end calcs, I recreated the whole math library in C, but as a recreation based on the code rather than a copy. This library is what is used in Prime and a couple of other calcs...

Cyrille

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
 « Next Oldest | Next Newest »