0010 ! READ75T - reads HP-75 mass storage Text files & transforms them into 0020 ! HP-71 compatible TEXT files. By M.Markov. Credits to J.G. Buitenhuis for 0030 ! writing the first routine that translate HP-75 Text files. The output may 0031 ! be directed to a printer if you so desire. 0032 ! 0033 ! Requires either HEXLEX or DIRLEX. Uses USERLIBA & PILEXTL4 (available 0034 ! on SWAP07). 0040 ! 0050 ! User instructions: This is menu driven. It prompts you for the name of 0060 ! the file to be read. The program assumes that the file is on default 0070 ! drive :TAPE(1):1 (first drive on loop 1), unless you specify otherwise 0080 ! with a full file specifier that includes device data, such as JUNK.SWAP07 0090 ! or JUNK.SWAP07:2 or JUNK:TAPE(2):3 0091 ! 0092 ! NOTE : This program is as yet incomplete. I intend to expand it until it 0093 ! will read any kind of text file automatically, or produce hex dumps for 0094 ! non-text files. 0100 ! 0110 DIM F$,C$,I$[256] 0120 LC OFF @ PUT "#105" @ INPUT "File spec? ",":TAPE(1):1";F$ 0130 P=POS(F$,".",2) @ IF NOT P THEN P=POS(F$,":",2) 0140 IF NOT P THEN L=1 @ D=DEVADDR(":TAPE") @ GOTO 170 ELSE D=DEVADDR(F$[P]) 0150 L1=POS(F$,":",P+1) @ IF NOT L1 THEN L=1 @ GOTO 170 0160 L=VAL(F$[L1+1,L1+1]) @ IF D=-1 THEN BEEP @ DISP "Device not found" @ WAIT 1 @ GOTO 120 0175 IF P THEN F$=F$[1,P-1] 0176 F$[11]="" 0177 DISP "to Printer or File? (F/P)" 0178 K$=UPRC$(KEYWAIT$) @ O=POS("PF",K$) @ IF NOT O THEN 177 0179 O=O-1 @ IF O THEN CREATE TEXT F$ @ ASSIGN #1 TO F$ 0180 SEND L; UNL UNT LISTEN D SDC UNL @ TAPESTAT :D:L 0190 SFLAG -23 @ SEND L; TALK D DDT 2 DDT 2 @ C$=RPT$(CHR$(255),32) 0200 ENTER :D:L USING '#,32A';A$ 0210 IF A$=C$ THEN BEEP @ DISP "File not found" @ END 0220 IF A$[1,10]<>F$ THEN 200 0240 IF A$[11,12]#CHR$(224)&CHR$(82) THEN DISP "Warning: Dir filetype" 0250 SEND L; UNT MTA UNL LISTEN D DDL 4 DATA A$[15,16] UNL 0260 TAPESTAT :D:L 0270 SEND L; UNL UNT TALK D DDT 2 @ ENTER :D:L USING '#,28A';I$ 0280 IF I$[6,6]<>"T" THEN BEEP @ DISP "Wrong filetype" @ GOTO 'DUMP' 0290 ENTER :D:L USING '#,2A';C$ @ ENTER :D:L USING '#,B';K 0300 F$='#,'&STR$(K)&"A" @ ENTER :D:L USING F$;I$ 0310 L$=HEX$(REV$(C$)) @ IF L$="A999" THEN 400 0311 IF O THEN PRINT #1;L$&I$ ELSE PRINT L$&I$ 0312 GOTO 290 0400 SEND L; UNL UNT LISTEN D SDC UNL @ ASSIGN #1 TO * @ DISP "DONE" @ END