Page 1 explains the HP-71 as a machine and language: keyboard and CALC mode, program-line syntax, variables and strings, operators, number formats and IEEE math exceptions, branching, subprograms, errors, flags, input, output formatting, files, data files, editing, clock and statistics. The following pages index every keyword from the Owner's Manual's Keyword Index by category. Hover any keyword for its syntax, description and Owner's Manual page. A final section covers the Emu71 emulator only.
Sources: HP-71 Owner's Manual (HP 00071-90001 Rev. D, Feb 1985) — sections 1–14, appendices A–C, Keyword Index. Keywords in more than one category are listed in each. Emu71 section: Emu71 v1.19 manual and MK71MAC.TXT (C. Gießelink).Shifts: f (gold, above keys) · g (blue, below keys). Release the shift before or hold it while pressing the key. Letters are uppercase; g+letter gives the other case; fLC toggles lowercase mode (flag −15).
| Key | Action |
|---|---|
| END LINE | Execute / enter the line (like RETURN) |
| ATTN | Clear display; halt a running program (SUSP). Also the ON key |
| fOFF / ON | Power off / on (auto-off after 10 min unless flag −3 set) |
| fCALC | Toggle CALC mode ↔ BASIC mode |
| RUN | Run current file (or resume) · in CALC: show next partial result |
| fCONT | Continue a suspended program |
| fSST | Single-step one statement (or one CALC step) |
| fUSER | Toggle User keyboard · g1USER = User kbd for next key only |
| gCMDS | Command Stack: last 5 commands; ▲▼ to browse, END LINE to run |
| fVIEW | Hold next key → shows its DEF KEY string |
| gERRM | Show last error/warning message |
| fBACK | Backspace (delete left) · in CALC: undo last operation |
| f-CHAR / f-LINE | Delete char under cursor / delete to end of line |
| fI/R | Toggle Insert / Replace cursor |
| ◀ ▶ · g◀ g▶ | Move cursor · jump to start / end of the 96-char line |
| ▲ ▼ | Previous / next line (FETCH neighbours, CAT entries, Command Stack) |
| gCTRL+key | Control character (CTRL-M = CR, CTRL-J = LF, CTRL-g[ = ESC) |
| ON+/ | INIT: 1 (system reset, memory kept) · 2 (self-test) · 3 (memory reset: clears main RAM; independent RAM survives) |
Display: 22-character window on a 96-character line; ← → annunciators show the line extends. Typing aids: f+top-row keys type keywords (e.g. fS = DISP ).
f g shift pending · USER User keyboard · RAD radians · 0 1 2 3 4 user flags 0–4 set · BAT low battery · ((•)) alarm · PRGM program running · SUSP suspended · CALC CALC mode · AC reserved.
fCALC toggles. Evaluates numeric expressions with intermediate results as you type — same variables, functions, precedence and user-defined single-line functions as BASIC. Assignments allowed (A=3*4).
| Key | In CALC mode |
|---|---|
| END LINE | Finish and evaluate |
| RUN / fSST | Show next intermediate step separately |
| fBACK | Backward execution: undo operands/operators one at a time |
| ▲ | Recall whole expression into Command Stack for editing; ⊲ shows it was already evaluated |
Not available in CALC: strings, DTH$/HTD, multi-line user functions, statements other than assignment, program lines. Don't insert/remove modules while CALC mode is on (memory reset).
"…" or '…'.A, X1); strings add $ (N$); arrays A(3), M(2,3) (max 2 dims). Numeric and string of the same name are distinct.:MAIN, :PORT(n), :CARD. Reserved: ALL CARD KEYS TO INTO PCRD.1.5E-3, -7; 12 significant digits, exponent ±499. Hex via HTD("FF"), DTH$(255).| Type | Range | Storage |
|---|---|---|
| REAL (default) | ±1E-499 … ±9.99999999999E499, 12 digits | 8 bytes |
| SHORT | 5 digits, ±9.9999E499 | 4 bytes |
| INTEGER | −99999 … +99999 | 3 bytes |
| String | default max 32 chars; DIM up to memory | len+2 |
Undeclared numeric variables are REAL scalars created on first use (value 0); strings default to "" with max length 32. Arrays are dimensioned implicitly to (10) / (10,10) on first use. Comparing strings uses character codes.
| Level | Operators (highest first) |
|---|---|
| 1 | ( ) — innermost first |
| 2 | Functions: SIN, LOG, FACT, user FN… |
| 3 | ^ (exponentiation) |
| 4 | unary −, NOT |
| 5 | * / % DIV |
| 6 | + − |
| 7 | Relational: = # <> < <= > >= ? |
| 8 | AND |
| 9 | OR, EXOR |
Same-level operators evaluate left to right. EXOR: exactly one true. Relational operators return 1 (true) or 0 (false).
Numbers ≥ 1E12 in magnitude are always shown in exponential form. FIX/SCI/ENG digits are readable in flags −17…−20; format in flags −13/−14; rounding in flags −11/−12. Display formats do not change stored values (12-digit internal precision).
| Exception | Flag | Name | Examples |
|---|---|---|---|
| Invalid operation | −8 | IVL | ACOS(2), LOG(-23), (-14)^(-1/3) |
| Division by zero | −7 | DVZ | 187/0, TAN(90) |
| Overflow | −6 | OVF | FACT(254), 10*1E499 |
| Underflow | −5 | UNF | EXP(-1149), 1/3E499 |
| Inexact result | −4 | INX | 1/3, 1+1E-50 |
| ERRN | Warning (DEFAULT ON) | Default value |
|---|---|---|
| 1 UNF | underflow | 0 |
| 2 OVF | overflow | ±99999 INTEGER · ±9.9999E499 SHORT · ±9.99999999999E499 REAL |
| 3 DVZ | EXPONENT(0) | −9.99999999999E499 |
| 4 DVZ | TAN of odd multiple of 90° | ±9.99999999999E499 |
| 5 DVZ | 0 ^ negative | ±9.99999999999E499 |
| 6 | 0 ^ 0 | 1 |
| 12 DVZ | LN(0) | −9.99999999999E499 |
GOTO/GOSUB cannot branch into a subprogram or user function. Timers are local to the program/subprogram that set them. Nested GOSUBs limited only by memory.
| Message form | Meaning |
|---|---|
ERR:Invalid Expr | syntax error from the keyboard |
ERR L30:String Ovfl | run-time error at line 30 (program suspended) |
WRN L30:… | warning; execution continues |
Line Too Long, Missing Param, Data Type… | common messages — full list in the Reference Manual |
gERRM or ERRM$ redisplays the last message. Errors set ERRN/ERRL; a suspended program shows SUSP — fix and CONT, or SST through it. Math-exception warnings 1–12 are listed in "Math Exceptions".
| Flag | Meaning (set = …) |
|---|---|
| 0 – 63 | User flags; 0–4 have annunciators |
| −1 | Suppress warning messages |
| −2 / −25 | Beeper off / loud |
| −3 | Continuous on (no 10-min auto-off) |
| −4…−8 | INX UNF OVF DVZ IVL math exceptions |
| −9 | User keyboard active |
| −10 | Radians (RAD annunciator) |
| −11,−12 | Rounding: 00 NEAR · 01 ZERO · 10 POS · 11 NEG |
| −13,−14 | Format: 00 STD · 10 FIX · 01 SCI · 11 ENG |
| −15 | Lowercase keyboard |
| −16 | OPTION BASE 1 |
| −17…−20 | Digits shown (binary, −17 = bit 0) |
| −26 | BASIC prompt suppressed |
| −46 | EXACT executed (read-only) |
| −57 −60…−64 | AC · alarm · BAT · PRGM · SUSP · CALC annunciators (read-only) |
−1…−32 may be set/cleared/tested; −33…−64 test only. All flags are global (visible in subprograms).
| Spec | Meaning |
|---|---|
| D | digit (leading zeros as blanks) |
| Z | digit with leading zeros |
| * | digit, leading asterisks |
| S | sign + or − |
| M | − or blank |
| . | decimal point |
| R | comma as radix |
| C | digit separator , |
| E | exponent field |
| K | compact (like STD, no padding) |
| A | character |
| X | blank |
| "text" | literal |
| / | end of line |
| # | suppress end of line |
| B | byte: char with the given code |
| n(…) | repeat group n times |
| , | field separator |
Symbol list per the Reference Manual's IMAGE entry (the Owner's Manual defers to it). A format string is reused when the list has more items than fields. Numeric field ↔ numeric item, else error. Escape sequences (ESC = CHR$(27)): ESC< cursor off · ESC> on · ESC E clear · ESC N/R insert/replace · ESC %cn cursor to column CODE(c) · ESC C/D right/left · ESC K clear to end · ESC O delete char. Text written while the cursor is off is a protected field.
| File type | What |
|---|---|
| BASIC | program (EDIT/RUN) |
| TEXT | LIF1 text records (TRANSFORM, HP-IL transfer) |
| DATA | random/sequential records (CREATE DATA) |
| SDATA | 8-byte numbers, HP-41 compatible |
| KEY | key definitions ("keys" = current) |
| BIN / LEX | binary program / language extension (keywords) |
Devices: :MAIN, :PORT (all ports), :PORT(n) n = 0–5 (5 = card reader port), :CARD, :PCRD (private card). Search order without a device: main RAM, then ports 0,1,2… Port 0 = internal 16 K in four 4 K units (0, .01, .02, .03). CAT columns: NAME S TYPE LEN DATE TIME PORT (S: P private, S secure).
DATA files store numbers (8 bytes) and strings (length+text) in records; an item that doesn't fit a record spills to the next in sequential mode but errors in random mode. TEXT files are read/written a line (record) at a time. Closing: ASSIGN # TO * or program END.
workfile is the unnamed default file (NAME gives it a name). Only one current file; RUN filename makes it current. BIN files run with RUN/CALL but can't be listed; LEX files add keywords and just need to be in memory. TRACE FLOW/VARS for debugging.
Set the clock with SETTIME after a memory reset, then EXACT; later use SETTIME/ADJUST to correct drift and EXACT again to teach the crystal correction. Calendar range 0000–9999 (Gregorian from 1582/1752).
The array holds only summary statistics (sums, sums of squares, cross products), always base 0 and REAL. Default variable number is 1. Fit other curves by transforming data (e.g. ADD X, LN(Y) for exponential fits).
Install: ~/ide/HP71B/emu71/ — ./emu71.sh starts run/EMU71.exe under Wine. First start: pick a KML skin (e.g. Christoph's Real HP71B for 1024x768) → OK. Emu71 emulates the real ROM (HP71B.ROM = 1BBBB, checksum-verified), so everything on these pages applies unchanged; the emulator adds only its Windows menu.
| Emu71 menu | Use |
|---|---|
| File → New / Open / Save (.e71) | Emulator state = the calculator's whole memory. Save before quitting (or enable Settings → "Automatically Save Files On Exit"). |
| Edit → Port Configuration… | Plug modules: RAM (4/32 K…), ROMs from run/ (MATHROM.BIN, Hpilrom.bin, FORTHROM.BIN/HRDFORTH.BIN), HP-IL interface. Then SHOW PORT / CAT :PORT(n) on the 71. |
| Edit → Copy Stack / Paste Stack | Copy the display text to the clipboard · paste clipboard text into the command line (BASIC mode). Handy for single lines. |
| Edit → Reset Calculator · Backup | CPU reset (then INIT: 1/2/3 as on the real machine) · snapshot / restore state. |
| File → Settings → Authentic Calculator Speed | Uncheck for maximum speed (needed for fast macro replay). |
| Tools → Macro → Record / Play / Stop / Settings | Keyboard macro recorder — the way to "type" a whole program file into the 71. |
| View → Change KML Script | Other skins incl. module-overlay backgrounds (kml-overlays). |
Emu71 has no "load text file" command; instead a text listing is converted to a keystroke macro that Emu71 replays into the calculator (MK71MAC package, emu71/mk71mac/).
\ | ~ and DEL. Use DIV instead of \.LIST; the 71 keeps only what parsed.LIST and Edit → Copy Stack copies one display line at a time; for whole listings use PLIST to a virtual HP-IL printer (Emu71 virtual HP-IL over TCP/IP + ILPer/pyILPER) or TRANSFORM to TEXT and copy to a virtual LIF disk.COPY MYPROG TO :TAPE, COPY :TAPE… exactly as with a real HP 82161A.Sources: Emu71 v1.19 manual (emu71/emu71-bin/Emu71.htm), MK71MAC.TXT. Nothing in this box applies to a physical HP-71B.