HP-41CX Reference the 1983 flagship · 160 entries, grouped as the manual groups them

The calculator that could talk. A fourteen-character alphanumeric display, an Alpha register that holds text, named files in extended memory, a clock that runs with the machine off and can wake it to run a program — all reached from 35 keys wearing three legends each. This sheet is a working guide to the machine and then an index of every function, with the gold prefix written as the way the keyboard leaves it: unlabelled. Hover any entry for the full description and its manual page.

the gold prefix, printed on no key at all
Sources: HP-41CX Owner's Manual volumes 1 and 2 (HP, 1983) and the HP-41CX Quick Reference Guide; page numbers are volume 2, whose Function Tables (pp. 414–439) give this index its grouping. Function names are read from the ROM images, not the scans — see the foot of this page.
Colour keythe machineentry, stack & displayprogrammingmathematicsdata objectsvariables & memoryinput, output & interfacereference & system

The Keyboard

35 keys · four toggles · drawn to the proportions of the machine
BATUSERRAD0PRGMALPHA
HP-41CX
ONUSERPRGMALPHA
HEWLETT·PACKARD41CX
Σ-Σ+A
yx1/xB
x2√xC
10xLOGD
exLNE
CLΣx≷yF
%R↓G
SIN-1SINH
COS-1COSI
TAN-1TANJ
   
ASNXEQK
LBLSTOL
GTORCLM
BSTSST 
CATALOGENTER↑N
ISGCHSO
RTNEEXP
CL X/A 
x=y?Q
SF7R
CF8S
FS?9T
x≤y?+U
BEEP4V
P→R5W
R→P6X
x>y?×Y
FIX1Z
SCI2=
ENG3?
x=0?÷:
π0SPACE
LAST X·,
VIEWR/S 

Three keyboards, one set of keys

Every key does up to three jobs, and which one you get depends on a toggle, not on holding anything down. That is the whole trick of the 41: the machine has more functions than keys and reaches them by modes.

plain
the white legend on the key face
then key
the gold legend printed on the case above the key
ALPHA
the blue letter on the key face — the number keys become a typewriter
USER
whatever you assigned with ASN, on any key you like

ON, USER, PRGM and ALPHA are not part of that scheme. They are four flat unitask keys on the case above the keyboard, each with exactly one job, and they are pressed directly — never after the prefix. They also work in Program mode without leaving it, which is what makes them toggles rather than functions. The one exception is then ON, which selects continuous on.

Hold any key down and the display previews the function without executing it; slide off the key before releasing and nothing happens. It is the safest way to find out what a key does.

The gold prefix key carries no legend at all — it is the blank gold key in the third row.

gold, reached with the prefix key — printed on the case above the keyblue, reached with ALPHA — printed on the key itself

HP-41CX Guide

the machine, and how to make it do things

Anatomy five things worth seeing laid out

The four-level stack

There is no expression to edit and no parentheses to balance. Four registers — T, Z, Y, X — hold the working numbers, X is what the display shows, and every function takes its arguments from the bottom of that pile and drops the answer back into it. A fifth register, LAST X, quietly keeps whatever X held before the last operation.

key 4
T
Z
Y
X4
stack lifts on the next entry
ENTER↑
T
Z
Y4
X4
X copied to Y, lift disabled
key 3
T
Z
Y4
X3
writes over X, no lift
×
T
Z
Y
X12
Y and X consumed, stack drops

The subtlety that bites everyone is that ENTER↑ disables stack lift. It is one of only four operations that do — ENTER↑, CLX, Σ+ and Σ-. After any of them the next number you key writes over X instead of pushing it up.

Unlike the Voyagers there is no R↑ on the keyboard face: it is gold-shifted, and the stack is otherwise identical.

What fits in a register

Every storage register on the 41 — a stack level, Rnn, an extended memory register — is the same seven bytes, fourteen nibbles wide. A number uses them as sign, ten mantissa digits and a signed two-digit exponent. The same fourteen nibbles hold six characters of text instead, which is why ASTO stores six and no more.

Smantissa — 10 digitsSexpsignall ten digits are kept whatever FIX shows±99
c1c2c3c4c5c6six characters, one byte eachunused

Numbers are decimal, not binary: ten digits, not ten bits of precision. Nothing is lost to binary rounding, and 0.1 is exactly a tenth.

One pool, split by SIZE

Main memory is a single block shared between numbered data registers and program bytes, and SIZE is the boundary between them. Raising SIZE takes the bytes from your programs; lowering it destroys the registers above the new line. Extended memory is a separate pool and is not touched by SIZE at all.

