Re: HP-41: how to extract name of current XM-file? Message #3 Posted by PeterP on 2 May 2009, 1:09 a.m., in response to message #2 by Dan Grelinger
for example, the following program will place the name of the current working file in alpha and a 2-letter code into X with regard to its file. It only works on a CX (which is your 'workhorse' IIRC) and assumes the CCD. A second version uses the Sandbox. Both rely on the principle pointed out by Dan - the structure of the absolute register 64, which is the first pointer register of the X/M. (see EFME p181). it is |00|0W|WP|PP|NN|NT|TT|, with WW being the number of the current working file. NNN is the address of top register in the next XM block and TTT is the adress of the top register of the current XM block.
HTH
Cheers
Peter
------------ CCD Version -------------
LBL ‘GCF’
64.4
PEEKB
16
/
INT
64.5
PEEKB
RCL Z
+
EMDIRX
RTN
-------------------------------------------
------------ Sandbox Version 1 ---------
LBL ‘GCF’
64
aNRCL
CLA
NNN>HEX
-6
AROT
ASHF
ATOX
ATOX
ATOX
H>D
EMDIRX
RTN
-------------------------------------------
------------ Sandbox Version 2 -------------
LBL ‘GCF’
'@@' ;text line with 242,64,64, byte 4 of reg 064
RCLB
16
/
INT
'P@' ;textline with 242,80,64, byte 5 of reg 064
RCLB
+
EMDIRX
RTN
-------------------------------------------
Edited: 2 May 2009, 1:37 a.m.
|