The HP-41 rethought around a two-line display: the same RPN stack with Y now visible, named variables of any type, complex numbers and matrices as single objects, a root finder and integrator that turn a program into a form, curve fitting, 36-bit base arithmetic and a bitmap you can draw on — all from 37 keys through seventeen menus. This sheet is the keyboard drawn to the machine's proportions, a working guide to how it thinks, then an index of every function by the menu it is found in, with the orange shift written as ■ the way the key is: blank. Hover any entry for the full description, its parameter and its manual page.
Source: HP-42S RPN Scientific Calculator Owner's Manual, edition 7 (HP, 1988–89); page numbers are its printed pages and the Operation Index (pp. 310–335) supplies each function's keystrokes, parameter and page. Function names cross-checked against Free42's command table — see the foot of this page.Every key does two jobs — the white legend on the cap, and the orange legend on the case above it after the blank orange shift key. The orange legends in shaded boxes are not functions but menus: press one and the six keys of the top row are relabelled by the lower line of the display. That is the whole design of the 42S: the 41 had four keyboards and a catalog, the 42S has one keyboard and menus.
EXIT backs out of one menu level, or cancels a prompt, or stops a program; shifted it is OFF, and ON is printed beneath it because it is also the power key. ▲ and ▼ page through a menu with more than one row; with no menu showing they are BST and SST.
Hold any key down and the display previews the function without executing it; keep holding until NULL appears and nothing happens. The small number in each cap is what GETKEY returns for it — 1 to 37, or 38 to 74 shifted.
The two annunciators worth learning early are ▼▲ (this menu has more rows) and the shift box (the orange key is pending).
Four registers — T, Z, Y, X — hold the working numbers, and this is the first HP that shows two of them: the display’s upper line is Y, the lower is X. Every function takes its arguments from the bottom of the pile and drops the answer back into it. LAST X keeps whatever X held before the last operation.
The two shaded rows are what you see. Because Y is visible, the ENTER idiom finally makes sense to a newcomer: press it and the number visibly moves up a line. Only ENTER, CLX, Σ+ and Σ- disable stack lift (flag 30); after any of them the next number writes over X.
When a menu is showing, its labels take the lower line and only X is displayed. Press EXIT to get Y back.
There is no SIZE boundary to manage in the 41 sense. System memory, the stack, the 44-character Alpha register and the 100 flags take a fixed slice; everything else is one pool that variables fill from one end and programs from the other, with about 7,200 bytes free on a cleared machine.
Numbered registers still exist for HP-41 habits and for indirect addressing, but they are the elements of one matrix called REGS. That is why SIZE can be anything memory allows, why Size Error rather than NONEXISTENT is the complaint, and why STO 05 and STO "X" are the same instruction with two kinds of parameter.
ISG and DSE read a single register or variable as three packed fields — counter, limit and step — so a whole for loop lives in one number. It is written ccccccc.fffii, and the counter has seven digits here where the 41 had five.
ISG adds the step and skips the next line once the counter exceeds the limit; DSE subtracts and skips once it is less than or equal to it. The skipped line is normally the GTO that closes the loop, so a loop ends by skipping its own branch.
1.010 counts 1 to 10 by ones; 1.13102 counts 1, 3, 5 … 131 — every other pixel column across the display.
Two lines of 22 characters, but underneath it is 131 × 16 pixels and the machine will let you draw on it: PIXEL lights one dot, a negative coordinate draws a whole row or column, AGRAPH paints an image whose columns are the characters of the Alpha register, and PRLCD prints whatever is there.
A menu label is five characters at most, which is why WMEAN shows as WMN and PRON as PON — the label and the name a program uses can differ. The ▼▲ annunciator means the menu has more rows.
Forty-four characters, kept apart from the stack, and this time strings are also data: a variable or a matrix element can hold one. The register is where prompts are built, where ARCL formats numbers into text, and where a program keeps a name before it becomes a parameter.
Typing into Alpha replaces what is there; press ← first to turn the cursor on and append instead. ASTO saves six characters to a variable; ATOX and XTOA move a character at a time; AVIEW shows it, PROMPT shows it and waits.
The HP-42S of 1988 is the HP-41 rethought for a machine with a two-line dot-matrix display and no ports. It runs HP-41 programs, keeps the Alpha register and the flags, and adds the things the 41 needed plug-ins or synthetic programming for: named variables, complex numbers, matrices as objects, a root finder, a numerical integrator, curve fitting, base arithmetic and pixel graphics. Everything is reached from 37 keys through menus.
It is a Pioneer — the same case as the 17B, 27S and 32S — with about 7,200 bytes free, three coin cells that last a year, and an infrared port for the 82240 printer. There is no other I/O, which is the one thing its admirers have always held against it.
It stayed in the catalogue until 1995 and has never been replaced. Free42 and the SwissMicros DM42 exist because of that; see Reading more.
The top line is Y or a message, the bottom line is X or six menu labels. A menu key relabels the top row of keys; press the key under a label to run it. Menus with more than one row light the ▼▲ annunciator, and ▲▼ page through them.
COMB PERM N! GAMMA RAN SEED across the top row5 N!x: 120.0000 — and the menu exits■ PROB ■ PROBselect it twice and it stays until EXIT■ MODESDEG■ RAD GRAD RECT■ POLAR — ■ marks the setting in forceTwo kinds. Function menus (CLEAR, CONVERT, PROB, DISP, FLAGS, MODES, PGM.FCN, PRINT, CATALOG, CUSTOM, TOP.FCN, ALPHA) exit as soon as you use one function. Application menus (BASE, MATRIX, SOLVER, STAT, ∫f(x)) stay until you leave, and remember themselves under a function menu you open on top.
A label is at most five characters, so the label and the function’s name can differ: WMN is WMEAN, PON is PRON. The index below gives both.
Digits, ·, E for an exponent, +/− for the sign of whichever part you are in. While the cursor _ is showing, ← deletes a character; once entry ends it clears X instead. SHOW, held, reveals all twelve digits whatever FIX is set to.
x: 123.45_E 6 +/−x: 123.45E-6_ENTERy: 0.0001 / x: 0.0001 — entry ends, copied up■ SHOW1.2345E-4 while heldText is typed through the ALPHA menu: pick a letter group, press the letter; shift first for lowercase. It is slower than the 41’s Alpha keyboard and you will not do much of it — INPUT and VIEW show a variable’s own name, so most programs never need a prompt string at all.
Four registers, X and Y both visible. Two-number functions take Y and X and drop the stack; one-number functions replace X. LAST x holds the previous X.
x: 5.0000■ LAST xx: 3.0000 — the operand, still thereR↓roll the whole stack downx≷yswap the bottom two■ CLEAR CLSTall four to zeroOnly ENTER, CLX, Σ+ and Σ− disable stack lift. After any of them the next number overwrites X instead of pushing it up — the behaviour you want after ENTER, and a trap everywhere else. Stack levels can be named as parameters: STO ST Z, RCL ST T, X<> ST L for LAST X.
A dropped stack copies T into Z, so a constant in T is a constant forever: fill the stack with 1.5 and press × repeatedly for compound growth.
The 42S stores by name. STO "AREA" creates a variable called AREA holding whatever X is — a real, a string, a complex number or a matrix. The type follows the value; nothing is declared. Numbered registers survive as the elements of the matrix REGS, whose length is SIZE.
STO arithmetic leaves the answer in the register; RCL arithmetic brings it to X. Having both is a small thing that makes running totals and scaling a one-line affair. The . key in a parameter prompt means IND, and IND can point at a register or at a variable holding a name.
CLV deletes a variable and gives its bytes back; CLRG zeroes REGS. There is no variable catalog to run out of — only memory.
Far more functions than key legends, so there are four ways to reach one.
Prompts take parameters. A numeric prompt shows one cursor per digit (FIX __); key them all, or fewer then ENTER. An Alpha prompt offers the variable or label catalog as a menu, or ALPHA to type. · at a prompt makes it indirect; R↓ at a register prompt offers the stack levels.
Hold a key to preview its function; hold on until NULL and it is cancelled. Menus, catalogs and CUSTOM all obey this.
Twelve digits, exponents to ±499, and every number is decimal: 0.1 is exactly a tenth. DISP sets what you see; nothing you do there changes what is held.
1.5000 → 1.3000: an hour and a half■ CONVERT ▼ RNDmake the number match the displayTwo modes are easy to miss. REALRES (MODES, second row) makes √−1 an error rather than (0,1) — HP-41 programs expect that. And Σ+ uses the summation registers inside REGS from ΣREG (11 by default) upward, so a SIZE smaller than 17 breaks statistics with Size Error.
A complex number is a single object in X. Make one with COMPLEX from two reals (Y then X); split it the same way. The arithmetic keys, powers, roots, logs and trig all accept it. RECT and POLAR in MODES only change the notation.
x: 3 i4■ MODES POLARx: 5 ∡53.1301 — same number■ COMPLEXback to two reals, in the current mode■ CONVERT ABSmagnitude; SIGN gives the unit vectorTwo complex numbers are a pair of 2-vectors as far as DOT and CROSS in the MATRIX menu are concerned — the manual’s chapter 6 does vector arithmetic entirely this way. A complex value can be stored in a variable, a REGS register or a matrix element like any other.
With CPXRES set (the default) real inputs may give a complex answer: √ of −4 is 0 i2. Flag 74 records the choice.
A program is the keystrokes you would have pressed, recorded. PRGM toggles Program-entry mode; the display becomes the listing, one line at a time, with the current line on the bottom row. GTO . . first, so you start a fresh program at the end.
00 { 0-Byte Prgm }GTO . .to the end of memory: a new program■ PGM.FCN LBL ABCDE A R E A ENTER01▸LBL "AREA"…the body■ PRGMback out; the END is suppliedXEQ AREArun it — programs appear as a menuLabels: global Alpha names of one to seven characters, seen by XEQ, GTO and the catalog; local numeric 00–99 and the letters A–J and a–e, private to the program and cheap — one or two bytes against four plus the name. Local Alpha labels have a bonus: with LCLBL set, the CUSTOM menu shows them, so the top row runs your routines.
Eight pending returns. ▲ and ▼ are BST and SST in Program-entry mode; ← deletes the line; DEL in CLEAR deletes many; SHOW reveals a long one.
This is where the second line earns its keep. INPUT shows a variable’s name and current value and waits; whatever is keyed is stored on R/S. VIEW shows a named result. Neither needs a prompt string.
R? / x: 10.0000 — type a new value or accept itVIEW "V"V=1,570.7963"DONE" AVIEWa message, from the Alpha registerPROMPTshow Alpha and halt for R/SCF 22 … FS?C 22did they actually key a number?Better still is a variable menu: put MVAR "R" and MVAR "H" after the label and VARMENU puts R and H on the top row — press to store, shift-press to recall — exactly as the Solver does. MENU with KEYX/KEYG definitions goes further and makes the top row branch to your own labels, so a program becomes an application.
Flag 21 decides whether VIEW and AVIEW halt or print; with no printer, leave it clear.
Every test skips one line if it is false, so the line after a test is the “true” branch — almost always a GTO or XEQ. From the keyboard a test answers Yes or No.
Counted loops live in one register or variable as ccccccc.fffii. ISG counts up, DSE down, and each skips the next line when finished.
Flag 25 is the only error handling: set it, try the thing, then ask FS?C 25. If it is still set nothing went wrong.
Write the equation as a program that leaves f = 0 in X, name its variables with MVAR, and the SOLVER menu does the rest: it lists programs that have MVARs, then shows their variables as a menu. Store what you know, press what you want.
V R H on the top row10 R 5 Hthe knownsVV=1,570.7963 — solved2000 V 5 H RR=11.2838 — any variable, same program7 R 12 Rtwo guesses: store one, key the other, pressIt solves for any of the variables, which is why the equation is written as a difference rather than an assignment. When it cannot, it says so — Extremum, Sign Reversal, Constant?, Bad Guess(es) — and leaves its best value in X. PGMSLV and SOLVE are the same steps under program control.
A Solver program may call ∫f(x) and an integrand may call the Solver, but neither may call itself. Flag 45 is set while solving.
The same idea: a program with MVARs that leaves f(x) in X. ∫f(x) asks which program, then which variable is the one to integrate over, then shows LLIM ULIM ACC and the other MVARs so you can set the constants.
∫=… — the ∫ label appears after the limits are setACC is a relative accuracy and the price of a tighter one is exponential: the Romberg method doubles its samples for each extra digit. Set ACC to the accuracy of your data, not to zero. PGMINT and INTEG do it from a program, and flag 46 is set while it runs.
A matrix is a value like any other: it sits in X or in a variable, and the arithmetic keys work on it. NEW makes a y×x matrix of zeros in X; DIM makes or resizes a named one. The Matrix Editor is how you fill it.
x: [ 3×3 Matrix ]EDIT1:1=0.0000 — the editor, arrows on the top row2 → 5 →key a value, move right; ▼ for the next rowEXITback to the stack with the matrixSTO ABCDE M ENTERname itINV DET TRANfirst row of the menu; × and ÷ do matrix arithmeticSIMQ creates MATA, MATB and MATX for a linear system and solves it when you press MATX. INDEX names a matrix for the element functions — STOEL, RCLEL, I+, J+, STOIJ — which is how a program walks one. GROW lets the editor add rows as you type past the end, so a data list can be built without knowing its length.
Elements may be reals, strings or complex; COMPLEX joins two real matrices into one complex one. REGS is the matrix the numbered registers live in.
Σ+ accumulates x from X and y from Y into the summation registers, which are REGS from ΣREG upward — six of them, or thirteen in ALLΣ mode, which the nonlinear fits need. Mistyped a pair? Key it again and press Σ−.
x: 1.0000 — n so far (y first, then x)■ STAT MEANx̄ to X, ȳ to Y■ STAT ▼ CFIT MODL BESTpick the model with the best correlationFCSTYy for the x in X, on that modelCORR SLOPE YINThow good, and the lineFour models: linear, logarithmic, exponential, power; BEST tries all four. Flags 56–59 record the choice and 61–63 which models the data has ruled out. Data already in a matrix can be used without re-keying by making that matrix REGS.
BASE is an application: BINM OCTM DECM HEXM set the mode, and in any nondecimal mode the arithmetic keys become 36-bit two’s-complement integer operations. The LOGIC submenu has AND OR XOR NOT BIT? and ROTXY.
x: 2A — the same 42, shown in hex▼ F F +A–F on the second row; 2A + FFLOGIC ANDbitwiseDECMand back; the number never changedA value beyond 36 bits shows as <Too Big> — a number, not an error; SHOW reveals it. →DEC and →OCT in the catalog are unrelated: they are the HP-41’s DEC and OCT, kept for its programs.
The printer is the 82240, by infrared, and it needs PON before anything happens: flags 21 and 55 set. Then VIEW and AVIEW print instead of halting, TRACE records every keystroke and result, PRP lists a program and PRLCD prints the display pixel for pixel.
The manual’s DPLOT and PLOT programs (chapter 10) plot any Solver-style function on the display or the printer, and are worth typing in once. AGRAPH paints a bitmap from the Alpha register — each character is an eight-pixel column — with flags 34 and 35 choosing OR, overwrite, clear or XOR.
Type one in as written and it will almost always run. The differences that matter (chapter 11): the 42S has no USER keyboard, so key assignments become CUSTOM menu assignments; the Alpha register is 44 characters not 24; numbers reach 10499; and a real function with a complex result gives an answer rather than an error unless you set REALRES.
Names typed by XEQ follow the 41’s (page 171 has the table); a few are renamed and the statistics registers are REGS 11–16 by default rather than a ΣREG you must set. Programs are not packed and byte counts differ, so a 41 program that just fitted may not.
The Programming Examples and Techniques book has a chapter on enhancing 41 programs with menus and named variables — the point of moving them.
Messages replace the top line and disappear on the next key; ← clears one without doing anything else. Read each as a statement about which assumption failed.
Set flag 25 before an instruction that may fail and the error is swallowed, the instruction skipped and the flag cleared; FS?C 25 afterwards tells you what happened. Flag 24 turns an Out of Range into ±9.99999999999E499 and carries on. That is the whole error-handling story, and it is enough.
The Owner’s Manual (362 pages) is one of HP’s best: chapters 1–7 are the machine, 8–11 programming, 12–16 the applications, and the Operation Index (pp. 310–335) is the alphabetical reference this sheet is built from. The companion Programming Examples and Techniques book carries the longer programs and the HP-41 conversion chapter.
The machine lives on twice over. Free42 by Thomas Okken is a from-scratch re-implementation for every desktop and phone, with a decimal build that is more accurate than the original; Plus42 extends it with a larger display and algebraic equations. The SwissMicros DM42 is Free42 in an HP-style aluminium case, and the DB48X firmware on the same hardware is a different machine entirely — see its sheet.
The keyboard here was drawn from the manual’s cover photograph and the Free42 skin of the real machine; the function names were checked against Free42’s command table, because the scan prints menu labels as noise.
Setting or clearing a flag from 36 to 80 is a Restricted Operation; test them with FS? and FC?. Appendix C (pp. 273–282) has the full table with each flag’s state after a reset and after a memory clear.
01▸LBL "CYL"a global label; the ▸ marks a label line in the listing02 MVAR "V"the three variables the menu will offer, in menu order03 MVAR "R"04 MVAR "H"05 RCL "R"πR²H − V: the equation written as a difference06 X↑207 PI08 ×09 RCL "H"10 ×11 RCL "V"12 -zero when the variables agree13 .END.supplied by the machineEach box is the display as you would see it in Program-entry mode, one line at a time. Global labels and variable names are shown in quotation marks on this machine; a local label would not be. The ▸ after the line number marks a label line, and .END. is the permanent end of program memory that the last program borrows.
This is the smallest program that shows what the 42S added to the 41. Three lines of it — the MVARs — do no arithmetic at all. They tell the machine which variables the equation has, and from that alone the SOLVER builds a menu, prompts by name, and solves for any one of them.
The equation. A cylinder has V = πR²H. The Solver wants f(V, R, H) = 0, so the program computes πR²H and subtracts V: zero when the three agree. That is the only rule — write the difference, not the assignment — and it is what lets one program solve for V, for R, or for H.
Entering it. Names are typed on the ALPHA menu, which is the slow part:
00 { 0-Byte Prgm } — a fresh program at the end■ PGM.FCN LBL ABCDE C WXYZ Y JKLM L ENTER01▸LBL "CYL"■ PGM.FCN ▲ MVAR RSTUV V ENTER02 MVAR "V"RCL RSTUV R ENTER05 RCL "R" — R does not exist yet; that is fine■ x2 ■ π × …the arithmetic, one key each■ PRGMback to the stackRunning it. Press SOLVER. The menu lists every program that has MVARs — just CYL so far — and pressing it puts V R H on the top row. A number followed by a label stores it; a label alone solves for it:
Select Solve Program, then V R H10 R 5 H VV=1,570.79632000 V RR=11.2838 — H is still 5; the radius for 2000 units20 R HH=1.5915 — and the height that gives 2000 at R = 20■ Rx: 20.0000 — shift and a label recalls without solvingWhat the Solver is doing. It runs the program repeatedly with trial values in the unknown, watching the sign of the result. One evaluation, with R = 10, H = 5 and a trial V of 1,000, goes like this:
RCL "R"X = 10R as the menu stored itX↑2 PI ×X = 314.1593πR²RCL "H" ×X = 1,570.7963the volume the other two variables implyRCL "V" −X = 570.7963minus the V being tried (1,000 here): not zero, try againReusing it. The same program is a complete VARMENU application: outside the Solver, XEQ "CYL" does nothing useful, but a one-line program VARMENU "CYL" followed by STOP puts the V R H menu up for plain data entry. Add MVARs to any formula and the 42S turns it into a form. Hand the same label to ∫f(x) and it will integrate it over whichever variable you pick.
Solver use is chapter 12 (p. 178), the rules for writing its programs p. 179, and TVM — a five-variable version of exactly this pattern — is the worked example on p. 192. Results are arithmetic checked in a decimal Free42; the display strings are as the manual shows them.