data registersSIZE sets this edgeR00 … Rnnprogram bytessystemmain memory — 319 registers on the CXstack
file 1file 2freeextended memory — 124 registers built in, 600 with two modules

The practical rule: set SIZE once, at the start, big enough for the registers the program names. NONEXISTENT almost always means SIZE is smaller than the register you asked for.

The loop counter

ISG and DSE read a single register as three packed fields — a counter, a limit and a step — so a whole for loop lives in one register and one program line. The number is written iiiii.fffcc.

counterlimitstep00001.01000starts hereruns while ≤ thisblank = 1

ISG adds the step and skips the next line once the counter passes the limit; DSE subtracts and skips once it falls below. The skipped line is normally the GTO that closes the loop — so the loop ends by skipping its own branch.

1.010 counts 1 to 10 by ones. Only the first five digits are the counter, so the largest loop is 99999 passes.

The Alpha register

Twenty-four characters, kept entirely apart from the stack. It is the machine’s string type: prompts and messages, file names, global labels, and raw bytes for anything the designers did not think of. The display shows twelve characters at a time.

shown in the displayscrolled off to the left24 characters

Keying into Alpha replaces what is there; APPEND (the ├ that opens a text line in a listing) adds to the end instead. ATOX and XTOA move one byte at a time between Alpha and X, which is how a program does character work at all.

The machine

The HP-41CX of 1983 is the last and largest of the 41 line: a programmable RPN calculator with a fourteen-character alphanumeric display at a time when its rivals showed seven segments and nothing else. That display is the whole point. A 41 program can ask a question in words, name its own variables, and print a legible answer, so a machine that computes becomes a machine that can be handed to someone else.

The CX folds in what used to be plug-ins: the Time module and the Extended Functions are built in, and it carries 124 registers of extended memory and a text editor. Four ports remain for everything else.

Continuous Memory means off is only a display state. Programs, registers, alarms and the clock survive it, and survive battery changes if you are quick.

Three keyboards

There are more functions than keys, and the way out is modes rather than more prefixes. The plain legend is on the key; the gold legend is on the case above it, reached with the unlabelled gold prefix; ALPHA turns the keyboard into a typewriter; USER swaps in your own assignments.

XEQ ALPHA S I Z E ALPHA 020twenty data registers, R00–R19ALPHAletters — the annunciator lightsUSERyour assignments, made with ASNXEQ ALPHA T I M E ALPHAanything, by name, at the cost of typing it

Any function can be run by name with XEQ, so nothing is unreachable. Assigning the ones you use to keys with ASN is what makes the machine yours.

Holding a key previews the function in the display without running it. Slide off the key before letting go to cancel.

Keying in

Numbers and letters are keyed the same way. The first keystroke shows the character and an input cue _; while the cue is showing, deletes one character. Once entry is terminated the cue disappears and means clear instead — the same key, two very different jobs.

1 2 3123_ENTER↑123.0000 — entry ends, X copied to Y4 545_ — writes over X, no lift4_ — cue showing, so backspace0.0000 — cue gone, so clear

EEX starts an exponent and CHS signs whichever part you are in — the mantissa, or the exponent if you have pressed EEX.

The display

Fourteen characters, and a row of annunciators along the top that is worth learning to read: they are the machine telling you what mode it is in.

BATbattery low
USERUser keyboard active
GRAD / RADangular mode; neither lit means DEG
SHIFTthe gold prefix is pending
0–4which subroutine return levels are pending
PRGMProgram mode
ALPHAAlpha keyboard active

FIX, SCI and ENG change only what you see; all ten digits stay inside. RND is the one function that makes the stored number match the shown one.

The 0–4 annunciator counts pending subroutine returns. If it is lit when you think a program has finished, something never came back.

The stack

Four registers, X at the bottom and visible. Two-number functions take Y and X and drop the stack; one-number functions replace X. LAST X holds the previous X, which makes a mistyped operand recoverable and lets a value be used twice without storing it.

2 ENTER↑ 3 +5.0000 LAST X3.0000 — the operand, still thereR↓roll the whole stack downX<>Yswap the bottom two

Only ENTER↑, CLX, Σ+ and Σ- disable stack lift. After any of them the next number overwrites X instead of pushing it up — which is exactly what you want after ENTER↑, and a trap everywhere else.

Registers and SIZE

