ZEBRA/TIMEX FDD Disk System: Directory Track Reader

The following program was written on an old model Zebra Disk Drive. Owners of the newer FDD 3000 may wish to run this program and report on the results. I don’t know whether there are any software differences between the two models.

The disk drive controller formats the 3 inch disk into 40 tracks, numbered 0 to 39, each containing 4 K bytes. Each track is subdivided into 16 sectors, numbered 0 to 15, each containing 1/4 K or 256 bytes. The first four tracks (0 to 3) are reserved for the operating system. Track 4 contains the directory. Tracks 5 through 39 contain the files you saved to disk. When a disk is intially formated, TOS sets up 40 tracks, writes a copy of TOS to tracks 0 through 3, places the disk name in the first sector of track 4 and sets all unused bytes to 0E5 h (229 d).

The Zebra Disk Drive Technical Manual remarks that the contents of the directory track can be read using the extended Basic command INPUT *#0. After some trial and error, I found a suitable method to read this track using a Basic program.

I numbered this program beginning with line 200. You may wish to merge this program with a utility program which reads disk headers. One such program is Chuck Dawson‘s DISKREAD, which was published in Vol., No.1 of the (now defunct) T.O.P.S. newsletter. DISKREAD, or a similar utility, could be used to obtain further details on the directory contents.

Lines 205 to 210: You have a choice of sending output to the screen or direct to your printer. The printer could be an 80 column printer. The 80 column printer drive I use, adjusts the addresses used for channel number 3, so that this channel drives my 80 column printer. For those without a full size printer, channel 3 contains the TS2040 I/O addresses from normal RAM initiation on initial power-up.

Line 215: The CAT * command is required to remove a “bug”. After I first ran this program, I inserted a new disk and ran the program again. Instead of getting the directory of the new disk, I got the directory of the prior disk. Adding the CAT * command reset whatever internal buffer is involved with “#0”. Note that 0 is not a valid channel number in other TOS commands.

[Editor: Space doesn’t allow us to print all of the program notes for this listing. If you would like to receive a copy of the entire documentation, just send a legal SASE to TIME DESIGNS, and we will send you a copy]

“` 200>REM DIRECTORY READER by Mike Finn 205 PRINT AT 10,0;”SELECT PRINT OUT DEVICE :”””1 TV SCREEN”” “2 PRINTER” 208 INPUT LINE Z$: IF Z$<“1″ O R Z$>”2″ THEN GO TO 208 210 LET Z=1+VAL Z$ 215 CLS : CAT * 220 PRINT #Z””THIS PROGRAM WIL L ITEMIZE THE ENTRIES ON TRACK 4 OF THE DISK.” 225 PRINT #Z 230 INPUT “PRESS ENTER TO CONTI NUE. “; LINE B$: CLS 240 RESTORE *#0 300 FOR I=1 TO 128 310 INPUT *#0;A$;AT I 320 IF CODE A$(1)=229 THEN PRI NT #Z;”RECORD “;I;” IS EMPTY.”: GO TO 720 325 PRINT #Z'”RECORD: “;I 330 PRINT #Z;”LEVEL: “;CODE A$( 1);” “;”DISK NAME” AND (CODE A$= 255) 340 PRINT #Z;”NAME: “;A$(2 TO 9 ) 350 LET A=CODE A$(10): IF A>=12 8 THEN LET A$(10)=CHR$ (A-128): PRINT #Z;TAB 6;”PROTECTED CATAL OG ENTRY” 360 LET A=CODE A$(11): IF A>=12 8 THEN LET A$(11)=CHR$ (A-128): PRINT #Z;TAB 6;”INVISIBLE CATAL OG ENTRY” 370 PRINT #Z;”TYPE: “;A$(10 TO 12) 380 IF A$(10 TO 12)=”DIR” THEN PRINT #Z'”THIS DIRECTORY CONTAI NS ALL FILES AND SUBDIRECTOR IES WITH LEVEL NUMBER “;CODE A $(17);”.”: GO TO 700 390 PRINT #Z;”EXTENSION #: “;CO DE A$(13) 400 PRINT #Z;”BYTES LAST SECTOR : “;CODE A$(14) 410 LET S=(256*CODE A$(15)+CODE A$(16))/2 420 PRINT #Z;”# SECTORS WITH DA TA: “;S 430 PRINT #Z;”BLOCK ALLOCATION: ” 440 FOR J=17 TO 24 450 PRINT #z;TAB 6;CODE A$(J);T AB 16;CODE A$(J+8) 460 NEXT J 500 LET T=(S-1)*256+CODE A$(14) +(256 AND (CODE a$(14)=0)) 510 PRINT #Z;”TOTAL FILE BYTES: “;T 520 LET A1=INT (S/4) 530 LET A2=S-4*A1 590 PRINT #Z;”UNUSED BYTES IN A LLOCATION: “;1024*(A1+(1 AND (A2 <>0)))-T 600 LET A1=INT (CODE A$(17)/4) 610 LET TRACK=4+A1 620 LET A2=CODE A$(17)-4*A1 630 IF A2=0 THEN LET A2=4 640 LET SECTOR=16-4*A2 650 PRINT #Z;”ALLOCATION BEGINS :”‘TAB 6;”TRACK “;TRACK;TAB 16;” SECTOR “;SECTOR 700 INPUT “PRESS ENTER OR KEYWO RD STOP “; LINE B$: IF B$=CHR$ 2 26 THEN GO TO 800 710 CLS 720 NEXT I 800 RESTORE *#0 810 STOP “`