Skip to main content

HP-41CX Emulator Tool - Decoder

HP-41CX Emulator Tool - Decoder #

Unlock the secrets hidden within those cryptic memory dumps with the Decoder—the trusty sidekick in the hp41cx_tools suite, ready to resurrect your HP-41CX FOCAL programmes from the digital archives! This command-line virtuoso effortlessly decodes .px41 and .dm41 files into crisp, readable Unicode FOCAL source code, auto-detecting formats so you can focus on the joy of retro tinkering. Forged in the unyielding Ada 2022 for flawless fidelity, and battle-tested with AUnit via make test, it runs like a dream on macOS, Linux, and Windows—a cross-platform beacon for enthusiasts scripting in ZShell or pondering Ada’s tasking wonders.

Whether you’re salvaging a long-lost programme from PX-41CX or DM41X, the Decoder handles the heavy lifting, preserving every nuanced glyph and command with the precision of a well-crafted procedure. It’s the perfect companion to the Encoder, turning opaque binaries into editable poetry that sparks new ideas in our vibrant retro computing community.

Example: Decoding #

Decode a DM41 memory dump to Unicode FOCAL code:

hp41cx_tools-main --decode in_GRAVITY.dm41 out_GRAVITY.utf8.focal

Example Input: in_Number.px41 #

DM41
08  4b000000000000  00000000000000  00000000000000  00000000000000
0c  0000000000019c  1a70016919c175  0000002c048000  00000000000000
174  00000000000000  00000000c8262d  93021036ba0000  402143668e2142
178  225140668e5222  8e042126421242  0010362266ba00  452e2e2e2163b4
17c  45502053504143  06ba0003fd4445  12437120424092  40ce0220512442
180  aa001330244222  00431371457502  40542467b200a9  a80066b2005222
184  42124222517141  42134321413426  2345759303207a  2e2e7e897f3061
188  77f75a45524f2e  4e452e2e2e7e89  2e2e2e7e89f64f  2e7e89f654574f
18c  54485245452e2e  7e892367b300f8  3d9b06f37f2046  537e894585f241
190  9b71f57f20462f  45f27f46f27f3d  226e261a15f156  454c3d9b037e89
194  899c000af54655  9c02a91d9b017e  10322533f2473d  101010361c1510
198  10104035cf6615  61181010421112  56495459a81b31  c000f800475241
A: c000f800475241  B: 0000002c0480fd  C: 0000002c0480fd
S: 00001100000000
M: 00011cd5ff73cb  N: 000000000000c0 G: 00

Example Output: out_Number.focal #

; ALPHA = ⊤                     ⊤
; SIZE =  100
; ΣREG =  624
; A: c000f800475241  B: 0000002c0480fd  C: 0000002c0480fd
; S: 00001100000000
; M: 00011cd5ff73cb  N: 000000000000c0  G: 00
LBL ⊤GRAVITY⊤       ; c000f80047524156495459
SF 27               ; a81b
STO 01              ; 31
ABS                 ; 61
800                 ; 181010
*                   ; 42
1200                ; 11121010
+                   ; 40
STO 05              ; 35
LBL A               ; cf66
5000                ; 15101010
STO 06              ; 36
-500                ; 1c151010
STO 02              ; 32
RCL 05              ; 25
STO 03              ; 33
⊤G=⊤                ; f2473d
FIX 2               ; 9c02
CF 29               ; a91d
ARCL 01             ; 9b01
AVIEW               ; 7e
PSE                 ; 89
FIX 0               ; 9c00
LBL 09              ; 0a
⊤FUEL=⊤             ; f54655454c3d
ARCL 03             ; 9b03
AVIEW               ; 7e
PSE                 ; 89
RCL 02              ; 22
RND                 ; 6e
RCL 06              ; 26
.5                  ; 1a15
⊤V⊤                 ; f156
X>Y?                ; 45
⊤⊦F⊤                ; f27f46
⊤⊦=⊤                ; f27f3d
ARCL 13             ; 9b71
⊤⊦ F/S⊤             ; f57f20462f53
AVIEW               ; 7e
PSE                 ; 89
X>Y?                ; 45
RTN                 ; 85
⊤A=⊤                ; f2413d
ARCL 06             ; 9b06
⊤⊦ F⊤               ; f37f2046
AVIEW               ; 7e
PSE                 ; 89
RCL 03              ; 23
X=0?                ; 67
GTO 02              ; b300
⊤THREE...⊤          ; f854485245452e2e2e
AVIEW               ; 7e
PSE                 ; 89
⊤TWO...⊤            ; f654574f2e2e2e
AVIEW               ; 7e
PSE                 ; 89
⊤ONE...⊤            ; f64f4e452e2e2e
AVIEW               ; 7e
PSE                 ; 89
CLX                 ; 77
⊤ZERO...⊤           ; f75a45524f2e2e2e
AVIEW               ; 7e
PSE                 ; 89
CLD                 ; 7f
STO 00              ; 30
ABS                 ; 61
RCL 03              ; 23
X>Y?                ; 45
RDN                 ; 75
ST- 03              ; 9303
RCL 00              ; 20
SIGN                ; 7a
*                   ; 42
3                   ; 13
/                   ; 43
RCL 01              ; 21
-                   ; 41
STO 04              ; 34
RCL 06              ; 26
*                   ; 42
2                   ; 12
*                   ; 42
RCL 02              ; 22
X↑2                 ; 51
X<>Y                ; 71
-                   ; 41
SF 00               ; a800
X<0?                ; 66
GTO 01              ; b200
SQRT                ; 52
RCL 02              ; 22
+                   ; 40
CHS                 ; 54
RCL 04              ; 24
X=0?                ; 67
GTO 01              ; b200
CF 00               ; a900
/                   ; 43
3                   ; 13
X<>Y                ; 71
X>Y?                ; 45
RDN                 ; 75
LBL 01              ; 02
FS?C 00             ; aa00
3                   ; 13
STO 00              ; 30
RCL 04              ; 24
*                   ; 42
RCL 02              ; 22
+                   ; 40
X<> 02              ; ce02
RCL 00              ; 20
X↑2                 ; 51
RCL 04              ; 24
*                   ; 42
2                   ; 12
/                   ; 43
X<>Y                ; 71
RCL 00              ; 20
*                   ; 42
+                   ; 40
ST+ 06              ; 9206
GTO 09              ; ba00
LBL 02              ; 03
⊤DEEP SPACE...⊤     ; fd444545502053504143452e2e2e
RCL 01              ; 21
X≠0?                ; 63
GTO 03              ; b400
0                   ; 10
STO 06              ; 36
RCL 02              ; 22
X<0?                ; 66
GTO 09              ; ba00
PROMPT              ; 8e
LBL 03              ; 04
RCL 01              ; 21
RCL 06              ; 26
*                   ; 42
2                   ; 12
*                   ; 42
RCL 02              ; 22
X↑2                 ; 51
+                   ; 40
X<0?                ; 66
PROMPT              ; 8e
SQRT                ; 52
RCL 02              ; 22
+                   ; 40
RCL 01              ; 21
/                   ; 43
X<0?                ; 66
PROMPT              ; 8e
RCL 01              ; 21
*                   ; 42
ST- 02              ; 9302
0                   ; 10
STO 06              ; 36
GTO 09              ; ba00
.END.               ; c8262d