Data registers are numbered, not named, and how many exist is up to you. SIZE divides main memory between registers and program bytes; the split is the single most common source of confusion on the machine.

XEQ ALPHA S I Z E ALPHA 025R00 through R24 existSTO 07X into R07STO + 07add X to R07 — result stays in the registerRCL 07and back

Register arithmetic leaves the answer in the register. STO + 07 is not RCL 07 then +; it is the accumulator idiom, and it does not disturb the stack.

Indirect addressing — the IND that appears after a function name — takes the register number from another register, which is how a loop walks a table.

Flags

Fifty-six one-bit switches. Flags 00–29 are yours; 30–55 are the machine reporting on itself. The tests skip the next line unless the condition holds — “do if true”.

SF 01set your own flagFS? 01skip the next line unless it is setFS?C 01the same, then clear itSF 25ignore the next error — then test flag 25 to see if it happened

The two that change how the machine behaves rather than reporting on it are 21 (whether VIEW and AVIEW stop a program) and 25 (swallow the next error). Flag 25 is the 41’s entire error-handling story: try the thing, then ask whether it worked.

Programs

A program is a list of the keystrokes you would have pressed. Enter PRGM, key them, leave. Labels are the entry points: local numeric labels 00–14 are one byte and private to the program; a global Alpha label is what the outside world sees.

PRGMprogram mode GTO . .go to the end and start a new program LBL ALPHA A R E A ALPHAa global labelthe bodyPRGMback outXEQ ALPHA A R E A ALPHArun it

GTO . . is the incantation worth memorising: it packs memory and opens a fresh program at the bottom, which is how you start typing one in without disturbing what is already there.

Six levels of subroutine return. The 0–4 annunciator shows how many are pending.

Branching and loops

Every conditional skips one line if the test fails, so the line after a test is the “true” branch — almost always a GTO.

X<=Y?skip the next line unless X ≤ YGTO 01the true branchthe false branch continues here

Counted loops live in one register as iiiii.fffcc — counter, limit, step. ISG counts up and DSE counts down, and each skips the next line when the loop is done, so the loop ends by skipping its own branch.

1.010 STO 00count 1 to 10 by onesLBL 02top of the loopbodyISG 00bump; skip when past 10GTO 02the line that gets skipped

Talking to a person

This is what the 41 has that its contemporaries do not. A program can ask, in words, and read back a typed answer.

"NAME?"text into the Alpha registerPROMPTshow it and stop, waiting for R/SANUMpull the first number out of what was typed"OK "more textARCL 00append a register, formatted as displayedAVIEWshow the result

PROMPT always stops; AVIEW stops only if flag 21 is set and flag 55 clear — that is, when there is no printer to send it to instead. GETKEYX waits a chosen number of seconds for a single keypress, which is enough to build a menu.

Extended memory

A second pool of memory, holding named files rather than numbered registers, and untouched by SIZE. Three kinds: program, data, and text. One file at a time is current, with a pointer that remembers where you were in it.

"LOG"name in Alpha100 CRFLAScreate a 100-register text file"LINE ONE"APPRECappend it as a record0 SEEKPTrewindGETRECread the record back into Alpha

Nothing is allocated for you: you create a file, you size it, you purge it. EMDIR lists what is there and EMROOM says how much is left.

Flag 17 is set when a read runs off the end — the flag to test at the top of a record loop.

Time, alarms and the stopwatch

The clock runs with the machine off and survives MEMORY LOST. Dates are numbers in the current MDY or DMY format, and there is real date arithmetic.

DATE9.091986 — today, as a number30 DATE+thirty days onDDAYSdays between two datesDOW0 = Sunday … 6 = Saturday

An alarm set with XYZALM takes a time, a date, a repeat interval and a message — and if the message is a global label it becomes a control alarm that runs that program. A calculator that wakes itself up to do something is not a common thing even now.

The catalogs

Six listings, all under one key, and the fastest way to find out what a particular machine actually contains.

1programs in main memory, by global label
2plug-in and extension functions
3every built-in function
4the extended memory directory — also EMDIR
5alarms, in time order — also ALMCAT
6your key assignments

R/S pauses a running catalog and stops it. Stopping CATALOG 4 on a file makes that file current, which is the quickest way to select one by hand.

When it complains

Errors stop the program and put a word in the display. The useful habit is to read it as a statement about which assumption failed.

