The Trials and Tribulations of Reading an MSDOS Text File Disk

Author(s): Richard Matejovic; Donald Lambert; Mark Wahl
Publication: ZXir QLive Alive!
Pub Details: ZXir QLive Alive! v11 n3 (Volume 11, Issue 3)
Date: Autumn 2001
Pages: 8-9

This is from the January/February 1990 issue of CRAGIST newsletter. I was in correspondence with Richard for a while and all at once he dropped from sight and my letters to him were returned forwarding address not given . I never did learn what happened to Richard. What follows is what he sent me.

Before I begin I would like to thank Bill Miller of SINKLINK for getting me involved with this project in the first place. I would also like to thank Mark Wahl also of SINCLINK C for writing the initial program that I used to get started in the right direction All I really did was debug Mark 1 8 program .

Our story begins some time ago in a land far away (Ohio). One day I was talking to Bill on the phone (Much to my wife’ s dismay! ) I was telling him that I had just gotten an AERCO disk drive System for my TS-1000! After having had only cassette and stringy floppy this was new and ponderous for my poor little person to behold. In the course of our conversation Bill mentioned that I should try to read an MSDOS disk. He said that his system could read other disk made on other machines. So I thought sure I am game to give it a try. Well Bill sent me a disk to try. I also sent him one to try.

After playing around with this project on my own I had all but given up. By reading the AERCO manual and lots of trial and error (lots of error) I was able to determine that this was going to require some Machine Code programming skills. Since this was beyond my abilities, I thought “I will call Bill and see if he can be of any help!” Well Bill wasn’t but he asked Mark about it and in a matter of a few minutes he was able to pound out a short program that he thought would work. However, since he had no TS-1000 to try it on, back it came to me. I typed in the program and tried it. No go, nothing happened. The screen went blank and that was it. OK, I know the drive needs to be started. So I added line “700 RAND USR 12800”. Now lets RUN the program, CRASH with error code “3/1100 subscript out of range”. OK lets call Bill again. Unfortunately he was not much help. After some more playing around with the program I changed line 1000 to “FOR K=1 TO 40”. It WORKED! !

All right lets see what all is on this disk. After 1 sector error 3/1100 AGAIN ! OK now variable “N” needs reset so add line “1085 IF N=SEND THEN GOTO 1160”. And we were off again. This time it made 9 sectors before error 3/1100. I don’ t know about you but I was getting tired of the same error all of the time. The least it could do is come with something new! Anyway now variable “S” needs reset so add line “1015 IF S>9 THEN LET S=1”.

This brings us to where the program is today. It will still crash out with error 3/1100 when it comes across anything but text files, but I am working on this problem also. In the mean time if you do use it and it crashes just type in “PRINT PEEK K;” and “PRINT PEEK S;” and avoid these areas .

I would like to thank you for the time you have taken to read this article. You can be sure that I will be typing away on my little toy computers for many years to come .

By the way if you are using a MemoTech Centronics Printer Interface then you should reverse lines 940 and 960.

NOTE: The lower case letters in the listing are inverse lettered.

70 PRINT
80 PRINT
90 PRINT "WARNING warning WARNING"
95 PRINT
100 PRINT "THIS PROGRAM WILL CRASH"
110 PRINT "IF YOU DO NOT SET RAM TOP BY"
120 PRINT "POKE 16389, 192 THEN NEW"
130 PRINT "PRESS ENTER IF YOU HAVE DONE SO"
140 PRINT
150 PRINT
160 PRINT "TO STOP THE PRINTOUT PRESS BREAK"
180 PRINT "TO STOP THE DISK DRIVE TYPE IN"
190 PRINT """USR 12852" "WITE IT DOWN"
200 INPUT Z$
700 RAND USR 12800
800 LET MCADDR=32*1024-512-11
810 LET M=MCADDR
820 REM LD HL, $7E00
821 POKE M, 33
822 POKE M+1, 0
823 POKE M+2, 126
830 REM LD,C.$0
831 POKE M+3, 14
832 POKE M+4, 0
840 REM LD B, $0
841 POKE M+5, 6
842 POKE M+6, 0
850 REM CALL $3300
851 POKE M+7, 205
852 POKE M+8, 0
853 POKE M+9, 51
860 REM RET
861 POKE M+10, 201
900 DIM T$(256)
905 DIM A(512)
910 FOR N=1 TO 32
920 LET T$(33 TO 47)="??$??,()*+,-./"
930 LET T$(48 TO 64)="0123456789:;"<>?"
938 REM TYPE LINE BELOW THIS
939 REM IN INVERSE VIDEO
940 LET T$(65 TO 90)="abcdefghijklmnopqrstuvwxyz"
950 LET T$(91 TO 96)="????---"
960 LET T$(97 TO 122)="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
970 FOR N=123 TO 256
980 LET T$(N)=" "
990 NEXT N
1000 FOR K=1 TO 40
1010 FOR S=1 TO 9
1015 IF S>9 THEN LET S=1
1020 CLS
1030 POKE (MCADDR+4), S
1040 POKE (MCADDR+6), K
1050 RAND USR MCADDR
1060 LET SSTRT+MCADDR+11
1070 LET SEND=SSTRT+512
1080 FOR N+SSTRT TO SEND
1085 IF N=SEND THEN GOTO 1160
1090 LET A=PEEK (N)
1100 LPRINT T$(A);
1110 NEXT N
1160 NEXT S
1170 NEXT K
1180 STOP

Note:

In line 1050, the listing of the program I have is “1050 RAN USR MCADDR” RAN could be either RAND or RUN but since USR usually follows RAND I selected that. Not having an AERCO TS-1000 disk drive interface that worked I could never try his program.

Donald S. Lambert

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.