HP-48GX
An in-browser HP-48GX that boots the authentic 1993 HP-48GX system ROM to the RPL stack. The HP-48GX is the expandable, 128 KB-RAM member of the HP-48 family, built — like the whole family — on the HP Saturn, a 4-bit-nibble CPU with 64-bit working registers. Type on the on-screen HP-48 keyboard or your physical keyboard; the calculator's ROM, RAM, timers and 131×64 LCD are all emulated.
This emulator reuses the base HP-48 emulator's shared hpemu Saturn core, loading the WebAssembly core, the saturn decoder and the debugger plug-in from /emulator/hp48/src/ rather than duplicating them. The system ROM bundled in that shared build is the authentic HP-48GX operating system, so it boots straight to the GX stack with no ROM swap.
The Saturn is driven through a small set of on-demand hooks rather than its own run loop, so it plugs into the shared debugger: single-step the processor, read and write the A/B/C/D field registers and nibble memory, disassemble Saturn code, and set breakpoints and write watchpoints. The HP-48GX system ROM is © Hewlett-Packard and is self-hosted here for emulation.
Runs on: Web browser
HP-48GX Online Emulator
Play HP-48GX using JavaScript directly in your browser.
Controls
Configurations
| Configuration | Emulator | Machine | OS | Legal | |
|---|---|---|---|---|---|
| HP-48GX RPL stack | HP-48GX | HP-48GX | grey | Open ⛶ |
Machines emulated
Chips
Notes
Embedding
The HP-48GX runs the same machine as the base HP-48 emulator: Daniel Nilsson's portable-C hpemu HP Saturn core (GPL v2), compiled to WebAssembly with Emscripten with its SDL/GUI loop dropped and the processor driven by hand so the shared debugger can pause and step it. This emulator ships only its own embed.js: the wasm core, the saturn decoder and the machine plug-in all load from /emulator/hp48/src/, so no code or ROM is duplicated.
var SHARE = '/emulator/hp48/src'; // shared hpemu Saturn core + GX ROM + debug plug-in
HP48({ locateFile: p => SHARE + '/' + p }).then(m => {
m._hp_init(); // bus_init: authentic HP-48GX ROM + warm RAM image + reset
m._hp_boot(); // run the Saturn until the RPL stack is up
});
The bundled system ROM in the shared build is the authentic HP-48GX operating system, so no ROM swap is needed — it boots straight to the GX stack. The core is reached through the same flat on-demand hooks the base HP-48 documents (hp_step, register/memory reads, the LCD scan and the key matrix), each called from JavaScript rather than per instruction, so the debugger reads registers and memory each refresh and single-steps with hp_step() with no change to the hot path.
Debugger integration
The debugger is driven by the shared hp48-debug.js plug-in loaded from /emulator/hp48/src/: it reads the live core from window.EMU_BOOT (published by the boot script below) and calls EmuKit.defineMachine with a transport, the Saturn register set and the 1M-nibble memory, using the saturn disassembler at /debugger/src/cpus/saturn.js.
Single-step is hp_step() (one executed Saturn instruction). Breakpoints are a host-side Set of 20-bit PC values: when any are set the JavaScript loop runs one instruction at a time and compares the PC before each. Write watchpoints sample the watched nibble addresses after each stepped instruction and halt on a change. The A/B/C/D working registers are 64 bits, so the registers window shows each as a low and a high 32-bit half; every register is writable back into the live core.
Architecture
The HP-48GX (1993) is the expandable, 128 KB-RAM member of the HP-48 family, built — like the whole family — on the HP Saturn, a 4-bit-nibble CPU that presents nibble-addressed memory (a 20-bit, 1M-nibble space) and works on 64-bit working registers a field at a time.
- Saturn core — four 64-bit working registers
A B C D(sixteen nibbles each), five scratch registersR0..R4, two 20-bit data pointersD0/D1, a 4-bit field pointerP, the 16-bit program statusST, the hardware statusHST, an 8-level return stack and a carry. Arithmetic runs in hex or BCD decimal mode. - Memory — a nibble bus configured at boot by the ROM's
CONFIGsequence: 512 KB system ROM, 128 KB built-in RAM and two plug-in card ports (the GX supports up to 4 MB of expansion), plus the memory-mapped hardware registers. - Display — a 131×64 monochrome LCD scanned directly out of video RAM at a base address the ROM programs; a short pixel-history gives the familiar 4-level grayscale.
- Keyboard — a 9-row matrix read through the
IN/OUTregisters; each key is a (row, col) pair, with ON wired to wake the CPU from its low-power SHUTDN state. - ROM — the authentic HP-48GX operating system, © Hewlett-Packard, installed into the ROM space.
Every part is reached from JavaScript through the small hp48hooks.c shim in the shared build, which turns an otherwise SDL-bound emulator into a live, steppable Saturn debugging target in the browser.