ALPHA DATAA numeric function met Alpha data in X or Y. SIGN returns 0 for Alpha data and is the usual way to check first.
DATA ERRORThe argument is out of range for the function — a negative square root, a log of zero, an invalid date or H.MMSS value.
NONEXISTENTA register, line, label or file that is not there. The commonest cause is a SIZE smaller than the register a program expects.
OUT OF RANGEThe result overflowed and flag 24 was clear.
TRY AGAINSIZE or PSIZE could not take the bytes it needed from program memory. Pack, or delete a program, and repeat.
NO ROOMExtended memory has no space for the file or record.
DUP FLA file of that name already exists.
FL TYPE ERRThe function does not apply to that type of file.

Set flag 25 before an operation that may fail and the error is swallowed and the flag cleared instead; FS?C 25 afterwards tells you what happened. It is the only error handling the machine has, and it is enough.

What the CX added

Against a 41C or CV, the CX is the same machine with the accessories built in and a handful of genuinely new functions (OM2 appendix I).

the Time module in the machine, not a port — clock, alarms, stopwatch
Extended Functions and 124 registers of extended memory built in
the text editor, ED
X=NN? and its five siblings — compare X against a register, not just Y
CLRGX, EMDIRX, GETKEYX, RESZFL, ASROOM
319 registers of main memory rather than 63 or 319 depending on the model

Programs written for a C or CV run unchanged; the reverse is only true if you stay off the CX-only functions.

Reading more

The two-volume Owner’s Manual is unusually good, and volume 2 is the one to keep: its ten Function Tables (pp. 414–439) are the index this sheet is built around, and its appendix A lists every error.

The names here were read out of the ROM rather than the page, because the scans print every key legend in a symbol font that OCR turns into noise. The Extended Functions and Time modules carry a proper function table in ROM; the built-ins are found by their names, which sit in the words just below each entry point.

The emulator these were read from is QtNewT by J.W. Sievers, a NUT processor implementation with a Qt front end.

Flags

56 switches · 00–29 are yours, 30–55 are the machine reporting on itself
00–10general purpose — Yours entirely. Nothing in the machine reads them.
11automatic execution — Set: the program at the top of memory runs when the machine is switched on.
12–13printer double-wide — Control double-width printing.
14card reader overwrite
15–16printer mode — Together select MAN, NORM or TRACE.
17end of file — Set when a text-file read runs off the end. The flag to test in a record loop.
18–20general purpose — Cleared at power-on, otherwise yours.
21printer enable — Set: VIEW and AVIEW print and carry on. Clear: they display and, in a program, stop. With no printer this is the flag that decides whether a program pauses.
22numeric entry — Set when a number has been keyed in since it was last cleared.
23Alpha entry — The Alpha counterpart of flag 22.
24range error ignore — Set: overflow returns ±9.999999999×1099 instead of halting.
25error ignore — Set: the next error is suppressed and the flag clears itself. The way to attempt something that may fail — try it, then test flag 25.
26audio enable — Clear it and TONE, BEEP and the alarms fall silent.
27User keyboard — Follows the USER toggle.
28decimal point — Set: point as radix, comma as separator. Clear: the European convention.
29digit separator — Clear to drop the thousands separators.
30–35system — Read-only.
36–41display digits — Encode the FIX/SCI/ENG digit count.
42–43angular mode — 00 = DEG, 01 = RAD, 10 = GRAD.
44continuous on — Set by ON.
45system
46–47system
48Alpha keyboard — Follows AON/AOFF and the ALPHA toggle.
49low battery
50message — Set while a message occupies the display.
51–55system — Alarm, program-running and printer-present status.

Only flags 00–29 can be set and cleared by SF and CF; the rest are read-only status. RCLFLAG and STOFLAG save and restore 00–43 in one number, which is how a subroutine leaves its caller’s flags as it found them.

Function Index

160 entries · grouped as the manual's Function Tables group them · hover for details

System & Format

21
ALPHAtoggle the Alpha keyboard
AON / AOFFAlpha keyboard on / off
USERtoggle the User keyboard
PRGMenter / leave Program mode
ONpower on / off
ONcontinuous on
ASNassign a function to a key
PASNprogrammable ASN
CLKEYSclear all key assignments
CATALOG nlist memory, 1 ≤ n ≤ 6
FIX n / SCI n / ENG ndisplay format
DEG / RAD / GRADangular mode
XEQ SIZE nnnallocate data registers
PSIZEprogrammable SIZE
SIZE?how many registers are allocated
ΣREG nnset the statistics block
SF nn / CF nnset / clear flag nn
RCLFLAG / STOFLAGsave and restore flags 00–43
CLK12 / CLK2412- or 24-hour clock
CLKT / CLKTDclock shows time / time and date
MDY / DMYdate format

