HP 9825A Calculator
Hewlett-Packard's 1976 desktop "calculator" and its HPL language, a terse, lower-case-keyword algebraic language that made the 9825 the standard HP-IB instrument controller of the late 1970s.
Created by Hewlett-Packard, Calculator Products Division, Loveland, Colorado (project manager Don Morris; software led by Chris Christopher)
The HP 9825A was a 26-pound desktop machine that Hewlett-Packard introduced in 1976 and sold as a “calculator”. In practice it was a small computer with a typewriter keyboard, a 16-bit processor, plug-in ROMs, interrupts, direct memory access and a tape drive. It was programmed in HPL, a compact algebraic language whose keywords are typed in lower case and whose variables are capital letters, so a statement looks like prt (-B+√(BB-4AC))/2A. What made the 9825 and HPL matter was control rather than calculation. Paired with HP’s new interface bus (HP-IB, IEEE 488), the 9825 ran HP’s automated test systems for the rest of the 1970s. Its successor, the HP 9826, still offered HPL to customers with 9825 programs to carry forward.
History and Origins
A controller, not just a calculator
HP’s Calculator Products Division in Loveland, Colorado, had built two generations of desktop calculators by the early 1970s: the 9100A, then the 9810A, 9820A and 9830A. In the summer of 1973, project manager Don Morris and Dick Barney visited HP customers, including lost sales, happy 9820A/9830A users and unhappy ones. Many customers used the desktop machine as a controller: it sat at the centre of a group of voltmeters, counters and plotters, gathering and processing their data. That observation split HP’s plans into computational machines (which became the HP 9845) and controllers (the HP 9815A and 9825A).
The 9825 was first planned as a key-per-function machine like the 9820, which gave the project its code name, “Keeper”. Engineer Wayne Covington persuaded Morris to build the language on a table-driven parser based on Franklin DeRemer’s then little-known LALR parsing work, instead of HP Loveland’s traditional tightly knitted firmware. As the language grew, each key took on a second and then a third function. Morris eventually decided to switch to a full QWERTY keyboard, which meant switching to BASIC.
Saving HPL
HP Labs head Barney Oliver had contributed to the 9820’s language and was deeply attached to it, particularly to implied multiplication. On the 9820, ABC meant A×B×C, which was easy to parse when every variable had its own key. On a typewriter keyboard it is impossible to tell whether PRINT is a command or the product of five variables. After a day-long review meeting in Loveland, Oliver offered a fix: functions and keywords would always be lower case, and variables would always be capital letters. Steve Leibson’s history says that, thanks to the table-driven parser, the whole language was running on a simulator two days later.
Software project manager Chris Christopher later proposed dropping HPL for BASIC anyway, but division management kept HPL. He extended it instead. Leibson describes the result as “Basic with the vowels sucked out”, because HPL absorbed much of BASIC’s functionality but kept its own three-letter mnemonics.
Building it
The team was Christopher, Covington, Jeff Osborne, John Nairn, Joe Beyers, Mike Tremblay and Bill Hanna. The software took about two years, and little of the 9820 code could be reused. Code was written on HP 2100-series minicomputers and later on a timeshared HP 3000. It was tested on a single hardware simulator built from another HP 2100. Because the whole system would ship in ROM, Christopher introduced statistical bug-rate tracking, “ego-less” programming and a “Steaks for Bugs” reward for anyone who found a serious defect. Leibson reports that the language ROMs never had to be replaced in the field because of a bug.
The hardware went to Morris and the I/O subsystem to Geoff Chance. HP’s NMOS II chip process had serious trouble during development, and there was pressure to switch to a silicon-on-sapphire process. Morris chose to stay with NMOS II, and it eventually worked.
HP’s May 1982 Journal dates the 9825A’s introduction to January 1976, and Leibson says production machines first shipped in mid-1976. Customer shipments were held back about a month so the memory boards could use new 4-kilobit dynamic RAMs, which doubled the base user memory to 6,844 bytes. The June 1976 Hewlett-Packard Journal gave the US base price as $5,900.
Design Philosophy
HP’s June 1976 article calls HPL “a powerful formula-oriented language that provides features of BASIC, FORTRAN, ALGOL and PL/I”. It was meant to let engineers write a formula almost the way they would on paper, with as little translation as possible. The guiding ideas were:
- Write formulas as you would on paper. Implied multiplication (
4AC,2A) cuts down on parentheses and*signs. - Interactivity first. The live keyboard let you inspect variables, evaluate expressions and call subroutines while a program was running.
- Instrument control as a first-class job. Reading a voltmeter on the HP-IB should take one statement, not a hand-coded sequence of bus commands.
- Expand with ROMs. The base system was kept small, and strings, matrices, plotting and advanced I/O came as plug-in ROMs that added new statements to the language.
Key Features
The language at a glance
The program below, from the June 1976 HP Journal, solves a quadratic equation. Program lines are numbered from 0, several statements can share a line separated by semicolons, and → assigns a value.
| |
enp (“enter and print”) prompts for a value on the display and logs the prompt and answer on the thermal printer. Branching statements can take a label (gto "imag"), a relative offset (jmp -4) or an absolute line number (gto 0).
Core characteristics
| Feature | HPL on the 9825A |
|---|---|
| Keywords | Lower-case mnemonics, mostly three letters: prt, dsp, ent, enp, gto, gsb, jmp, ret, dim, fxd |
| Variables | 26 simple variables (A–Z) and 26 array variables, limited only by memory |
| Arrays | Dynamically dimensioned, multi-dimensional, with selectable lower bounds, e.g. dim A[0:N],B[3,3] |
| Numbers | Stored with 12 significant digits; internal range about 10^±511 (displayed range 10^±99) |
| Assignment | →, e.g. 1→A→B |
| Loops | for/next with by step (added by the String–Advanced Programming ROM) |
| Subroutines | gsb/ret; with the Advanced Programming ROM, cll calls and functions with parameters and local p variables |
| Debugging | step, trace, normal, stop; trace prints line numbers and every assignment |
Strings
The 98210A String–Advanced Programming ROM added string variables, written as a capital letter followed by $. It also provided string arrays of one or two dimensions, a concatenation operator &, and functions such as cap (convert to upper case). In HP’s example, wait 500 holds the first display for half a second:
| |
The live keyboard
Calculators of the time normally locked the keyboard while a program ran. On the 9825A, the keyboard was serviced as an interrupting device. You could type an expression or command and press EXECUTE, and the calculator ran it at the end of the current program line, then went back to the program. While a long series approximation was running, for example, typing C and pressing EXECUTE showed the loop counter’s current value without stopping anything. HP said this feature had never before been found on a desktop calculator.
Instrument control over the HP-IB
The 98034A HP-IB interface card, programmed through the General I/O or Extended I/O ROM, is the reason the 9825 became a standard controller. Device addresses combine the interface’s select code (7 by default) with the instrument’s bus address, and the ROM handles all bus protocol:
| |
red 702,V unlistens the bus, addresses device 2 as a talker, addresses the calculator as a listener and reads the value. With the Extended I/O ROM, rds carries out a whole serial-poll sequence (unlisten, listen address, serial poll enable, talk address, read, serial poll disable) in one statement. The dev statement gives instruments names. The Extended I/O ROM also added interrupt-driven and DMA buffered transfers, error trapping, time-outs and bit manipulation.
Memory and tape
The standard 9825A had 6,844 bytes of user memory, expandable to 15,036, 23,228 or 31,420 bytes. The largest option could not be used with the String–Advanced Programming, General I/O–Extended I/O or Plotter–General I/O–Extended I/O ROMs because of address conflicts. The built-in 3M DC-100 tape cartridge held 250,000 bytes. A record memory command saved the entire machine state (programs, data and internal pointers), so a job could be swapped out and later resumed exactly where it stopped. Combined with an auto-start feature, this let a 9825 reload its memory and carry on after a power failure.
Under the Hood
Every block in the 9825A was designed specially for it except the 4K RAM chips. HP’s 16-bit processor was a hybrid circuit on a 7.6 × 3.8 cm ceramic substrate. It carried three NMOS LSI chips and four bipolar bus buffers:
- BPC (Binary Processor Chip): 59 instructions, two 16-bit accumulators, a 32,768-word address space.
- IOC (Input/Output Controller): 12 instructions, two-level vectored interrupts with eight priorities each, and one DMA channel.
- EMC (Extended Math Chip): 15 macroinstructions for binary and 12-digit BCD floating-point arithmetic. HP said these made the math routines “over ten times faster than they would be in software”.
The 64-kilobyte address space was split in half: 32 KB of ROM held the operating system, the HPL interpreter, the listing (“reverse compiler”) code and the option ROMs, and the other 32 KB was for RAM. When a line is entered, it is parsed into an internal form, and that form is reconstructed whenever the program is listed. That 32/32 split is Leibson’s description; the June 1976 HP Journal says the standard 9825A had 8 KB of read/write memory and 24 KB of operating-system ROM in a 65,536-byte address space. The 9825T later got around the RAM limit with the “Skoal” state machine, which decided on each memory access whether to use RAM or ROM. Leibson describes it as a simple bank-switching scheme that raised maximum RAM to 63 KB; the HP Computer Museum lists the 9825T with 62K as standard.
Performance in Context
- Matrix work: HP’s 1976 article says that with the optional Matrix ROM, a 40 × 40 matrix could be inverted in 80 seconds.
- Against its successor: The May 1982 HP Journal timed a short BASIC benchmark from T. Rugg and P. Feldman’s 1977 Kilobaud article in every language available on HP’s new machines. The program makes 1,000 passes through some arithmetic, a subroutine call and a five-element array loop. Total times were 11.48 s for HPL on the 9825, 6.95 s for HPL on the 9826A/9836A, 3.52 s for interpreted BASIC and 0.91 s for compiled Pascal on the 9826A/9836A. HPL used multiple statements per line wherever it could. On HP’s instrument-oriented “Nelson” benchmark (computing expected values for a resistor network, measuring it and checking limits), the 9825 took 0.113 s against 0.092 s for 9826 HPL.
Evolution
- 9825A (1976): The original machine. Early units had a low-travel “Cricket” keyboard derived from HP’s handheld calculators, which Leibson calls a typist’s nightmare that also had reliability problems. According to the HP Computer Museum, HP switched to raised, typewriter-style keys in February 1980; Leibson says the full-travel Cherry keyboard came “within two years” and was offered as a retrofit kit.
- 9831A (1977): The same hardware family running BASIC instead of HPL.
- 9825S (1979): 23.2K of RAM with the option ROMs built in.
- 9825B and 9825T (1980): The B replaced the A with 23K of RAM and the String, Advanced Programming, Plotter, General I/O and Extended I/O ROMs built in. The T added about 62K of RAM and the Systems Programming ROM.
- HPL 2.0 (1981): The 9826 was originally planned to run only HP’s BASIC. According to Leibson, when the BASIC project ran into trouble, a four-person team added HPL. The result was the 98604A HPL 2.0 ROM. HP described it as highly compatible with existing 9825 programs, files and interface code, and added a full-screen editor, CRT graphics, a real-time clock and access to the 9826’s knob. A 9826 could hold HPL and BASIC in ROM together and ask at power-up which to start.
By October 1980 HP had built 25,000 9825s: 17,000 in Loveland and Fort Collins and 8,000 in Böblingen, Germany. In May 1982 HP said “over 28,000 customers now own 9825s”. Leibson writes that the 9825 brought in more revenue in 1977 than any other HP product. Sources disagree on when it was discontinued: Leibson says HP had retired it by 1983, while the HP Computer Museum gives May 1985.
Current Relevance
HPL has no modern implementation outside emulation, and no Docker image exists. MAME has drivers for the 9825A, 9825B, 9825T and 9831A, including the 9825T’s Skoal memory scheme. The HP Computer Museum hosts 9825A and 9825T ROM images. Restorers keep surviving machines running. Documented jobs include fitting an over-voltage crowbar circuit to early power supplies (HP added one to later units) and rebuilding DC-100 tape drives, which are reported to suffer from failed capstans. Ansgar Kueckes’s PC tools HPDrive and HPDir emulate and copy HP-IB disc and tape drives from a PC with a GPIB card. Steve Leibson’s hp9825.com, built from interviews with the original engineers, is the main narrative history.
Why It Matters
The 9825 showed that a desktop machine with a friendly interpreted language could be the brain of an instrument system. HP-IB control took one HPL statement, so engineers who were not programmers could automate their test benches. That role carried over to the HP 9826 and the Series 200 workstations. HPL itself stands out as a language designed around its keyboard: lower-case keywords and capital-letter variables, which exist to keep implied multiplication workable, are an early, memorable example of syntax shaped by how people type.
Timeline
Notable Uses & Legacy
HP-IB automated test systems
With the 98034A HP-IB interface and Extended I/O ROM, the 9825 became HP's main controller for rack-and-stack instrument systems. HP's Loveland Instrument Division built the 9825A, B and T into automated test systems, and the May 1982 HP Journal called the 9825 "HP's top system controller since 1976".
Barney Oliver's SETI calculations
According to Steve Leibson's history, HP Labs head Barney Oliver used one of the first 9825s heavily in his work on the search for extraterrestrial intelligence. HP Loveland's Mike Kolesar wrote him special binary math routines with 28 to 30 digits of precision.
High-altitude balloon experiment, Alice Springs
In a recollection published by the HP Computer Museum, Don Morris describes a 9825 that ran an entire high-altitude physics balloon experiment launched from a research station in Alice Springs, Australia. It controlled the instruments, collected and pre-processed the data, and drove the telemetry transmitter.
Laboratory and engineering computation
HP designed the 9825A mainly for engineering, research and statistics. It was used both as a stand-alone computing tool and as a controller for pilot process control, remote data collection and production control.