Super Detailed Disk Directory

Author(s): Larry Zunk
Pub Details: Time Designs Magazine v4 n5 (Volume 4, Issue 5)
Date: July/August 1988
Pages: 17-18

The following program listings are for the AERCO FD-68 Disk Drive System. I must give credit to Mowgli Assor for his user tips in the SEP/OCT ’87 issue of TDM. His machine code routines are the heart of these programs.

Listing 1 is a 32 column detailed disk directory. Listing 2 is a 64 column detailed directory for use with the Advanced Video Modes software by BEAVER COMPUTER PRODUCTS. Either version can be run in BASIC or compiled with the TIMACHINE compiler by NOVELSOFT.

The directory gives file name, type, length, location, auto start line numbers, length of variables, active chunks, and tracks allocated for each file. Although the information is the same, I prefer the 64 column version because everything fits on one line and it gives a much cleaner screen display.

My system is double-sided double-density, so some changes to the machine code in the data statement may be required for other systems. The disk directory is on track 0 sectors 2 and 3. The code sets the start of the buffer at E290h (58000 decimal) and reads track 0 sector 2, then increments the buffer address held in the HL register by 512 bytes. Then it sets the B register to 3 and reads sector 3. The AERCO user manual states that a single-density system has 256 bytes per sector and a double-density system has 512 bytes per sector (I assume that a quad-density system would have 1024 bytes per sector). This is what will need to be changed for systems other than DD/DD.

LISTING 1

  10 REM !USR 60000
20 REM !INT +LEN,LNLOC,VAR,BUF,TYP,LOC,F,E
30 REM !LEN P$<=27
40 REM ! LIST
50 REM ! OPEN #
60 FOR F=59967 TO 59999: READ E: POKE F,E: NEXT f: RANDOMIZE USR 59967
70 DATA INT 62,3,211,244,205,86,53,1,2,0,33,144,226,205,86,53,1,3,0,33,144,228,205,86,53,205,130,53,62,1,211,244,201
80 LET BUF=58032
90 LET P$="BASDATCHRBINSCRAROLROBUTVAR"
100 CLS : PRINT INVERSE 1;" FILE LINE# VARS NAME TYPE BYTES LOC CHUNK"; INVERSE 0;AT 0,21; OVER 1;"__________";AT 2,0;
110 LET LOC=BUF: LET TYP=PEEK LOC*3+1: LET LOC=LOC+1: LET E=LOC+10
120 IF PEEK LOC<>0 AND LOC<E THEN PRINT CHR$ PEEK LOC;: LET LOC=LOC+1: GO TO 120
130 LET LOC=E
140 GO SUB 300: LET LEN=E
150 GO SUB 300: LET LNLOC=E
160 GO SUB 300: LET VAR=E
170 IF TYP=13 THEN LET LEN=6912
180 PRINT TAB 10;".";P$(TYP TO TYP+2);TAB 15;LEN;TAB 21;
190 IF TYP=1 AND LNLOC<10000 THEN PRINT "L";LNLOC;TAB 27;LEN-VAR;
200 IF TYP=10 THEN PRINT LNLOC;TAB 27;INT (VAR/256)-2;
210 IF TYP=13 THEN PRINT 16384;
220 PRINT TAB 0;"*";
230 IF PEEK LOC<>0 THEN PRINT PEEK LOC;"*";: LET LOC=LOC+1: GO TO 230
240 POKE 23689,PEEK 23689+1: PRINT OVER 1;"________________________________"
250 LET BUF=BUF+32
260 PRINT TAB 0;
270 IF PEEK 23689=2 THEN PRINT #1;AT 1,0; INVERSE 1;" HIT ENTER TO CONTINUE "; INVERSE 0: PAUSE 0: GO TO 100
280 IF LOC>58992 THEN STOP
290 GO TO 110
300 LET E=PEEK LOC+256*PEEK (LOC+1): LET LOC=LOC+2: RETURN
310 REM ! CLOSE #
9999 ERASE "32COLDIR.BAS",: MOVE "32COLDIR.BAS",

LISTING 2

  10 REM !USR 50000
20 REM !INT +LOOP,LNLOC,VARS,LEN,LOC,B(),N,F
30 REM !LEN P$<=27
40 REM ! LIST
50 REM ! OPEN #
55 DATA INT 62,3,211,244,205,86,53,1,2,0,33,144,226,205,86,53,1,3,0,33,144,228,205,86,53,205,130,53,62,1,211,244,201
56 FOR F=59967 TO 59999: READ N: POKE F,N: NEXT f: RANDOMIZE USR 59967
60 RANDOMIZE USR 61450: POKE 23578,21: PRINT #4;CHR$ 3+CHR$ 62;CHR$ 0
70 LET LOOP=16: LET LOC=58031: DIM B(25)
80 LET P$="BASDATCHRBINSCRAROLROBUTVAR"
90 PRINT AT 0,0; INVERSE 1;" File Name Typ:Bytes+Vars :Line:Addr:Chunks:Tracks**************"; INVERSE 0
100 FOR F=1 TO LOOP
110 FOR N=1 TO 25: LET B(N)=PEEK (LOC+N): NEXT N
120 FOR N=2 TO 11: IF b(n)>31 THEN PRINT AT f,n-2;CHR$ b(n);
130 NEXT n: LET VARS=B(1)*3+1: PRINT TAB 10;".";P$(VARS TO VARS+2);TAB 15;
140 LET LEN=B(12)+256*B(13)
150 LET LNLOC=B(14)+256*B(15)
160 LET VARS=B(16)+256*B(17)
170 IF B(1)=0 THEN PRINT VARS;TAB 20;"+";LEN-VARS;TAB 27;(LNLOC AND LNLOC<10000);
180 IF B(1)=3 OR B(1)=8 THEN PRINT LEN;TAB 32;LNLOC;TAB 38;: IF b(1)=3 THEN PRINT B(17)-2;
190 IF B(1)=4 THEN PRINT 6912;TAB 32;16384;
200 PRINT TAB 44;: FOR N=18 TO 25: IF B(N)>0 THEN PRINT (B(N)-(87 AND B(N)>99));" ";
210 NEXT N
220 LET LOC=LOC+32
230 NEXT f
240 PRINT ' INVERSE 1;" HIT [ENTER] OR [FIRE BUTTON] TO CONTINUE "; INVERSE 0
250 IF INKEY$="" AND STICK (2,1)=0 THEN GO TO 250
260 PRINT CHR$ 0;: IF LOOP=15 THEN PRINT CHR$ 3+CHR$ 0;CHR$ 0: POKE 23578,6: STOP
270 LET LOOP=15: GO TO 90
280 REM ! CLOSE #
9999 OUT 244,1: ERASE "newdir.bas",: MOVE "newdir.bas",

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