Re: HP 71B: Input LEX files without HPIL? Message #4 Posted by Egan Ford on 26 Nov 2007, 2:05 a.m., in response to message #3 by Meenzer
.t71 files are plain text, just type it in:
dumplex:
10 INPUT "Filename: ";F$ @ A=HTD(ADDR$(F$)) @ T$=PEEK$(DTH$(A+16),2)
20 IF T$#"40" AND T$#"80" THEN DISP "Wrong Filetype" @ BEEP @ GOTO 10
30 N=HTD(REV$(PEEK$(DTH$(A+32),5)))+32 @ Y=MOD(N,16)
40 PRINT F$;TAB(11);"ID#"&REV$(PEEK$(DTH$(A+37),2));TAB(18);IP((N31)/2);"bytes"
50 PRINT @ PRINT @ PRINT " 0123456789ABCDEF ck" @ PRINT
60 FOR X=0 TO N DIV 161
70 A$=PEEK$(DTH$(A),16)
80 PRINT DTH$(X)[3]&": "&A$&" "&FNS$(A$) @ A=A+16
90 NEXT X
100 IF Y=0 THEN 120
110 A$=PEEK$(DTH$(A),Y) @ PRINT DTH$(X)[3]&": "&A$;TAB(23);FNS$(A$)
120 PRINT @ END
130 DEF FNS$(A$) @ S=0 @ FOR Z=1 TO LEN(A$) @ S=IP(NUM(A$[Z,Z])*Z+S) @ NEXT Z
140 FNS$=DTH$(MOD(S,256))[4] @ END DEF
makelex:
10 SFLAG 1 @ ON ERROR GOTO 30 @ DESTROY ALL
20 PURGE DUMMY
30 ON ERROR GOTO 220
40 INPUT '# of bytes: ';N
50 CREATE TEXT DUMMY,N
60 A=HTD(ADDR$('DUMMY')) @ A1=A @ P$=""
70 Q=1 @ X=0 @ INPUT '000: ',P$;A$ @ C$=A$ @ GOSUB 200
80 Q=2 @ X=1 @ GOSUB 190
90 A$=A$&C$ @ A=A+37 @ N=N*2+31 @ Q=3 @ SFLAG 5
100 FOR X=2 TO N DIV 161
110 GOSUB 190
120 IF FLAG(5) THEN C$=C$[6]
130 POKE DTH$(A),C$ @ A=A+165*FLAG(5,0) @ NEXT X @ Q=4
140 DISP DTH$(X)[3]; @ INPUT ': ',P$[1,MOD(N,16)];C$
150 GOSUB 200
160 L=LEN(C$) @ IF C$[L,L]='' THEN C$=C$[1,L1] @ GOTO 160
170 POKE DTH$(A),C$ @ POKE DTH$(A1),A$
180 OFF ERROR @ CFLAG 1 @ END
190 DISP DTH$(X)[3]; @ INPUT ': ',P$;C$
200 DISP DTH$(X)[3]; @ INPUT ' ck ','';C1$
210 S=0 @ FOR Z=1 TO LEN(C$) @ S=IP(NUM(C$[Z,Z])*Z+S) @ NEXT Z
220 IF C1$=DTH$(MOD(S,256))[4] THEN RETURN
230 DISP 'Checksum Error' @ BEEP @ POP @ ON Q GOTO 70,80,110,140
240 DISP 'Error:'&ERRM$ @ BEEP @ GOTO 180
