HP 48 Calculator
Hewlett-Packard's 1990-2003 family of RPL graphing calculators, a pocket programming platform layering User RPL, System RPL, Saturn assembly and even a CHIP-8 game interpreter over a stack of typed objects.
Created by Hewlett-Packard, Corvallis Division (design described by William C. Wickes and Charles M. Patton)
The HP 48 is a family of graphing calculators that Hewlett-Packard designed and sold from 1990 until around 2003 — the HP 48SX, 48S, 48G, 48GX and 48G+. As a programming environment it is best understood not as one language but as a small, layered computer: the documented, argument-checked User RPL at the keyboard; the unprotected System RPL in which HP wrote the operating system itself; raw Saturn assembly language underneath; and, thanks to its user community, even a CHIP-8 game interpreter. All of it ran on a pocket device with a 131×64-pixel screen, three AAA batteries, and a stack that could hold numbers, matrices, symbolic expressions, graphics, units, and programs alike.
For the language itself in depth, see User RPL, which debuted on the HP-28C; this page covers the HP 48 as the platform on which that language reached its largest audience.
History and Origins
HP’s Corvallis, Oregon calculator division introduced the HP 48SX Scientific Expandable on 6 March 1990, at a price of $350. In the June 1991 Hewlett-Packard Journal, designers William C. Wickes and Charles M. Patton explained the brief: “to create a product that combines the software technology of the HP 28S with the hardware flexibility and customizability of the HP 41C.”
Each predecessor had a weakness the other covered. The HP-28S had the RPL operating system, symbolic mathematics, graphics and menus, and had been adopted as a standard teaching tool by many college mathematics departments — but it had almost no I/O, which made it of “limited use” to surveyors and unattractive to engineering departments used to swapping HP-41C software. The HP-41C, in turn, had plug-in memory ports, HP-IL I/O, a redefinable keyboard and a vertical, one-handed form factor. The 48SX took all of these, then added features HP owners had asked for: a bigger display, more plotting, symbolic integration, and two-way communication.
The one thing that could not satisfy both camps was the programming language. The HP 48SX had to run RPL, which meant HP-41C keystroke programs would not run directly. HP’s answer was the HP 82210A HP 41C emulator card, which reproduced the HP-41C keyboard and executed its programs, which could be beamed across over infrared from an HP-41C fitted with the HP 82242A infrared printer module. HP-28S programs, by contrast, mostly ran unchanged; only display-related commands, the integration command, and some system flags differed.
The Machines
| Model | Introduced | Built-in RAM | ROM | Expansion |
|---|---|---|---|---|
| HP 48SX | March 1990 | 32 KB | 256 KB | Two card slots (32 KB or 128 KB cards) |
| HP 48S | 1991 | 32 KB | 256 KB | None |
| HP 48GX | 1993 | 128 KB | 512 KB | Two slots; port 2 up to 4 MB via bank switching |
| HP 48G | 1993 | 32 KB | 512 KB | None |
| HP 48G+ | Announced 30 March 1998 | 128 KB | 512 KB | None |
All models share a 131×64-pixel LCD, a 4-wire RS-232 serial port and a bidirectional infrared port. At the heart of the S series is HP’s 1LT8 custom chip, which the 1991 HP Journal describes as containing a 4-bit CPU that addresses memory in 4-bit “nibbles” through 20-bit addresses, with 64-bit internal working registers — the same processor family as the HP-71B and HP-28S, later known to programmers as the Saturn. The G series used a “fourth-generation” chip that, according to HP, ran “at twice the speed of its predecessor,” giving it a 4 MHz bus rate. In real use the gain was smaller: the community-maintained HP48 FAQ estimates G/GX throughput at roughly 40% faster than the S/SX, attributing the shortfall to memory bank-switching and other overheads (a rule-of-thumb comparison of the two model lines, not a published benchmark).
HP shipped several ROM revisions. The S/SX line ran revisions A through E and finally J — HP’s Bill Wickes posted to comp.sys.handhelds in March 1991 to quash rumours of a “version F” that turned out to be an internal simulator label. The G series ran K, L, M, P and R, with R as the last. Revision L was in the 2,000 HP 48GX units sold for $90 apiece at the 1993 American Society for Engineering Education (ASEE) conference, in a special commemorative edition.
Programming the HP 48
The RPL Operating System
Wickes and Patton describe the RPL operating system as occupying “about 18K bytes of the system ROM” and as having “first appeared in the HP 18C Business Consultant calculator in 1986.” It “combines elements of Forth and Lisp, providing a multi-object RPN stack and direct and indirect threaded execution,” with temporary (lambda) variables and “the ability to pass unevaluated procedures as arguments.” Like Forth words, each object begins with the address of the code that defines it.
On the HP 48SX the stack handles eighteen object types visible to the user, plus twelve more used internally by system programs. New for the HP 48 were graphics objects (GROBs), tagged objects that label a value without changing how operations treat it, unit objects, directories as first-class objects, and libraries that extend the built-in command set when installed from a card or loaded into RAM.
User RPL
User RPL is the language a user can type straight into the calculator. HP’s 1991 article lists its capabilities: program-flow structures, recursion, global and local variables, passing procedures as arguments, input prompting and output labeling, user and system flags, logical tests, and user-defined functions. Every command checks its arguments, so a User RPL program cannot normally corrupt the machine.
A program is an object between « and », stored like any other value:
| |
Typing 5 FACT leaves 120 on the stack. The → n binds the top stack value to a local variable; the FOR…NEXT loop multiplies an accumulator that lives on the stack itself.
The HP 48G series added list processing. DOLIST applies a program to each element of one or more lists:
| |
This returns { 1 4 9 16 }.
Units as a Data Type
HP’s own showcase example for the 48SX was its unit management system, which Wickes and Patton credit to “next bench” research rather than to predecessor features or customer requests. A number joined to a unit expression with an underscore is a single object, and the calculator handles conversion and dimension checking. Their example — “How fast is an object traveling after accelerating at 1 m/s² for half a minute, if its initial speed was 20 mph?” — becomes:
| |
which returns about 87.1_mph. The 48SX had 121 units built into ROM, from which compound units could be built, and unit objects worked in numeric and symbolic calculation, plotting, the solver, and integration.
System RPL and Saturn Assembly
Beneath User RPL lies System RPL: the same object system, but with direct access to the internal routines that skip argument checks. It is faster and more capable, and a System RPL program that passes the wrong argument to a command will usually leave the calculator needing a full memory reset. System RPL had to be compiled off the calculator on the HP 48, or on-device with third-party tools.
Below that is Saturn assembly language, written either with tools HP itself published (such as its SASM assembler) or with community libraries such as Jazz by Mika Heiskanen, which bundled an assembler and disassembler, a System RPL compiler and decompiler, and a debugger on the calculator. Code written at these levels was tied to the internals of a model: the HP48 FAQ warns that many assembly and System RPL programs for the S/SX broke on the G/GX, especially those that wrote to display memory directly.
CHIP-48 and SUPER-CHIP
In 1990 Andreas Gustafsson wrote CHIP-48, an interpreter for the 1970s CHIP-8 game language, for the HP 48SX. On 16 May 1991 Erik Bryntse released SUPER-CHIP, which added an extended 128×64 mode using the full screen, 16×16 sprites, larger fonts, and a way to exit to and pass results back to RPL. Bryntse’s release notes suggested writing a strategy game “in RPL with combat parts programmed in S-CHIP.” The SUPER-CHIP extensions have outlived the calculator as a standard CHIP-8 variant.
Communications
Rather than invent a protocol, HP built Kermit into the HP 48SX because, its I/O designers wrote, it “provides automatic retransmission to correct errors, is widely used, and is available essentially free of charge for all the major types of personal computers.” The same Kermit application worked over both the serial cable and the infrared link. The G series added XModem. These links fed a culture of software sharing on Usenet’s comp.sys.hp48, FTP archives, and later hpcalc.org.
Evolution: From the 48SX to the 48G
HP traces the HP 48G/GX to the January 1992 American Mathematical Society meeting, where educators said the 48SX was too hard to learn and too expensive for classrooms. HP formed an advisory committee of six mathematics professors and set a target of the 1993 back-to-school season. The resulting design kept the S/SX feature set, including User RPL, and added:
- Dialog-box input forms, which HP compared to those on Macintosh and Windows PCs, so beginners could fill in blanks instead of memorizing stack syntax
- Fifteen plot types instead of eight, including wireframe, parametric surface, pseudocontour, and slope field plots
- Differential equation solvers, a polynomial root finder, a financial solver, Fourier transforms, and more matrix and linear-algebra operations
- A built-in library of engineering equations and constants, absorbing much of what 48SX owners had bought separately on the HP Solve Equation Library card
The HP 48G+ of 1998 was simply a 48G with 128 KB of RAM. The HP 48 hardware architecture also became the basis of the simplified, infix-entry HP 38G, and the 48’s successor, the HP 49G (1999), carried the RPL environment forward.
Current Relevance
The HP 48 is no longer manufactured, but it is far from forgotten:
- Emulators. Emu48, begun by Sébastien Carlier around 1997 and maintained for decades by Christoph Gießelink, runs original HP 48 ROM images on desktop systems.
- Archives. hpcalc.org preserves thousands of HP 48 programs, the community HP48 FAQ, and HP’s own technical documents, including the HP Journal articles cited here.
- Descendants. The HP 49G, 49g+, 48gII and 50g kept RPL alive until HP discontinued the 50g, and DB48X — whose README states that it “intends to rebuild and improve the user experience of the HP48 family of calculators” — reimplements RPL for SwissMicros hardware.
- CHIP-8. Hobbyist CHIP-8 emulators and new games still target the SUPER-CHIP instruction set that began on the HP 48.
Why It Matters
The HP 48 put a complete, self-describing object system in a shirt pocket in 1990: a stack of typed objects, programs that were themselves data, symbolic algebra, physical units as values, user-installable libraries, and file transfer to personal computers using a standard protocol. It was programmable at every layer, from the forgiving User RPL that students learned between classes to the Saturn machine code that hobbyists used to write games and system extensions. HP built it by deliberately merging the software of one predecessor with the expandability of another. The result was a platform engineers and surveyors relied on for over a decade, and one whose design is still being reimplemented decades later.
Timeline
Notable Uses & Legacy
Engineering students and practising engineers
HP's own 1994 design retrospective describes the HP 48S/SX as "becoming a standard for engineering students and professional engineers"; users wrote and traded RPL programs for unit-aware calculations, matrices, and numerical solving.
Land surveying
HP designed the expandable 48SX partly to win back surveyors, who had relied on the HP-41C but found the HP-28S unusable for lack of I/O; plug-in cards and serial transfer made the HP 48 a field computer for coordinate-geometry and survey programs.
Mathematics education
The HP 48G/GX was shaped by a six-professor education advisory committee formed after the January 1992 American Mathematical Society meeting, and was aimed at college and high-school mathematics classrooms.
CHIP-48 and SUPER-CHIP game development
Gustafsson's CHIP-48 and Bryntse's SUPER-CHIP turned the HP 48 into a hobbyist game console; SUPER-CHIP's opcodes became a standard CHIP-8 extension still implemented by CHIP-8 emulators today.
HP 41C program migration
The HP 82210A HP 41C emulator card let owners run their existing HP-41C keystroke programs on the HP 48SX, beamed over infrared from the older calculator (via its HP 82242A infrared printer module), rather than rewriting them in RPL.