Page 1 explains the DB48X dialect of RPL: keyboard, objects, programs, locals, tests, loops, lists, flags, numbers, CAS, solvers, variables, I/O, plotting, units and the differences from HP48/50 RPL. A page on native C/C++ programs (DMCP SDK) follows. Then the index of every command, operator, flag, setting and menu from src/ids.tbl with its aliases, grouped by topic. Hover a row for aliases, HP flag number, stack diagram, description and the menu where it lives. Where the DB48X spelling differs from HP (e.g. Duplicate vs DUP) both are shown; all spellings are accepted on input.
DM42/DM32 keys are described by their letter (A…Z, printed at the lower right of each key). One physical shift key cycles: 🟨 (yellow, first press) → 🟦 (blue, second press) → none. Holding 🟨 ≥½ s toggles Alpha. Long-press any function key or soft key → built-in help.
| Key | Unshifted | 🟨 shift | 🟦 shift |
|---|---|---|---|
| A | ⚙ ToolsMenu (context menu for level 1) | LastMenu (←MENU) | MainMenu (all menus) |
| B / C / D | inv / √ / ^ (pow) | exp / x² / abs | ln / xroot / AlgebraMenu |
| E / F | MathMenu / ' () start expression, or () inside one | PowersMenu / EquationsMenu | PartsMenu / CharactersMenu |
| G / H / I | STO / VAR (ToggleCustomMenu) / STK (StackMenu) | ComplexMenu / MemoryMenu / ConstantsMenu | RealMenu / Library / FractionsMenu |
| J / K / L | sin / cos / tan | asin / acos / atan | HyperbolicMenu / CircularMenu / AnglesMenu |
| ENTER | ENTER (evaluate command line / DUP) | ALPHA (cycles ABC → abc → off) | TEXT: insert "" |
| M / N / O | Swap (x⇆y) / neg (+/−) / Cycle (×10ⁿ, EEX while typing) | LastArg / ModesMenu / DisplayModesMenu | Undo / UserInterfaceModesMenu / PlotMenu |
| ← (backspace) | Drop when not editing | ClearThingsMenu | UpDir |
| ▲ (◀) / ▼ (▶) | Interactive stack / Edit level 1; cursor left/right while editing | Command-line history / EditMenu | same |
| P Q R S (7 8 9 ÷) | digits, ÷ | SolverMenu IntegrationMenu [ ] StatisticsMenu | SymbolicMenu PolynomialsMenu MatrixMenu TVM (FinanceSolverMenu) |
| T U V W (4 5 6 ×) | digits, × | BasesMenu UnitsMenu FlagsMenu ProbabilitiesMenu | TextMenu UnitsConversionsMenu TimeMenu NumbersMenu |
| X Y Z _ (1 2 3 −) | digits, − | →Num USER (ToggleUserMode) ProgramMenu ListMenu | DebugMenu LoopsMenu TestsMenu ObjectMenu |
| EXIT | cancel / interrupt program (Attn) | OFF (OffWithImage) | SAVE state (SaveState) |
| 0 . R/S + | 0 . — R/S = space / = in expr / Run — + | SETUP (SystemSetup) Show « » CAT (Catalog) | FilesMenu GraphicsMenu { } HELP |
+ in alpha (or 🟨 +) opens the Catalog: auto-completion of any command containing the typed letters; inside text it offers accents/variants of the last character, else the CharactersMenu.ThreeRowsMenus/SingleRowMenus/FlatMenus.Dup; ← on empty line = Drop; typing a number then an operator key applies it (RPN).Each key: 🟨 first-shift function, 🟦 second-shift function, then the unshifted binding with the alpha letter at right; last line = original DM42 label and the shifted alpha characters (α = 🟨/🟦 in alpha mode). ≡ marks a menu. Soft keys F1–F6 above row 1 are menu keys. In alpha mode the digit keys type letters; 🟨 restores digits.
| Type | Syntax / examples | Notes |
|---|---|---|
| Integer ℤ | 123 -45 100! | exact, arbitrary size (MaxNumberBits); TypeName → "integer"/"bignum" |
| Fraction ℚ | 2/3 (or 2 3 /), 1 ¹/₂ mixed | first-class exact type; MixedFractions/ImproperFractions; →Q →Qπ →Num |
| Decimal | 123. 1.5E-3 0.5 (FancyExponent shows the exponent as a superscript) | variable precision (Precision, default 24 digits); HardwareFloatingPoint → hwfloat/hwdouble |
| Based (binary) | #1Ah #101b #77o #42d 16#1A 2#1010 | any base 2–36 with base#; WordSize truncation; Base command |
| Complex | 2+3ⅈ 1∡90° (2;3) (1∡90) | rectangular or polar kept as entered; Cycle (EEX key) toggles; angle unit stored |
| Range / interval | 2…4 3±1 2±50% 4±σ3 (uncertain) | arithmetic propagates bounds / uncertainty; →Range →∆Range →%Range →σRange |
| Text | "Hello" (🟦 ENTER) | UTF-8, + concatenates, × n repeats, Size = code points, Bytes = bytes |
| Symbol / name | 'X' in stack syntax; X evaluates | case-insensitive by default (DistinguishSymbolCase); ⓋName forces variable (not constant/command) |
| Expression | '2+X*sin(Y)' 'X²+1' | always an expression object even for '5' or 'N' (unlike HP) |
| Equation | 'A+B=C' | expression containing =; solver / plot input; = also tests numeric equality |
| Assignment | X=6 R=20 (command line, outside quotes) | stores 6 in X and pushes the assignment; DB48X extension used by the equation library |
| Polynomial | Ⓟx²+2·x+1 (→Polynomial) | dedicated multivariate polynomial type; Polynomial→ back to expression |
| List | { 1 'A' "Hi" { 2 3 } } (🟦 R/S) | a bag: + appends/concatenates, × repeats; not evaluated as program (ListAsProgram) |
| Vector / matrix | [1 2 3] [[1 2][3 4]] (🟨 R) | any object types, N dimensions; arithmetic element-wise; matrix product with × |
| Program | « 1 + » (🟨 R/S) | runs with Eval/Run (R/S key); →Program from list/expression |
| Unit object | 1_km/s shown 1 km/s; 3_m^2 1_kiB | _ after a value; SI prefixes incl. Q R Y Z z y r q, binary Ki Mi Gi |
| Tagged | :X:3 shows X:3; "X" 3 →Tag | tags stripped by arithmetic; Tag→ DeleteTag |
| Constant | Ⓒπ Ⓒc ⒸG (also bare π, c if no variable) | symbolic until →Num; ⓈX std uncertainty, ⓇX relative; from config/constants.csv |
| Library equation / item | ⒺName (equations.csv), ⓁName (library.csv) | EquationsMenu (🟨 F), Library (🟦 H); Attach/Detach/Libs |
| Directory | { Sub Var } paths in STO/RCL, CrDir | variables searched up through parents; Home UpDir Path |
| Graphics | grob / bitmap / pixmap (→Grob, →Bitmap, Blank…) | Show, Pict, GOr/GAnd/GXor; CompatibleGROBs |
| Boolean | True False | tests return these; any non-zero number is also true |
| Menu, font, keymap | returned by RecallMenu; KeyMap directory | special objects |
Comments: @ text to end of line is kept in the program; @@ text is stripped when loading. Numbers: E (or ×10ⁿ key) enters an exponent; digit separators shown per MantissaSpacing (thin spaces by default) — never type them.
| Object in program | Action |
|---|---|
| Command / function | executed |
| Number, text, list, array, program, quoted name/expression | put on the stack |
| Unquoted global or local name | evaluated: program → run; directory → becomes current; other → put on stack. Locals evaluate too (differs from HP: no EVAL needed for a program in a local) |
Ⓒname constant, Ⓔ/Ⓛ library ref | pushed symbolic (constant) / evaluated (library program) |
→ a b c takes values from the stack in command-line order: 10 6 20 → a b c gives a=10, b=6, c=20 (c = level 1).←x) — pass values or use user-defined functions instead. Quote(x) prevents evaluation of an argument in an expression.'a' STO; recall without evaluation with 'a' RCL.Run) or Eval · 'NAME' EVAL.DebugOnError, an error halts in the debugger (Step / Continue) instead of killing (KillOnError).Halt inserts a breakpoint; Debug starts a program stepping (SingleStep, StepOver, StepOut, MultipleSteps, Continue, Kill). Header shows ♦ halted, › stepping.TimedEval runs an object and returns elapsed time; RunStats/GCStats for profiling..48s files hold source (state files in STATE/), .48b binary, .txt text, .csv lists/arrays. "name.48s" STO/RCL read/write disk; "config:units.csv" RCL edits configuration.'X<5' stays symbolic until evaluated
IF 'X' 5 > THEN "OK" ENDsymbolic tests auto-evaluate in IF/WHILE/UNTIL/CASE
'0=0.0' EVAL → True '0==0.0' EVAL → False= value equality, == representation equality (on the command line X=6 is an assignment)
'A' 'B' SAME → Falsesame = object identity, does not evaluate names
| Test | Meaning |
|---|---|
= ≠ | numeric/value (in)equality; inside '…' also builds an equation for the solver |
== | same type and representation (1==1. is False) |
< ≤ > ≥ | order; text/lists/arrays compare lexicographically; symbolic if a name is involved |
same | identical objects (names not evaluated) |
and or xor not | truth logic; bitwise on integers/based numbers (42 4 AND → 0). TruthLogicForIntegers restores HP behaviour |
nand nor implies equiv excludes | DB48X extensions (also bitwise on integers) |
FS? FC? FS?C FC?C FS?S FC?S | flag tests (user flag n or setting name) |
Type / TypeName | HP-compatible number (CompatibleTypes) or negative detailed (DetailedTypes) / text like "integer", "expression" |
Truth: True/False objects; any non-zero number is true, 0 is false. Infix and/or/xor and prefix not work in algebraics: '3<5 XOR 4>7'.
value WHEN = DUP value = THEN (DB48X); the value stays on the stack
X CASE DUP 0 < THEN "N" END DUP 0 > THEN "P" END "Z" ENDdefault clause before the final END (in 0.9.20 a default after WHEN clauses also runs — use THEN clauses with a default)
IFERR clause THEN trap [ELSE ok] ENDerror trap; errm errn give the error, err0 clears, doerr raises
TestsMenu (🟦 3) inserts the structures with the cursor placed inside; F-keys IfThen, IfElse, Case, IFT, IFTE. LoopsMenu (🟦 2) does the same for loops.
STO into i
start stop FOR i body incr STEP
{ 1 3 5 } FOR i body NEXTDB48X: iterate a list or array (i = element); START also accepts a list
DO body UNTIL test ENDruns at least once
WHILE test REPEAT body ENDtest first
1 10 FOR i i SQ NEXT 10 →Listcollect results into a list
{ 1 2 3 } « 2 * » MAPfunctional alternatives: Map Filter Reduce DoList DoSubs
Loops always execute the FOR/START body at least once (10 1 FOR i … NEXT runs once, like HP). ListRecursionDepth (default 1) controls how deep Map and friends recurse into nested lists (0 = HP50G unlimited).
| Operation | List { } (bag) | Array [ ] (values) |
|---|---|---|
+ | append / concatenate: {1 2} 3 + → {1 2 3} | element-wise add or vector/matrix add: [1 2] 3 + → [4 5] |
× | repeat: {1 2} 2 × → {1 2 1 2} | scale, element-wise or matrix product; A B ÷ = A·B⁻¹ |
functions (sin, inv…) | applied to every element | applied to every element (abs too; norm for Euclidean norm) |
n GET, {i j} GET | n-th element; nested index path | row […] for a matrix with a single index (unlike HP); {r c} element |
Min Max | whole-list lexicographic comparison | element-wise |
| comparisons | lexicographic | lexicographic |
Size | number of elements (1 for numbers, expressions, units) | dimension list, e.g. {2 3} |
Sort QuickSort Unique Reverse… | sort (Quick… = unstable, faster); Unique drops consecutive duplicates | same |
Explode/Obj→ splits with count
1 2 3 3 →LIST → { 1 2 3 } 1 2 3 3 →ARRY → [1 2 3]
{1 2 3} « 3 * » MAP {4 5} { 6 7 } 2 « + » DOLIST
{1 2 3 4} « + » REDUCE → 10 {…} « 2 mod » FILTERReduce = Stream
{1 2 3} ΣList ∏List ∆Listsum, product, successive differences
{ 1 2 3 } { 2 } 9 PUT « » →Programlists to programs with →Program
Tags are stripped by list arithmetic; quoted names inside lists stay quoted. Arrays may be ragged or mixed-type until an operation needs a shape.
MaxFlags (128)
'MixedFractions' SF 'HideDate' CFsystem flags by name (any FLAG pair)
-2 SF -22 FS?HP-compatible negative numbers (table below)
12 Precision 'Precision' RCL 16 'Base' STOsettings are commands and special variables
Modes → M … ResetModes M EVALsave/restore all settings; RclF/StoF for the flag word
'DisplayMode' RCL → Fixread enum settings
| HP flag | DB48X name when set | HP flag | DB48X name when set |
|---|---|---|---|
| −1 | PrincipalSolution | −52 | MultiLineResult |
| −2 | NumericalConstants | −55 | NoLastArguments |
| −3 | NumericalResults | −56 | BeepOff |
| −4 | CarefulEvaluation | −61 | UserModeLock |
| −14 | TVMPayAtBeginningOfPeriod | −62 | UserMode |
| −20 / −21 | UnderflowError / OverflowError | −64 | IndexWrapped |
| −22 | InfinityValue | −65 | MultiLineStack |
| −23 −24 −25 −26 | underflow−/underflow+/overflow/infinite indicators | −97 / −98 | VerticalLists / VerticalVectors |
| −29 / −31 | NoPlotAxes / NoCurveFilling | −100 | FinalAlgebraResults |
| −40 / −41 / −42 | ShowTime / Time24H / DayBeforeMonth | −103 | ComplexResults |
| −51 | DecimalComma | −126 | EchelonFormKeepLastColumn |
Every FLAG in the index lists its opposite; the default state is the one marked ● in the Settings cards. FlagsMenu (🟨 6), ModesMenu (🟨 N), DisplayModesMenu (🟨 O).
1 integer ≠ 1. decimal; integers/fractions are exact and usually faster than decimals. 2 3 / → 2/3; →Num (🟨 1) converts; NumericalResults forces decimals.Precision (3…up to thousands of digits, default 24) drives all decimal math; the number of digits typed in a literal is kept as-is. HardwareFloatingPoint uses IEEE binary float for Precision ≤ 16 (fast, inexact for 0.2).Std (all digits), n Fix, n Sci, n Eng, n Sig (significant digits, e.g. 12 SIG ≈ HP48 STD). StandardExponent (default 9) sets when Std switches to scientific. MinimumSignificantDigits controls Fix→Sci fallback.DecimalDot/DecimalComma; MantissaSpacing (3), FractionSpacing (5), BasedSpacing (4); NumberSpaces/NumberDotOrComma/NumberTicks/NumberUnderscore; LeadingZero (0.5 vs .5); FancyExponent (superscript vs E).OverflowValue, UnderflowValue, InfinityValue, UndefinedValue (indicator flags −23…−26 record events).#… uses the current Base (Bin/Oct/Dec/Hex or 36 Base); 16#1A fixes a base; results wrap to WordSize bits (default 64; up to 256 kbits); RealToBinary/BinaryToReal (R→B B→R).Cycle (EEX/×10ⁿ key on a stack object): decimal ↔ fraction, rect ↔ polar, integer ↔ based (2/8/10/16), array ↔ list ↔ program, text ↔ symbol, unit ↔ SI prefixes, range formats.Deg Rad Grad PiRadians; angle-typed values 30_°, 1_r, 2_πr; →Deg/→Rad/… convert; SetAngleUnits makes trig-inverse results carry the unit.Random (RAND), RandomSeed (RDZ), a b Random in a range; ACORN generator (RandomGeneratorBits/Order).→Num forces numeric
'X+1' 3 × → '(X+1)·3'build expressions from RPN keystrokes
'Σ(i;1;10;i^2)' 'i' 1 10 'i^2' Σ; separates ALL arguments (no i=1); same for ∏
'∫(0;1;X^2;X)' 0 1 'X^2' 'X' ∫symbolic when possible, else numeric (SymbolicIntegration)
'∂X(sin(2*X))' → '2·cos(2·X)' 'sin(2*X)' 'X' ∂full differentiation in both syntaxes; F′, F′₁ for user fns
'A+B|A=X|B=Y+Z|Z=42' → 'X+Y+42'| where: chained substitutions, applied left to right
'X^2-2' 'X' ISOL 'X^2-2' 'X' ZEROSisolate a variable / list of zeros
'A+B+0' { 'X+0' 'X' } ↓MATCH → 'A+B' 1rewrite rules; returns count of rewrites
'(A+B)^3' { 'X^k' 'X*X^(k-1)' } ↓MATCH → '(A+B)·(A+B)↑2' 1wildcards = any name (&A = literal A unless ExplicitWildcards); k = non-zero integer
'A+B+C' { 'X+Y' 'Y-X' } ↓MATCH → 'C-(B-A)' 2rules repeat until stable (FinalAlgebraResults)
'X^2+2*X+1' →POLY PROOT PCOEF PEVALpolynomial type; [a b c] coefficient vectors
'A^2+2*A*B' EXPAND COLLECT SIMPLIFYFoldConstants, ReorderTerms, TrigSin, Apply, Subst, Quote
| Rule wildcard initial | Matches |
|---|---|
a b c | numerical constants |
i j | positive integers incl. 0 (may be computed) |
k l m | non-zero positive integers |
n o p | symbols / names |
u v w | unique terms (matched once) |
| lowercase initial | operands must be sorted (x+y matches A+B not B+A) |
Settings: AutoSimplify (X+0→X), SymbolicResults/NumericalResults (−3), SymbolicConstants/NumericalConstants (−2), FinalAlgebraResults (repeat rules until stable) vs StepByStepAlgebraResults, MaxRewrites, ComplexResults (−103), PrincipalSolution (−1). Ⓓ = CAS config directory, ⓧ/Stoⓧ = CAS variable (default X). Precedence follows normal math; ↑ and ^ are power, ·/× product, = lowest.
{lo hi}
{ 'sin(x)=y' '7*y^3=2' } { x y } { 0 0 } ROOTmultiple equations solved one at a time (MES)
[ 'X^2+Y^2=1' '(X-1)^2+Y^2=1' ] [X Y] [0 0] ROOTJacobian solver when equations are coupled
'(X-5)²+3' 'X' 0+0ⅈ ROOTcomplex guess → complex root
'x^2+1' STEQ SolvingMenuinteractive solver: F-key stores, 🟨 solves, 🟦 recalls; Equation may be a list (NextEq)
'X^3-X^2-8*X+12' 'X' ZEROS → { -3 2 }exact/symbolic zeros when possible
0 1 'X^2' 'X' ∫ → 1/3 2 22 '1/X' 'X' ∫symbolic if SymbolicIntegration, else numeric to IntegrationImprecision
TVM (🟦 S): n I%Yr PV PMT FV PYr — 🟨 key solvesTVMRoot, Amort, AmortTable, TVMEquation, TVMBeg/TVMEnd (flag −14), FinanceRounding
Root returns an assignment x=value and also stores the variable; if no root is found it errors (HP silently returns an extremum) but leaves the closest value in the variable. SolverImprecision (6) digits are given up relative to Precision; SolverIterations, SolverShuffles tune the search; SymbolicSolver lets Root try Isolate first. Library equations (EquationsMenu, 🟨 F) come with variables and units; use assignments α=20 β=30 then '…' STEQ SolvingMenu.
X=6 also stores
42 { SubDir FortyTwo } STOpath through directories (list or array); may start with Home
1 'A' STO+ 'A' INCR 'A' RCL+ 5 'A' ▶ (Copy)Sto+ Sto− Sto× Sto÷ Rcl± Increment Decrement; ▶ stores and keeps value
{ A B } PURGE 'X' PGALL 'D' PGDIRpurge here / in all enclosing dirs / directory with contents
{ Tools Examples } CRDIR UPDIR HOME PATHdirectories; recall searches parents, store is local
VARS { 8 } TVARS { A B } ORDERlist / typed list / reorder VAR menu
1 "FOO.TXT" STO "prog.48s" RCL "data.csv" STOtext name = file on flash (DATA/…); .48s source, .48b binary, .csv, .txt
"config:units.csv" RCL … STOedit configuration files (units, constants, equations, library, characters)
ⓋClone escapes). NumberedVariables allows integer names.CustomMenu (variable CustomMenu = list of { "label" obj }).Sto into a setting name changes the setting; text names hit the file system; the Header and KeyMap variables customize the display and keyboard.Mem (AvailableMemory), FreeMemory, Bytes, GC, Clone. Objects are compact (small ints 2 bytes, common commands 1 byte).Show (🟨 .) full-screen render
440 0.5 BEEP obj "label" →TAG
« TIME " " PATH →TEXT + » HEADER 10000 CustomHeaderRefreshcustom header program (variable Header)
{ { "1+" « 1 + » } { "10+" « 10 + » } } MENUcustom menu (also TMENU temporary); matrix = vertical items; RCLMENU, 0 MENU = LastMenu
'ASN' 34 ASN 'StandardKey' 34 ASNuser key: object, position rc.ph (row col . plane hold); planes 1 none 2🟨 3🟦 4 α 5 α🟨 6 α🟦 7 a 8 a🟨 9 a🟦
{ "α" 21.5 "β" 22.5 } STOKEYS RCLKEYS 0 DELKEYSstored in KeyMap directory per directory (hierarchical); USER = 🟨 2, UserModeLock/UserModeOnce
Help (🟦 +) shows help for a topic text on level 1 or the type of the object; long-press any key for its help. Catalog auto-completes; ToolsMenu (A) picks a menu for the object in level 1 (e.g. DebugMenu for programs, ComplexMenu for complex).
PolarPlot (r=f(x)), ParametricPlot (complex result), TruthPlot (x,y → bool/gray/color), ScatterPlot BarPlot HistogramPlot (ΣData)
'EQ' … DRAW DRAXplot the Equation variable, draw axes
(-10;-6) PMIN (10;6) PMAX -1.5 1.5 XRNG -2 2 YRNGPlotParameters (PPAR): {ll ur indep res axes type dep}; 'PPAR' PGALL resets
'T' INDEP { 'T' 0 6.28 } INDEP 'U' DEPND #400 RES
(0;0) 1 CIRCLE { #10 #20 } { #100 #50 } LINE RECT RRECT ELLIPSEcoords: complex, {x y} list/vector; based #n = pixels (0..399 × 0..239), else user units
#10 #10 PIXON PIXOFF PIX? PIXC? { #0 #0 } { #399 #239 } CLIP
50 50 BlankGraphic { #0 #0 } { #49 #49 } RECTgrob/bitmap/pixmap objects; →Grob renders any object (Show)
g1 g2 GOR / GAND / GXOR PICT LCD→ →LCD ScreenCapturecombine, screen grob
0.5 GRAY 0 1 0 RGB 120 1 1 HSV "red" COLOR 3 LineWidthdrawing patterns/colors (grayscale on DM42, color on DM42n)
Freeze keeps the graphic; the stack/menu resume at the next key. NoPlotAxes, NoCurveFilling, XYPlotBins, StatsPlotBins, GraphingTimeLimit, PlotRefreshRate tune plotting. GraphicAppend/Stack/Ratio/Root/… typeset formulas as graphics.
6_m [🟦 s] → 6 m/s; Cycle steps SI prefixes
Ⓒc → 299 792 458 m/s 'c' CONST 'c' CstSU →Us →Urconstants: value, std uncertainty (ⓈX), relative (ⓇX), StdRnd RelRnd PrcRnd
Ⓔ"Simple Shear" LIBEQ ⓁDedicace XLIBlibrary equations / items; Attach Detach Libs Constants
| Unit menus | At a glance |
|---|---|
| Length · Area · Volume | m ft in mi nmi au lyr · m² ha acre b · m³ l gal qt pt floz galUK bbl |
| Time · Speed · Mass | s min h d yr Hz rpm · m/s km/h mph knot c · kg lb oz t ct u Da |
| Force · Energy · Power | N dyn kip lbf pdl · J erg cal Btu eV therm · W hp |
| Fluids · Electricity · Angle | K °C °F Pa atm bar psi torr · A V C Ω F H S T Wb · ° grad r πr sr |
| Light · Radiation · Computing | cd lm lx fc nit sb · Gy rad rem Sv Bq Ci R · bit byte KiB MB bps baud flops dB |
| Constants menus | Mathematics (π e ⅈ ∞ ? τ …) · Chemistry · Physics · Electromagnetism · Quantum · Mass · Size · Scattering · Astronomy (planets, Sun) · Materials · Computing · Dates |
DB48X ships 272 unit definitions across 13 menus — the complete table below, read straight from src/unit.cc. A definition of = base unit means the unit is its own base — the SI unit for that menu, or one the firmware derives directly from it. Everything else shows the exact conversion the firmware uses; note these are exact fractions, not decimals, so 1_ft is 3048/10000_m and round-trips without error.
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| Human scale | m | 1 m | meter, based for SI lengths |
| Human scale | yd | 9144/10000 m | yard |
| Human scale | ft | 3048/10000 m | foot |
| Human scale | ftUS | 1200/3937 m | US survey foot |
| Human scale | US | 1 ftUS/ft | Conversion factor |
| Small stuff | cm | = base unit | Centimeter |
| Small stuff | mm | = base unit | Millimeter |
| Small stuff | in | 254/10000 m | inch |
| Small stuff | mil | 254/10000000 m | A thousands of a inch (min is taken) |
| Small stuff | μ | 1 μm | A micron can be written as μ |
| Short travel distance | km | = base unit | Kilometer |
| Short travel distance | mi | 5280 ft | Mile |
| Short travel distance | nmi | 1852 m | Nautical mile |
| Short travel distance | miUS | 1 mi*US | Mile (US Survey) |
| Short travel distance | fur | 660 ft | Furlong |
| US Survey | ch | 66 ft | Chain |
| US Survey | rd | 1/4 ch | Rod, pole, perch |
| US Survey | cable | 720 ft | Cable's length (US navy) |
| US Survey | fath | 6 ft | Fathom |
| US Survey | league | 3 mi | League |
| Astronomy | Mpc | = base unit | Megaparsec |
| Astronomy | pc | 30856775814913673 m | Parsec |
| Astronomy | au | 149597870700 m | Astronomical unit |
| Astronomy | lyr | 31557600 ls | Light year |
| Astronomy | ls | 299792458 m | Light-second |
| US Survey, convert between pre-2023 and post-2023 | mi | = base unit | New mile |
| US Survey, convert between pre-2023 and post-2023 | miUS | = base unit | Old mile |
| US Survey, convert between pre-2023 and post-2023 | ft | = base unit | New foot |
| US Survey, convert between pre-2023 and post-2023 | ftUS | = base unit | Old foot |
| US Survey, convert between pre-2023 and post-2023 | US | = base unit | Conversion factor |
| Nautical | nmi | = base unit | Nautical mile |
| Nautical | cable | = base unit | Cable length |
| Nautical | li | 1/100 ch | Link |
| Nautical | acable | 18532/100 m | Cable's length (Imperial/Admiralty) |
| Nautical | icable | 1852/10 m | Cable's length ("International") |
| Microscopic | Å | 100 pm | Angstroem is 100pm, 1E-10m |
| Microscopic | fermi | 1 fm | fermi is another name for femtometer |
| Microscopic | μm | = base unit | Micron |
| Microscopic | nm | = base unit | Nanometer |
| Long-name aliases | chain | 1 ch | Chain |
| Long-name aliases | fathom | 1 fath | Fathom |
| Long-name aliases | furlong | 1 fur | Furlong |
| Long-name aliases | link | 1 li | Link |
| Long-name aliases | rod | 1 rd | Alternate spelling |
| Long-name aliases | pole | 1 rd | Pole |
| Long-name aliases | perch | 1 rd | Perch |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| Human scale | m² | = base unit | Square meter |
| Human scale | yd² | = base unit | Square yard |
| Human scale | ft² | = base unit | Square foot |
| Human scale | in² | = base unit | Square inch |
| Human scale | cm² | = base unit | Square centimeter |
| Surveying | km² | = base unit | Square kilometer |
| Surveying | mi² | = base unit | Square mile |
| Surveying | ha | = base unit | Hectare |
| Surveying | a | 100 m² | Are |
| Surveying | acre | 1 ac | Acre |
| US-Survey conversion | ac | 10 ch² | Acre |
| US-Survey conversion | acUS | 10 ch²*US² | Acre (pre-2023) |
| US-Survey conversion | mi² | = base unit | Square mile |
| US-Survey conversion | miUS² | = base unit | Square mile (pre-2023) |
| US-Survey conversion | US² | = base unit | Conversion factor |
| Microscopic stuff and aliases | b | 100 fermi² | Barn, 1E-28 m^2 |
| Microscopic stuff and aliases | barn | 1 b | Barn, 1E-28 m^2 |
| Microscopic stuff and aliases | mm² | = base unit | Square millimeter |
| Microscopic stuff and aliases | μm² | = base unit | Square micron |
| Microscopic stuff and aliases | nm² | = base unit | Square nanometer |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| Usual | m³ | = base unit | Cubic meter |
| Usual | l | 1 dm³ | Liter |
| Usual | gal | 231 in³ | Gallon |
| Usual | cm³ | = base unit | Cubic centimeter |
| Usual | mm³ | = base unit | Cubic millimeter |
| Imperial units | gal | = base unit | Gallon |
| Imperial units | qt | 1/4 gal | Quart |
| Imperial units | pt | 1/8 gal | Pint |
| Imperial units | cup | 1/16 gal | Cup |
| Imperial units | floz | 1/32 qt | Fluid ounce |
| Human scale | m³ | = base unit | Cubic meter |
| Human scale | yd³ | = base unit | Cubic yard |
| Human scale | ft³ | = base unit | Cubic foot |
| Human scale | in³ | = base unit | Cubic inch |
| Human scale | cm³ | = base unit | Cubic centimeter |
| More imperial units | gill | 1/32 gal | Gill |
| More imperial units | drqt | 67200625/1000000 in³ | US dry quart |
| More imperial units | drgal | 4 drqt | US dry gallon |
| More imperial units | bu | 32 drqt | US dry bushel |
| More imperial units | pk | 8 drqt | US dry peck |
| Other gallons, just because | galC | 4546090 mm³ | Canadian gallon |
| Other gallons, just because | galUK | 4546092 mm³ | UK gallon |
| Other gallons, just because | ptUK | 1/2 galUK | UK pint |
| Other gallons, just because | ozUK | 1/40 galUK | UK fluid ounce |
| Other gallons, just because | fbm | 1 ft²*in | Board foot |
| Other funny volume units | tbsp | 4 oz | Tablespoon |
| Other funny volume units | tsp | 1/3 tbsp | Teasppon |
| Other funny volume units | st | 1 m³ | Stere (wood volume) |
| Other funny volume units | bbl | 7056 in³ | Barrel |
| Other funny volume units | crbl | 5826 in³ | Cranberry barrel |
| Other funny volume units | L | l | Liter can be spelled uppercase |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| Basic time units | s | 1 s | Second |
| Basic time units | min | 60 s | Minute |
| Basic time units | h | 3600 s | Hour |
| Basic time units | d | 86400 s | Day |
| Basic time units | yr | 36524219/100000 d | Mean tropical year |
| Frequencies | Hz | 1 s⁻¹ | Hertz |
| Frequencies | kHz | = base unit | Kilohertz |
| Frequencies | MHz | = base unit | Megahertz |
| Frequencies | GHz | = base unit | Gigahertz |
| Frequencies | rpm | 1 turn/min | Rotations per minute |
| Alias names for common time units | year | 1 yr | Year |
| Alias names for common time units | day | 1 d | Day |
| Alias names for common time units | hour | 1 h | Hour |
| Alias names for common time units | minute | 1 min | Minute |
| Alias names for common time units | second | 1 s | Second |
| Alias names for common time units | hms | 1 h | Hour/minutes/seconds to hours |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| Standard speed | m/s | = base unit | Meter per second |
| Standard speed | km/h | = base unit | Kilometer per hour |
| Standard speed | ft/s | = base unit | Feet per second |
| Standard speed | mph | 1 mi/h | Miles per hour |
| Standard speed | knot | 1 nmi/h | 1 knot is 1 nautical mile per hour |
| Physics | c | 299792458 m/s | Speed of light |
| Physics | ga | 980665/100000 m/s^2 | Standard freefall acceleration |
| Physics | G | 1 ga | Alternate spelling (1_G) |
| Physics | kph | 1 km/h | US common spelling for km/h |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| Metric units | kg | 1 kg | Kilogram (SI base unit) |
| Metric units | g | 1/1000 kg | Gram |
| Metric units | t | 1000 kg | Metric ton |
| Metric units | ct | 200 mg | Carat |
| Metric units | mol | 1 mol | Mole (quantity of matter) |
| Imperial units | lb | 45359237/100000 g | Avoirdupois pound |
| Imperial units | oz | 1/16 lb | Ounce |
| Imperial units | dr | 1/256 lb | Drachm |
| Imperial units | stone | 14 lb | Stone |
| Imperial units | grain | 1/7000 lb | Grain (sometimes "gr") |
| UK/US conversions | qrUK | 28 lb | Quarter (UK) |
| UK/US conversions | qrUS | 25 lb | Quarter (US) |
| UK/US conversions | cwtUK | 112 lb | Long hundredweight (UK) |
| UK/US conversions | cwtUS | 100 lb | Short hundredweight (US) |
| UK/US conversions | gr | 1 grain | Grain |
| UK/US conversions | tonUK | 20 cwtUK | Long ton |
| UK/US conversions | tonUS | 20 cwtUS | Short ton |
| UK/US conversions | ton | 1 tonUS | Short ton |
| UK/US conversions | slug | 1 lbf*s^2/ft | Slug (what?) |
| UK/US conversions | blob | 12 slug | Blob (seriously????) |
| Troy weight system | dwt | 24 grain | Pennyweight (Troy weight system) |
| Troy weight system | ozt | 20 dwt | Troy ounce |
| Troy weight system | lbt | 12 ozt | Troy pound |
| Troy weight system | dram | 1 dr | Alternate spelling |
| Troy weight system | drachm | 1 dr | Alternate spelling |
| Alternate spellings | mole | 1 mol | Mole (quantity of matter) |
| Alternate spellings | carat | 1 ct | Carat |
| Alternate spellings | u | 1.66053906892E-27 kg | Unified atomic mass |
| Alternate spellings | Da | 1.66053906892E-27 kg | Dalton (Alternative spelling for u) |
| Alternate spellings | Avogadro | 6.02214076E23 | Avogadro constant (# units in 1_mol) |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| — | N | 1 kg*m/s^2 | Newton |
| — | dyn | 1/100000 N | Dyne |
| — | kip | 1000 lbf | Kilopound-force |
| — | lbf | 44482216152605/10000000000000 N | Pound-force |
| — | gf | 980665/100000000 N | Gram-force |
| — | pdl | 138254954376/1000000000000 N | Poundal |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| — | J | 1 kg*m^2/s^2 | Joule |
| — | erg | 1/10000000 J | erg |
| — | Kcal | = base unit | Large calorie |
| — | cal | 41868/10000 J | International calorie (1929, 1956) |
| — | Btu | 1055.05585262 J | British thermal unit |
| — | calth | 4184/1000 J | Thermochemical Calorie |
| — | cal4 | 4204/1000 J | 4°C calorie |
| — | cal15 | 41855/10000 J | 15°C calorie |
| — | cal20 | 4182/1000 J | 20°C calorie |
| — | calmean | 4190/1000 J | 4°C calorie |
| — | therm | 105506000 J | EEC therm |
| — | eV | 1.60217733E-19 J | electron-Volt |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| — | W | 1 J/s | Watt |
| — | kW | = base unit | Kilowatt |
| — | MW | = base unit | Megawatt |
| — | GW | = base unit | Gigawatt |
| — | hp | 745.699871582 W | Horsepower |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| — | K | 1 K | Kelvin |
| — | °C | '(°C+273.15)' K | Celsius |
| — | °R | 5/9 K | Rankin |
| — | °F | '((°F+459.67)*5/9)' K | Fahrenheit |
| — | °D | '(373.15-2/3*°D)' K | Delisle |
| — | Pa | 1 N/m^2 | Pascal |
| — | atm | 101325 Pa | Atmosphere |
| — | bar | 100000 Pa | bar |
| — | psi | 6894.75729317 Pa | Pound per square inch |
| — | ksi | 1000 psi | Kilopound per square inch |
| — | kPa | = base unit | Kilopascal |
| — | mmHg | 1 torr | millimeter of mercury |
| — | inHg | 1 in/mm*mmHg | inch of mercury |
| — | inH2O | 249.0889 Pa | Inch of H2O |
| — | torr | 1/760 atm | Torr = 1/760 standard atm |
| — | m³/yr | = base unit | Cubic meters per year |
| — | m³/d | = base unit | Cubic meters per day |
| — | m³/h | = base unit | Cubic meters per hour |
| — | l/min | = base unit | liters per minute |
| — | l/s | = base unit | liters per second |
| — | cm³/s | = base unit | Cubic centimeters per second |
| — | gal/yr | = base unit | Gallons per year |
| — | gal/d | = base unit | Gallons per day |
| — | gal/min | = base unit | Gallons per minute |
| — | gal/s | = base unit | Gallons per second |
| — | P | 1/10 Pa*s | Poise |
| — | St | 1 cm^2/s | Stokes |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| — | A | 1 A | Ampere |
| — | V | 1 kg*m^2/(A*s^3) | Volt |
| — | C | 1 A*s | Coulomb |
| — | Ω | 1 V/A | Ohm |
| — | F | 1 C/V | Farad |
| — | Fdy | 96487 A*s | Faraday |
| — | H | 1 ohm*s | Henry |
| — | S | 1 A/V | Siemens |
| — | T | 1 V*s/m^2 | Tesla |
| — | Wb | 1 V*s | Weber |
| — | mho | 1 S | Ohm spelled backwards |
| — | ohm | 1 Ω | Ohm |
| — | Ω | 1 Ω | Robustness: Unicode u8486 vs u937 |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| — | turn | 1 turn | Full turns |
| — | ° | 1/360 turn | Degree |
| — | grad | 1/400 turn | Grad |
| — | r | '0.5/Ⓒπ' turn | Radian |
| — | πr | 1/2 turn | Pi radians |
| — | dms | 1 ° | Degrees shown as DMS |
| — | arcmin | 1/60 ° | Arc minute |
| — | arcs | 1/60 arcmin | Arc second |
| — | sr | 1 sr | Steradian |
| — | pir | 1/2 turn | Pi radians |
| Group | Unit | Definition | Meaning |
|---|---|---|---|
| — | cd | 1 cd | Candela |
| — | lm | 1 cd*sr | Lumen |
| — | lx | 1 lm/m^2 | Lux |
| — | fc | 1 lm/ft^2 | Footcandle |
| — | flam | 1 cd/ft^2*r/pir | Foot-Lambert |
| — | ph | 10000 lx | Phot |
| — | sb | 10000 cd/m^2 | Stilb |
| — | lam | 1 cd/cm^2*r/pir | Lambert |
| — | nit | 1 cd/m^2 | Nit |
| — | nt | 1 cd/m^2 | Nit |
| — | Gy | 1 m^2/s^2 | Gray |
| — | rad | 1/100 m^2/s^2 | rad |
| — | rem | 1 rad | rem |
| — | Sv | 1 Gy | Sievert |
| — | Bq | 1 Hz | Becquerel (disintegrations/s) |
| — | Ci | 37 GBq | Curie |
| — | R | 258 µC/kg | Roentgen |
| Computing | bit | 1 bit | Bit |
| Computing | byte | 8 bit | Byte |
| Computing | bps | 1 bit/s | bit per second |
| Computing | baud | 1 bps/SR | baud |
| Computing | flops | 1 flops | Floating point operation per second |
| Computing | KiB | = base unit | Usual sizes with powers of two |
| Computing | MiB | = base unit | |
| Computing | GiB | = base unit | |
| Computing | TiB | = base unit | |
| Computing | PiB | = base unit | |
| Computing | KB | = base unit | Usual sizes with powers of 10 |
| Computing | MB | = base unit | |
| Computing | GB | = base unit | |
| Computing | TB | = base unit | |
| Computing | PB | = base unit | |
| Computing | B | 1 byte | Byte |
| Computing | Bd | 1 baud | baud (standard unit) |
| Computing | mips | 1 mips | Million instructions per second |
| Computing | SR | 1 | Symbol rate (default is 1) |
| Computing | dB | 1 dB | decibel |
| Computing | kbit/s | = base unit | |
| Computing | Mbit/s | = base unit | |
| Computing | Gbit/s | = base unit | |
| Computing | kbaud | = base unit | |
| Computing | kbps | = base unit | |
| Computing | Mflops | = base unit | |
| Computing | Gflops | = base unit | |
| Computing | Tflops | = base unit | |
| Computing | Pflops | = base unit | |
| Computing | Eflops | = base unit |
All from config/units.csv, constants.csv, equations.csv (menu name row, then "name","definition" rows; "=" = self-defined; "=Cycle" menu customizes Cycle). Built-in ones hide when a file exists (ShowBuiltinUnits…). Exact fraction factors (1_ft = 3048/10000_m); 2023 US survey foot handled.
LongForm/UpperCase/… A word that is a command cannot be a variable (ⓋDup if needed).EVAL needed); lists are data by default (ListAsProgram to change); CASE … WHEN; no compiled locals ←x.= tests numeric equality; == structural; 'N' and '5' are expressions (Type 9). Tests return True/False, not 1/0.1 ≠ 1.); complex polar/rectangular kept; Size is 1 for numbers/expressions/units.AND/OR/NOT are bitwise on integers (TruthLogicForIntegers restores HP). Σ(i;1;10;i²) — no i=1 syntax.+ concatenates, × repeats, Min/Max compare whole lists; arrays: element-wise arithmetic and functions; [[…]] 1 GET returns a row; abs on arrays is element-wise (norm = HP ABS).↑Match/↓Match return the number of rewrites and repeat until stable; wildcards are any name; letters carry meaning; | chains substitutions.∂ derivative of user function F is F′ (not d1F); unknown derivatives error; ∂ always differentiates fully.LastArg saved only for interactive commands by default (ProgramLastArguments for programs); Undo is a real command.Root handles multiple equations/variables and complex guesses, errors when no root; Type needs CompatibleTypes for HP numbers; TypeName preferred.MainMenu, LastMenu; key assignments live in the KeyMap variable per directory. Settings are named flags/variables ('Precision' STO)."file.48s" STO/RCL on the USB flash; states .48S; no ports/libraries — Library, Constants, Equations come from CSV files.Num/Chr are Unicode code points; Size of text = characters; leading zero shown (0.5); huge exponent range (±2⁶⁰); flags negative numbers only for HP-known flags.The DM42/DM32/DM42n run DMCP, SwissMicros' boot loader + OS. DMCP owns the hardware and loads exactly one program (a .pgm on DM42, .pg5 on DM32/DM42n) into flash; DB48X, the stock DM42 firmware and your own code are all such programs. Your program is a bare-metal C/C++ image (no OS threads, no MMU) that calls DMCP services through a fixed function table (dmcp/lft_ifc.h, LIBRARY_FN_BASE) — LCD, keyboard, FAT file system, RTC, timers, buzzer, USB, malloc, printf.
| Piece | What it is |
|---|---|
dmcp/dmcp.h | the API (all prototypes, key codes, STAT_* flags, KEY_*, LCD_X/LCD_Y, menus, FatFs ff_ifc.h) |
dmcp/startup_pgm.s | Program_Entry: copies .data, zeroes .bss, runs static constructors, calls program_main() |
dmcp/sys/pgm_syscalls.c | newlib glue: malloc/free/realloc and _write forward to DMCP; defines the prog_info header (magic, entry, IFC version, QSPI size/CRC, name, version, keymap id) |
stm32_program.ld | memory map: program FLASH 704 KB @0x08050000 (DM42) · 1024 KB @0x080A0000 (DMCP5) · static RAM only 8 KB · QSPI 2 MB @0x90000000 (read-only data) |
bin/add_pgm_chsum, bin/check_qspi_crc | wrap the flash image into a .pgm with checksum; verify the QSPI image CRC matches src/qspi_crc.h |
lib/gcc111libbid_hard.a | Intel BID decimal library (bid128_*) — optional, what SDKdemo uses for numbers |
| sources | github.com/swissmicros/DMCP_SDK (hello world) · SDKdemo (RPN calc; a copy lives in db48x/dmcp/) · DMCP5_SDK (DM32/DM42n) · DM42PGM (stock firmware) · DB48X src/dmcp/main.cc (big C++ example) · docs technical.swissmicros.com/dmcp/doc/DMCP-ifc-html/ |
malloc(); sys_free_mem() tells you how much is left (DB48X grabs sys_free_mem() − 10 KB for its whole object store, i.e. roughly 70 KB on a DM42).const); the 2 MB QSPI is for large read-only data but the DM42 loader only accepts a QSPI image whose CRC matches the stock one — leave the .qspi section empty unless you rebuild the QSPI image (DB48X's make does the CRC trick).iostream, std:: containers or new[] in DB48X-style builds (-fno-exceptions -fno-rtti, newlib-nano). Plain C, printf (-u _printf_float), malloc, memcpy, strlen etc. work.-mfpu=fpv4-sp-d16): float is hardware, double is software; the BID library gives 34-digit decimals if you need calculator-grade math.SwissMicros publishes the SDK as “NOMAS” — NOt MAnufacturer Supported: use it, but don't expect support.
arm-none-eabi-g++, -fno-exceptions -fno-rtti -fno-threadsafe-statics; provide operator new/delete yourself (wrap malloc/free) or avoid new; no std::string/std::vector (they pull in exceptions and big code); static constructors run (__libc_init_array is called by the startup code).main.h C-compatible (extern "C" void program_main();) — the startup file calls the C symbol program_main.-Os, -specs=nano.specs; see db48x/Makefile and recorder/make-it-quick/config.arm-none-eabi.mk.dmcp5/ SDK and its stm32_program.ld (STM32U5: flash 1024 KB @0x080A0000, RAM @0x28000000, LIBRARY_FN_BASE 0x08000301, sdb @0x20000000); output extension .pg5; same API, PLATFORM_IFC_VER 16.make (dm42 → db48x.pgm), make dm32 / make dm42n (→ db50x.pg5).// src/main.h
#define PROGRAM_NAME "Hello"
#define PROGRAM_VERSION "1.0"
// PROGRAM_KEYMAP_ID defaults to 0xffffffff (any)
// src/main.c
#include <main.h>
#include <dmcp.h>
static void redraw(int key) {
lcd_clear_buf();
lcd_writeClr(t24); // 24-px font, line 0
lcd_putsR(t24, PROGRAM_NAME); // inverted title
lcd_writeClr(fReg); // big "register" font
lcd_switchFont(fReg, 3);
lcd_printAt(fReg, 3, "Hello, DM42!");
lcd_printAt(fReg, 4, "key = %d", key);
static const char *menu[6] =
{"BEEP", "", "", "", "", "OFF"};
lcd_draw_menu_keys(menu);
lcd_refresh();
}
void program_main() {
int key = 0;
redraw(key);
for (;;) {
// idle: sleep until a key or the auto-off timer
if ((ST(STAT_PGM_END) && ST(STAT_SUSPENDED)) ||
(!ST(STAT_PGM_END) && key_empty())) {
CLR_ST(STAT_RUNNING);
sys_sleep();
}
// going to / staying in the OFF state
if (ST(STAT_PGM_END) || ST(STAT_SUSPENDED)) {
if (!ST(STAT_SUSPENDED)) {
lcd_set_buf_cleared(0);
draw_power_off_image(1);
LCD_power_off(0);
SET_ST(STAT_SUSPENDED);
SET_ST(STAT_OFF);
}
continue;
}
SET_ST(STAT_RUNNING);
CLR_ST(STAT_SUSPENDED);
if (ST(STAT_OFF)) { // waking up
LCD_power_on();
rtc_wakeup_delay();
CLR_ST(STAT_OFF);
if (!lcd_get_buf_cleared())
lcd_forced_refresh();
}
if (!key_empty())
reset_auto_off();
// <0 none, 0 release, >0 key code
key = key_pop();
if (key == KEY_EXIT || key == KEY_F6)
SET_ST(STAT_PGM_END); // -> off
else if (key == KEY_F1) { // beep 440 Hz
start_buzzer_freq(440000);
sys_delay(200);
stop_buzzer();
}
if (key >= 0)
redraw(key);
}
}This is SDKdemo's program_main loop reduced to essentials: DMCP expects the program to cooperate with sleep/auto-off through the calc_state bits (STAT_RUNNING, STAT_PGM_END, STAT_SUSPENDED, STAT_OFF) — EXIT does not "quit", it turns the calculator off; the DMCP menu (SETUP) is how the user leaves your program.
| Call | Purpose |
|---|---|
lcd_clear_buf() lcd_refresh() lcd_forced_refresh() lcd_refresh_lines(ln,cnt) | draw into the 400×240 1-bpp buffer, then push to the LCD (LCD_X LCD_Y, LCD_LINE_SIZE 50 bytes/line) |
lcd_fill_rect(x,y,dx,dy,val) lcd_fill_ptrn(x,y,dx,dy,p1,p2) lcd_fillLine(s) | rectangles / patterns / whole lines |
bitblt24(x,dx,y,val,BLT_OR|BLT_ANDN|BLT_XOR,fill) lcd_line_addr(y) | raw pixel access (24-bit blits, line pointers) |
lcd_draw_img(img,xo,yo,x,y) _part _direct | draw bitmaps |
t20 t24 fReg | system disp_stat_t* font states: 20-px, 24-px, and the switchable "register" font (lcd_switchFont(fReg,n), lcd_nextFontNr/lcd_prevFontNr) |
disp_stat_t fields | x y cursor · inv inverse video · lnfill clear line first · newln advance after write · xoffs · fixed width · y_top_grd |
lcd_writeClr(ds) lcd_setLine(ds,n) lcd_setXY(ds,x,y) lcd_prevLn(ds) lcd_writeNl(ds) | position by line number or pixel |
lcd_print(ds,fmt,…) lcd_printAt(ds,ln,fmt,…) lcd_printR lcd_printRAt | printf-style text (R = inverted) |
lcd_puts(ds,s) lcd_putsAt lcd_putsR lcd_putsRAt lcd_writeText | plain text; lcd_textToBox(ds,x,w,s,from_right,align_right) clips/aligns |
lcd_textWidth(ds,s) lcd_charWidth lcd_lineHeight(ds) lcd_baseHeight lcd_fontWidth lcd_textToWidth lcd_textForWidth | measuring / word-wrapping |
lcd_draw_menu_keys(const char*keys[6]) lcd_draw_menu_key(n,s,hl) lcd_draw_menu_bg() LCD_MENU_LINES (32) | the six soft-key labels at the bottom |
msg_box(ds,txt,inv) lcd_for_calc(DISP_ABOUT…) | message box; system screens |
draw_power_off_image(1) LCD_power_off(clear) LCD_power_on() lcd_set_buf_cleared(0) | off-image (/OFFIMG/*.bmp) and panel power |
create_screenshot(report) | BMP to /SCREENS (SDKdemo binds it to KEY_SCREENSHOT, code 44) |
| Call | Purpose |
|---|---|
key_pop() key_empty() key_push(k) key_pop_last() key_pop_all() key_tail() | key queue: key_pop → >0 press, 0 release, <0 empty |
wait_for_key_press() wait_for_key_release(tout) runner_get_key(&repeat) runner_get_key_delay(…) sys_last_key() read_key(&k1,&k2) | blocking waits, auto-repeat helper, raw matrix read |
KEY_SIGMA=1 KEY_INV KEY_SQRT KEY_LOG KEY_LN KEY_XEQ KEY_STO KEY_RCL KEY_RDN KEY_SIN KEY_COS KEY_TAN=12 | row 1–2 (same 1…37 numbering as DB48X KeyMap/ASN and the keyboard map above) |
KEY_ENTER=13 KEY_SWAP KEY_CHS KEY_E KEY_BSP=17 KEY_UP=18 KEY_7 8 9 KEY_DIV=22 KEY_DOWN=23 KEY_4 5 6 KEY_MUL=27 | rows 3–5 |
KEY_SHIFT=28 KEY_1 2 3 KEY_SUB=32 KEY_EXIT=33 KEY_0 KEY_DOT KEY_RUN=36 KEY_ADD=37 · KEY_F1…F6=38…43 | rows 6–7, soft keys; KEY_SCREENSHOT 44, KEY_SH_UP/DOWN 45/46, KEY_DOUBLE_RELEASE 99; IS_EXIT_KEY(k) |
ST(f) SET_ST(f) CLR_ST(f) on calc_state | STAT_RUNNING STAT_SUSPENDED STAT_OFF STAT_PGM_END STAT_MENU STAT_BEEP_MUTE STAT_SLOW_AUTOREP STAT_DMY STAT_CLK24 STAT_POWER_CHANGE STAT_CLK_WKUP_* |
sys_sleep() reset_auto_off() is_auto_off() sys_auto_off_cnt() | low-power idle and the auto-off timer |
sys_delay(ms) sys_tick_count() sys_current_ms() sys_timer_start(ix,ms) sys_timer_timeout(ix) sys_timer_disable(ix) start_timer2/3 get_tim1_timer() | delays and timers (TIMER_BASE_FREQ 8 MHz) |
rtc_read(&tm,&dt) rtc_write rtc_read_sec/min get_rtc_ticks() (256/s) rtc_set_alarm julian_day(&dt) julian_to_date print_dmy_date print_clk24_time | clock and calendar (tm_t h/m/s/csec, dt_t y/m/d) |
read_power_voltage() get_vbat() get_lowbat_state() usb_powered() power_check_screen() | battery / USB |
start_buzzer_freq(mHz) stop_buzzer() beep_volume_up/down get_beep_volume is_beep_mute() | sound (frequency in millihertz: 440 Hz = 440000) |
sys_free_mem() sys_reset() sys_critical_start/end() set_reset_magic() get_hw_id() | system |
| Call | Purpose |
|---|---|
f_open(&f,"/DATA/x.txt",FA_READ|FA_WRITE|FA_CREATE_ALWAYS|FA_OPEN_APPEND…) f_read f_write f_lseek f_close f_unlink f_rename f_size f_tell f_eof | FatFs on the internal flash disk (the same USB volume you copy .pgm files to); returns FRESULT (FR_OK…) |
sys_disk_ok() sys_disk_write_enable(1) … (0) sys_disk_check_valid() sys_write_buf_used() | DB48X wraps every write in enable/disable (see src/file.cc) |
file_exists(fn) file_size(fn) check_create_dir(dir) make_date_filename(s,dir,ext) set_fat_label(s) | helpers |
file_selection_screen(title, base_dir, ".txt", cb, disp_new, overwrite_check, data) | built-in file picker; cb(fpath,fname,data) is called on ENTER |
item_sel_init/engine/header item_sel_state_t | generic scrolling list picker |
handle_menu(&MID_MENU, MENU_RESET|MENU_ADD, line) with smenu_t {name, items[], msg[], post_disp} | full-screen system-style menus; items are MI_* ids (yours 0–127, system 128–255) |
run_menu_item_app = my_run_menu_item; menu_line_str_app = my_menu_line_str; | callbacks: run an item / give its label (return MRET_UNIMPL, MRET_EXIT) |
MI_SYSTEM_ENTER MI_MSC (USB disk) MI_ABOUT MI_SET_TIME MI_SET_DATE MI_BEEP_MUTE MI_SLOW_AUTOREP MI_PGM_LOAD MI_LOAD_QSPI MI_DISK_INFO MI_OFF_MODE | system items you can put in your own Setup menu (SDKdemo menu.c) |
run_set_time() run_set_date() disp_disk_info(hdr) run_help_file("/HELP/x.htm") run_help() | stock dialogs; help viewer for .htm files |
printf(...) → _write → DMCP | debug console (SDKdemo DBG_PRINT); usb_acm_on() acm_puts(s) usb_is_on() usb_turn_off() USB serial |
print_byte(b) print_buffer(buf,n) print_is_ready() printer_set_delay(ms) | HP 82240 IR printer |
qspi_user_addr() qspi_user_size() qspi_user_write(data,size,offset,erase) | a user area in QSPI flash for persistent data |
sys_flash_erase_block sys_flash_write_block sys_flashing_init/finish | raw program-flash writes (dangerous) |
printf over the DMCP console/USB serial, on-screen lcd_print, create_screenshot() to /SCREENS, msg_box, log files with f_write.arm-none-eabi-size (data+bss ≤ 8 KB) and sys_free_mem() at runtime; a hard fault shows the DMCP fault screen (DISP_FAULT) — check the .map file.sim/dmcp.cpp) re-implements the DMCP API for DB48X and is a good reference for expected behaviour..pgm: full control of screen/keys/timing, small and simple, but no RPL, no DB48X objects, and the user must switch programs (only one is loaded at a time).src/ids.tbl → COMMAND_DECLARE → COMMAND_BODY → menu.cc, then make -j sim to test, make -j8 for db48x.pgm): your C++ gets bignums, decimals, units, expressions and the UI for free — see AGENTS.md.