image of READY prompt

Wang2200.org

Listing of file='TBO.ADI' on disk='vmedia/toolbox.wvd.zip'

# Sector 436, program filename = 'TBO.ADI'
0010 REM ! TBO.ADI 05/03/88  -- Analyze Disk Index
   : REM bp
0015 REM This program is a hack.  It does not currently validate the disk addr
     ess, validate the index structure and values, nor have disk error handlin
     g logic.
0020 REM %----- setup -----
0030 DIM S$(16)16,T$80,D$3,S(255),C(7),E(17),P(17),B$50
   : D$="D21"
0040 B$=HEX(C8)&ALL(HEX(CC))
0090 PRINT HEX(0204000F);HEX(0202000F);HEX(06);
0100 REM %----- display literals -----
0110 T$="I N D E X    U S A G E"
   : PRINT HEX(0D03);AT(0,(80-LEN(T$))/2);T$;
0120 PRINT AT(23,8);"% of Index Sectors vs. Number of Entries Used";
0130 PRINT AT(4,5);BOX(17,50);
0140 FOR I=0 TO 16
   : PRINT AT(4+I,1);
   : PRINTUSING "## -",16-I;
   : NEXT I
0150 FOR I=0 TO 50 STEP 5
   : PRINT AT(4,5+I);BOX(17,0);;AT(21,4+I);2*I;
   : NEXT I
0170 PRINT AT(4,59);"Index sectors:";AT(5,59);"End cat. area:";AT(6,59);"  Cur
     rent end:";
0180 PRINT AT(8,65);"No. of entries";AT(9,64);BOX(0,15);AT(9,71);"P:";AT(10,70
     );"SP:";AT(11,71);"D:";AT(12,70);"SD:";AT(13,66);"Unused:";AT(14,70);"21:
     ";AT(15,65);"Invalid:";
0190 PRINT AT(17,62);"Total used:";AT(18,60);"Total unused:";AT(19,66);"% used
     :";
0200 REM %---- disk address -----
   : PRINT AT(2,68);
   : LINPUT "Disk:"-D$
   : $TRAN(D$,"AaBbCcDdEeFf")R
   : PRINT HEX(06);
   : SELECT #1<D$>
0300 REM %----- clear values -----
   : FOR I=1 TO 17
   : PRINT AT(21-I,5,51);
   : NEXT I
0310 MAT S=ZER
   : MAT C=ZER
   : MAT E=ZER
   : MAT P=ZER
0320 FOR I=4 TO 19
   : IF I<>8 THEN PRINT AT(I,73,7);
   : NEXT I
0510 REM %---- index header -----
   : DATA LOAD BA T#1,(0)S$()
   : N=VAL(STR(S$(1),2))
   : PRINT AT(4,73);N;
   : IF STR(S$(1),1,1)=HEX(01) THEN PRINT "'"
   : PRINT AT(5,73);VAL(STR(S$(1),3,2),2)-1;AT(6,73);VAL(STR(S$(1),5,2),2)-1;
0560 REM %----- check content of each index sector -----
   : FOR I=0 TO N-1
   : PRINT AT(3,61);"Curr. Index:";I
   : DATA LOAD BA T#1,(I)S$()
   : FOR J=1 TO 16
   : IF I=0 AND J=1 THEN 580
   : S$=STR(S$(J),1,1) OR STR(S$(J),2,1)
0570 P=POS(HEX(002110119091)=S$)
   : C(P+1)=C(P+1)+1
   : IF P>2 THEN S(I+1)=S(I+1)+1
0580 NEXT J
   : PRINT AT(9,73);C(6);AT(10,73);C(7);AT(11,73);C(4);AT(12,73);C(5);AT(13,73
     );C(2);AT(14,73);C(3);AT(15,73);C(1);
   : NEXT I
0585 PRINT AT(3,60,20)
0590 REM --- totals ---
   : T=C(1)+C(4)+C(5)+C(6)+C(7)
   : F=C(2)+C(3)
   : PRINT AT(17,73);T;AT(18,73);F;AT(19,73);ROUND((T/(T+F)*100,0);
0680 REM --- no. of entries used sector counts ---
   : FOR I=1 TO N
   : E=S(I)+1
   : E(E)=E(E)+1
   : NEXT I
0700 REM %----- display frequencies of entries used -----
   : PRINT HEX(0202020F);
0710 FOR I=1 TO 17
   : P(I)=ROUND((E(I)/N*100,0)
   : ERRORGOTO 910
0715 IF P(I)=0 THEN 740
0720 PRINT AT(21-I,5);STR(B$,1,(P(I)+1)/2);
   : IF MOD(P(I),2)=0 THEN PRINT HEX(C4);
0740 NEXT I
   : PRINT HEX(0202000F);
0900 GOTO 200
0910 I=17
   : PRINT AT(3,67);"Index: No"
   : GOTO 740