Clearing

16
backspace, or clear
CLX0 → X
CLAclear the Alpha register
CLDclear the display message
CLSTclear the stack
CLRGclear all data registers
CLRGXclear a range of registers
CLΣclear the statistics registers
CLP labelclear one program
PCLPS labelclear from a program onward
DEL nnndelete nnn program lines
CLFLclear a file's contents
PURFLpurge a file
CLALMA / CLALMXclear one alarm
CLRALMSclear all alarms
MEMORY LOSTclear everything

Stack & Data Registers

14
ENTER↑X → Y, stack lifts, lift disabled
X<>YX ↔ Y
R↓ / R↑roll the stack down / up
LASTXrecall the previous X
STO nn / RCL nnstore / recall register nn
STO +/−/×/÷ nnregister arithmetic
X<> nnexchange X with register nn
VIEW nndisplay register nn
REGMOVE / REGSWAPblock move / swap registers
ASTO nn / ARCL nnAlpha ↔ register
X<>Fexchange X with flags 00–07
Σ+ / Σ−accumulate / correct statistics
ΣREG nn / ΣREG?where the statistics live
ISG nn / DSE nnincrement / decrement and skip

Numeric

25
+ − × ÷two-number arithmetic
1/Xreciprocal
X↑2 / SQRTsquare / square root
Y↑Xy raised to the x power
LN / LOGnatural and common logarithm
E↑X / 10↑Xnatural and common exponential
LN1+X / E↑X-1logarithm and exponential near zero
SIN / COS / TANtrigonometry
ASIN / ACOS / ATANinverse trigonometry
R-P / P-Rpolar ↔ rectangular
D-R / R-Ddegrees ↔ radians
HMS / HRdecimal hours ↔ H.MMSS
HMS+ / HMS−add and subtract in H.MMSS
ABS / SIGNabsolute value / sign of x
INT / FRCinteger and fractional part
RNDround X to the display format
MODy modulo x
FACTx factorial
%x percent of y
%CHpercent change from y to x
PI3.141592654
DEC / OCToctal ↔ decimal
MEAN / SDEVmean and standard deviation
CHSchange sign
EEXexponent entry

Extended Memory

21
how extended memory works
CRFLD / CRFLAScreate a data or text file
PURFL / CLFLpurge a file / empty a file
RESZFLresize the current file
FLSIZEhow big is this file
EMDIRlist the directory
EMDIRXprogrammable directory lookup
EMROOMfree registers for a new file
ASROOMfree bytes in the current text file
SEEKPT / SEEKPTAset the pointer
RCLPT / RCLPTAread the pointer back
SAVEP / GETPprogram ↔ file
SAVER / GETRall data registers ↔ file
SAVERX / GETRXa range of registers ↔ file
SAVEX / GETXone register ↔ file
SAVEAS / GETASmass storage ↔ extended memory
APPREC / INSREC / DELRECrecord operations on a text file
APPCHR / INSCHR / DELCHRcharacter operations
GETREC / ARCLRECread a record
POSFLsearch the file
EDthe Text Editor

Time, Alarms & Stopwatch

16
the CX's clock
CLOCKdisplay the clock
TIME / DATEcurrent time / date to X
SETIME / SETDATEset the clock
T+Xnudge the clock
CORRECT / SETAF / RCLAFclock accuracy
ADATE / ATIME / ATIME24append date or time to Alpha
DATE+ / DDAYSdate arithmetic
DOWday of week
XYZALMset an alarm
ALMCATlist the alarms
RCLALMread an alarm back
ALMNOWrun the oldest past-due alarm
CLALMA / CLALMX / CLRALMSclear alarms
SW / SWPTthe stopwatch
RUNSW / STOPSW / SETSW / RCLSWstopwatch under program control

Editing

9
how these differ
GTO . nnn / GTO labelgo to a line or label
GTO . .go to the end
SST / BSTsingle step / back step
DEL nnndelete nnn lines
CLP labeldelete a whole program
COPY labelcopy a ROM program into memory
PACKreclaim program bytes
ASNassign to a key

Program Execution

18
LBL nn / LBL ALPHAa label
ENDend of program
XEQ labelcall as a subroutine
GTO labelbranch
RTNreturn
R/Srun / stop
STOPstop
PSEpause about a second
X=0? X≠0? X<0? X>0? X≤0?test X against zero
X=Y? X≠Y? X<Y? X>Y? X≤Y?test X against Y
X=NN? X≠NN? X<NN? X>NN? X≤NN? X≥NN?test X against a register
FS? nn / FC? nntest a flag
FS?C nn / FC?C nntest a flag and clear it
ISG nn / DSE nnloop control
GETSUBoverlay the last program
OFFturn the machine off
AVIEW / PROMPTshow Alpha
XROMcall a plug-in function

Alpha

12
the Alpha register
APPEND (⊢)append rather than replace
ASTO nn / ARCL nnAlpha ↔ register
ASHFshift six characters out
AROTrotate the Alpha register
ALENGhow many characters
ANUMfirst number in Alpha
POSAfind a character
ATOX / XTOAbyte ↔ Alpha
ADATE / ATIME / ATIME24append a date or time
ARCLREC / GETRECappend or read a text record
AVIEW / PROMPT / CLAshow or clear Alpha

Interactive

8
GETKEYwait for a key
GETKEYXwait, with a timeout you choose
TONE nsound tone n
BEEPsound four tones
PSEpause about a second
PROMPTshow Alpha and stop
VIEW nn / AVIEWshow a register or Alpha
ADVadvance the printer paper

Worked Example — how many days until…

eleven lines that ask a question, do real date arithmetic, and answer in words
01 LBL⊦DUEa global label, so XEQ and CATALOG 1 can see it
02 ⊦TARGET? a text line — keying one replaces whatever Alpha held
03 PROMPTshow it and stop, waiting for a date and R/S
04 DATEtoday's date, pushed into X — the target moves up to Y
05 X<>YDDAYS wants the earlier date in Y
06 DDAYSdays between the two dates
07 STO 00keep the answer
08 ⊦DAYS a second text line, so the prompt is written over
09 ARCL 00append the number, formatted as the display shows it
10 AVIEWshow the finished line
11 END

Each box is the display as you would see it, one program line at a time. There are no quotation marks on this machine: an Alpha string is introduced by a raised T and closed by nothing, so a printed listing’s LBL "DUE" reads LBL⊦DUE here (OM1 p. 93). A text line replaces the Alpha register; to add to it instead, begin the string with the append character (OM2 p. 159).

This is a small program, but it is a fair portrait of what the 41 is for. It asks a question in words, does arithmetic no other calculator of its generation could do, and gives the answer back as a sentence. Three of its eleven lines — DATE, DDAYS and ARCL — would not exist on a machine with a seven-segment display.

Entering it. The awkward part of the 41 is that text is typed on the Alpha keyboard while the rest is not, so a listing like this means toggling in and out of ALPHA:

PRGM00 REG nnn — PRGM lights; nnn is how many registers are free GTO . .00 REG nnn — packed, and positioned at the end LBL ALPHA D U E ALPHA01 LBL⊦DUEALPHA T A R G E T ? ALPHA02 ⊦TARGET? XEQ ALPHA P R O M P T ALPHA03 PROMPTPRGM0.0000 — back to Execution mode

That second column is the machine talking back: in Program mode the display is the listing, one line at a time. Notice what it does with the quotation marks — it has none. The 41 introduces an Alpha string with a raised T instead, and closes it with nothing, so what a printed listing writes as LBL "DUE" reads 01 LBL⊦DUE on the machine.

The one subtlety. DDAYS returns a positive number when the date in Y is the earlier of the two. After PROMPT the target is sitting in X; DATE then lifts the stack, pushing the target up to Y and putting today in X — which is the wrong way round, and why line 05 exists.

after PROMPTX = targetwhatever was keyed in and entered with R/S
DATEX = today, Y = targetDATE lifts the stack, so the target moves up
X<>YX = target, Y = todayDDAYS counts from Y to X
DDAYSX = dayspositive when the date in Y is the earlier one

Running it. Dates are plain numbers in the current MDY or DMY format, so 25 December 1986 is 12.251986 with MDY selected:

XEQ ALPHA D U E ALPHATARGET?12.251986 R/SDAYS 107.0000

Making it yours. Assign it to a key with ASN and it becomes part of the keyboard; give it to XYZALM as an alarm message and the calculator will run it by itself, at a time and date you choose, with the machine switched off. That last step is the one that still has no real equivalent on a pocket calculator.

Program entry is OM2 section 18 (p. 280), the date functions section 15 (p. 236), and ARCL formatting section 12 (p. 200). DDAYS counts actual days, so leap years are handled; the clock is valid from 1900 to 2199 (appendix F, p. 374).