image of READY prompt

Wang2200.org

Listing of file='GENEXER' on disk='vmedia/mvp-diag-2.6.2.wvd.zip'

# Sector 1812, program filename = 'GENEXER'
0010 %  This is GENEXER written by K.LeBaron, last updated 8/18/81
0360 DIM A$(48)3,C$1,C3$1,D$3,D$(35)3,E(35),E$(35)7,H$57,M$(35)8,P1$7,R$(35)1,
     R1$(16),Z$1
0370 A$()="310B10320B20330B30350B50360B60370B70D10D11D12D13D14D15D50D51D52D53D
     54D55D20D21D22D23D24D25D60D61D62D63D64D65D30D31D32D33D34D35D70D71D72D73D7
     4D75"
   : I=0
   : INIT(20)P1$
   : SELECT PRINT 005(80)
0380 H$="Available Address and Disk Model Determination"
   : GOSUB '35(H$)
0390 PRINT AT(12,13,56);TAB(25);"Mount all platters to be tested."
   : FOR I=1TO 9000
   : NEXT I
0400 PRINT AT(12,13);"Are all platters to be tested mounted? ( 'Y' or 'N' ) ";
   : INIT(00)C$
   : KEYIN C$,,400
   : PRINT HEX(0E);C$
   : IF C$="N"THEN 390
   : IF C$="Y"THEN 410
   : PRINT HEX(07)
   : GOTO 400
0410 PRINT AT(14,29);"please wait."
   : I=1
0420 FOR I3=1TO 48
   : D$(I)=A$(I3)
   : SELECT #2<D$(I)>
   : $OPEN 530,#2
   : ERRORGOTO 530
0430 PRINT HEX(060E);AT(14,41);"searching "
   : $GIODISKTYPE#2(0100020D120012121020120012120B0070A04100860B,R$)
   : ERRORGOTO 530
0440 IF STR(R$,8,1)=HEX(10)THEN 530
   : R$(I)=STR(R$,11,1)
0450 RESTORE
0460 DATA 65407,"Q2020",52607,"2280",32639,"1004",19583,"2260",16319,"1002",97
     91,"2230-3",8127,"1000",4799,"2230-2",3873,"850 DSDD",2399,"2230-1",1231,
     "2270a",1023,"2270",0,"UNKNOWN"
0470 READ E(I),M$(I)
   : IF E(I)=0THEN 530
   : GOTO 480
0480 IF R$(I)=HEX(D0)AND STR(D$(I),,1)="D"THEN 490
   : IF R$(I)=HEX(C0)AND STR(D$(I),,1)<>"D"THEN 500
   : GOTO 530
0490 IF M$(I)="2280"THEN 510
   : IF STR(M$(I),,3)="100"AND STR(D$(I),2,1)<=HEX(33)THEN 510
   : IF M$(I)="850 DSDD"AND STR(D$(I),2,1)<=HEX(33)THEN 510
   : IF M$(I)="Q2020"AND STR(D$(I),2,1)<=HEX(33)THEN 510
   : GOTO 470
0500 IF E(I)>1231THEN 510
   : IF STR(D$(I),,1)="3"THEN 510
   : IF STR(D$(I),,1)="B"AND STR(D$(I),2,1)<="3"THEN 510
   : GOTO 530
0510 PRINT AT(14,41);" searching"
   : X=0
   : VERIFY T#2,(E(I),E(I))E
   : IF E=0THEN 520
   : X=ERR
   : IF X<>93AND X<>95AND X<>96THEN 470
0520 STR(E$(I),,7)="I-   on"
   : CONVERT XTO STR(E$(I),3,2),(##)
   : IF X=0THEN E$(I)="       "
   : I=I+1
0530 NEXT I3
   : I=I-1
0540 I1=1
   : I2,I3=I
   : IF I>=20THEN I2=20
   : GOTO 560
0550 PRINT AT(22,34);"More Entries"
   : I1=21
   : I2=I3
   : GOSUB '50
   : PRINT AT(22,32,16)
0560 PRINT HEX(03);HEX(0E);"      Available Addresses             Disk Model
                Ending Sector"
0570 FOR I=I1TO I2
   : IF I2<>0THEN 580
   : D$(I)="N/A"
   : M$(I)="N/A"
0580 PRINT AT(I-I1+1,1);HEX(0E06);
   : PRINTUSING ">-   ####### ###          -< >-        ########     -< >-
        #####       -<",E$(I),D$(I),M$(I),E(I)
0590 PRINT AT(I-I1+1,1);">-";AT(I-I1+1,27);"-< >-";AT(I-I1+1,53);"-< >-";AT(I-
     I1+1,77);"-<"
0600 NEXT I
0610 PRINT AT(0,0);BOX(1,79);AT(1,0);BOX(I-I1+1,79);AT(1,29);BOX(I-I1+1,26)
0620 IF I3>20AND I2=20THEN 550
   : IF I3=0THEN 625
   : GOSUB '50
   : D$=D$(1)
   : GOTO 830
0625 PRINT HEX(070E);
   : STOP "PROGRAM ABORTED!    NO DISK DRIVES WILL RESPOND "
   : GOTO 625
0690 %
0830 DIM A$2,A1$1,C1$1,C2$1,C7$8,C8$1,C9$8,D1$2,E$5,E1$24,F$(2)8,K$(30)32,L$1,
     M1$(11)50,P$39,Q$5,S(24),S$5,T(14),T$1,T$(14)3,U$4,U1$5,W$(16),W1$(16),W9
     $(512)1,W9$1
0840 DEFFN'00
   : M1$(1)="I-90 Failed to communicate with controller"
   : M1$(2)="I-91 Failed to communicate with disk"
   : M1$(3)="I-92 Time out on a read or a write"
   : M1$(4)="I-93 Disk not formatted properly"
   : M1$(5)="I-94 Format key engaged"
0850 M1$(6)="I-95 Seek error"
   : M1$(7)="I-96 CRC error"
   : M1$(8)="I-97 LRC error"
   : M1$(9)="I-98 Platter not mounted or illegal sector address"
   : M1$(10)="I-99 Read after write error"
0860 K$(1)="This Screen"
   : K$(2)="Phoenix/LVP/SVP DPU Status"
   : K$(3)="Disk Compare"
   : K$(4)="Disk File Compare"
   : K$(5)="Display a Sector"
   : K$(6)="Sequential Verify"
   : K$(7)="Sequential Read"
   : K$(8)="Pseudorandom Verify"
   : K$(9)="Pseudorandom Read"
0870 K$(10)="Disk Write Enable"
   : K$(11)="Disk Scratch"
   : K$(12)="Disk Format"
   : K$(13)="Sequential Write"
   : K$(14)="Sequential Read After Write"
   : K$(15)="Pseudorandom Write"
   : K$(16)="Pseudorandom Read After Write"
0880 SELECT PRINT 005(80)
   : C,M,P1=0
   : H$="TEST SELECTION MENU"
   : GOSUB '35(H$)
   : K1=16
   : IF K1/2<>ROUND((K1/2,0)THEN K1=ROUND((K1/2,0)*2
   : IF STR(P1$,7,1)=" "THEN K1=K1/2+1
   : FOR K=1TO K1
   : GOSUB 890
   : NEXT K
   : $CLOSE
   : GOTO 920
0890 IF K$(K)=" "THEN K$(K)=HEX(0E617661696C61626C6520736C6F74)
   : CONVERT K-1TO A$,(##)
   : Z=K+1
   : Z1=2
   : IF K<=K1/2OR STR(P1$,7,1)=" "THEN 900
   : Z=K-K1/2+1
   : Z1=40
0900 PRINT AT(Z,Z1);
   : PRINTUSING "SF ## - ##############################",A$,K$(K)
   : RETURN
0920 PRINT AT(Z+2,8);"STRIKE THE SPECIAL FUNCTION KEY ASSOCIATED WITH THE DESI
     RED TEST";HEX(06)
0930 KEYIN A1$,,950
   : PRINT HEX(07)
   : GOTO 930
0950 IF A1$<>HEX(F0)THEN 970
   : PRINT AT(14,33,13);
   : P$=HEX(0006506C6561736520656E746572207468652070617373776F72642E222A82A201
     A99132373507)
   : INIT(20)P1$
0960 CONVERT STR(P$,36,2)TO I9
   : CONVERT STR(P$,I9+9,I9-25)TO I1
   : CONVERT STR(P$,I1+10,I1-26)TO I1
   : FOR I9=1TO I1
   : KEYIN STR(P1$,I9,I1-6)
   : PRINT "* ";
   : NEXT I9
   : ROTATE(P1$,I1-4)
   : CONVERT STR(P$,I1+30,I1-5)TO I1
   : I9=I1
   : IF P1$=STR(P$,I1-46,I1-68)THEN 880
   : PRINT STR(P$,I1-36,I1-74)
   : GOTO 950
0970 PRINT HEX(0E);
   : IF A1$<HEX(09)THEN 980
   : IF A1$<HEX(10)AND STR(P1$,7,1)<>" "THEN 990
   : PRINT HEX(070F)
   : GOTO 930
0980 ON VAL(A1$)GOTO 1000,1010,1020,1030,1040,1050,1060,1070
   : GOTO 880
0990 ON VAL(A1$)-8GOTO 1080,1090,1100,1110,1120,1130,1140
1000 K=2
   : GOTO 1150
1010 K=3
   : GOTO 1150
1020 K=4
   : GOTO 1150
1030 K=5
   : GOTO 1150
1040 K=6
   : GOTO 1150
1050 K=7
   : GOTO 1150
1060 K=8
   : GOTO 1150
1070 K=9
   : GOTO 1150
1080 K=10
   : GOTO 1150
1090 K=11
   : GOTO 1150
1100 K=12
   : GOTO 1150
1110 K=13
   : GOTO 1150
1120 K=14
   : GOTO 1150
1130 K=15
   : GOTO 1150
1140 K=16
1150 GOSUB 890
   : GOSUB '50
   : ON VAL(A1$)GOSUB 1190,1370,1650,2020,2290,2540,2770,3060,3280,3510,3750,4
     020,4340,4720,5070
   : GOTO 880
1160 %
1190 PRINT AT(15,0);
   : FOR I=1TO I3
   : IF STR(D$(I),3)<>"0"OR STR(D$(I),2,1)>"3"THEN 1230
   : SELECT #2<D$(I)>
   : R$=" "
1200 $GIOREADSTATUS#2(0600070070A0400288D070406A106816400087051A00C340,R$)R$;S
     TR(E1$,1,VAL(STR(R$,5,1)))
   : ERRORGOTO 1230
1210 IF STR(R$,6,3)<>HEX(000000)THEN GOTO 1230
1220 PRINT TAB(25);HEX(0E);
   : IF STR(E1$,,2)="20"THEN PRINT TAB(2);"SVP";
   : IF STR(E1$,,2)="19"THEN PRINT "Quantum";
   : IF STR(E1$,,2)="18"THEN PRINT TAB(2);"LVP";
   : IF STR(E1$,,2)="10"THEN PRINT "Phoenix";
   : PRINT HEX(0F);" DPU has Rev. ";HEX(0E);STR(E1$,4,2);HEX(0F);" proms."
1230 NEXT I
   : GOSUB '50
   : RETURN
1240 %
1370 M1=0
   : H$="DISK COMPARE ROUTINE"
   : GOSUB '35(H$)
   : PRINT AT(3,0);HEX(0E);"1st"
   : GOSUB '75(2)
   : PRINT AT(3,0);HEX(0E);"2nd"
   : GOSUB '75(3)
   : GOSUB '77
1380 PRINT AT(8,11);"Comparing ";HEX(0E);T$(2);HEX(0F);" to ";HEX(0E);T$(3);HE
     X(0F);TAB(43);"Comparing Sector ";
1390 PRINT AT(8,60);
   : GOSUB '39(S)
   : GOSUB '40(2,S)
   : IF X<>0THEN 1420
   : W$()=R1$()
1400 GOSUB '40(3,S)
   : IF X<>0THEN 1420
1410 IF R1$()=W$()THEN 1420
   : PRINT AT(16,27);HEX(070E);"The sectors are not equal."
   : GOSUB '50
   : PRINT AT(16,27,26)
1420 IF S=ETHEN 1430
   : S=S+1
   : GOTO 1390
1430 PRINT AT(18,26);"Disk compare routine complete"
   : GOSUB '50
   : RETURN
1440 %
1650 M1,P1,Y,Y1,Y2,Y3=0
   : H$="DISK FILE COMPARE ROUTINE"
   : GOSUB '35(H$)
1660 PRINT AT(4,0);HEX(0E);"1st"
   : GOSUB '75(2)
   : INIT(20)F$(1)
   : PRINT AT(5,12);"Enter the file name";
   : LINPUT HEX(0E)-F$(1)
1670 PRINT AT(4,0,160);HEX(0E);"2nd"
   : GOSUB '75(3)
   : PRINT AT(5,12);"Enter the file name";
   : LINPUT HEX(0E)-F$(2)
1680 D1=0
   : PRINT AT(4,0,);"Searching for file name ";HEX(0E);F$(1);HEX(0F);" on ";HE
     X(0E);T$(2)
1690 LIMITS T#2,STR(F$(1)),Y,Y1,U,D1
1700 IF D1<>0THEN 1710
   : PRINT HEX(070E);AT(4,0);F$(1);HEX(0F);" is not on disk ";HEX(0E);T$(2);"
                "
   : PRINT "Do you wish to re-input the file name? ( 'Y' or 'N' )";
   : LINPUT HEX(0E)C$
   : IF C$="Y"THEN 1720
   : GOTO 1840
1710 PRINT AT(4,0);"File name ";HEX(0E);F$(1);HEX(0F);" located on ";HEX(0E);T
     $(2);"      "
   : PRINT "First valid data sector=";HEX(0E);Y
   : PRINT "Last valid data sector= ";HEX(0E);Y+U-1
   : PRINT "Valid sectors compared=";HEX(0E);U
   : GOTO 1730
1720 INIT(20)F$(1)
   : PRINT AT(5,0,65);"Enter the file name";
   : LINPUT HEX(0E)-F$(1)
   : GOTO 1680
1730 Y1=Y+U-1
   : D1=0
   : PRINT AT(9,0,);"Searching for file name ";HEX(0E);F$(2);HEX(0F);" on ";HE
     X(0E);T$(3)
1740 LIMITS T#3,STR(F$(2)),Y2,Y3,U1,D1
1750 IF D1<>0THEN 1760
   : PRINT HEX(070E);AT(9,0);F$(2);HEX(0F);" is not on disk ";HEX(0E);T$(3);"
                "
   : PRINT "Do you wish to re-input the file name? ( 'Y' or 'N' )";
   : LINPUT HEX(0E)C$
   : IF C$="Y"THEN 1770
   : GOTO 1840
1760 PRINT AT(9,0);"File name ";HEX(0E);F$(2);HEX(0F);" located on ";HEX(0E);T
     $(3);"      "
   : PRINT "First valid data sector=";HEX(0E);Y2
   : PRINT "Last valid data sector= ";HEX(0E);Y2+U1-1
   : PRINT "Valid sectors compared=";HEX(0E);U1
   : GOTO 1780
1770 INIT(20)F$(1)
   : PRINT AT(10,0,65);"Enter the file name";
   : LINPUT HEX(0E)-F$(2)
   : GOTO 1730
1780 Y3=Y2+U1-1
   : IF U1=UTHEN 1790
   : PRINT AT(7,30);HEX(0E);"<-";
   : GOSUB '90
   : PRINT AT(12,30);HEX(0E);"<-";
   : GOSUB '90
   : GOTO 1840
1790 PRINT AT(14,0);"Comparing sector         on ";HEX(0E);T$(2);HEX(0F);" to
     sector         on ";HEX(0E);T$(3)
1800 PRINT AT(14,17);
   : GOSUB '39(Y)
   : GOSUB '40(2,Y)
   : W$()=R1$()
1810 PRINT AT(14,42);
   : GOSUB '39(Y2)
   : GOSUB '40(3,Y2)
1820 IF R1$()=W$()THEN 1830
   : PRINT AT(16,27);HEX(070E);"The sectors are not equal."
   : GOSUB '50
   : PRINT AT(16,27,26)
1830 IF Y=Y1THEN 1840
   : Y=Y+1
   : Y2=Y2+1
   : GOTO 1800
1840 PRINT AT(18,22);"Disk file compare routine complete"
   : GOSUB '50
   : RETURN
1850 %
2020 H$="DISPLAY A SECTOR ROUTINE"
   : GOSUB '35(H$)
   : S$="00000"
2030 PRINT AT(20,4);"Disk: \A0\A0\A0";AT(20,24);"Sector: \A0\A0\A0\A0\A0"
2040 PRINT AT(19,4);"from sf 0";AT(19,26);"from sf 1"
2050 PRINT AT(3,4);"0000";AT(4,4);"0032";AT(5,4);"0064";AT(6,4);"0096";AT(7,4)
     ;"0128";AT(8,4);"0160";AT(9,4);"0192";AT(10,4);"0224";AT(12,4);"0000";AT(
     13,4);"0064";AT(14,4);"0128";AT(15,4);"0192"
2060 PRINT AT(17,10,70);AT(20,58);HEX(0E);"Enter Disk Address";AT(20,9);
   : LINPUT HEX(0E)-D$
   : GOSUB '74(D$,2)
   : IF D1$=HEX(0000)THEN 2060
2070 PRINT AT(20,56);HEX(0E);"Enter Sector Address";AT(20,31);
   : LINPUT HEX(0E)-S$
   : IF S$<>"CLEAR"THEN 2080
   : C$=HEX(81)
   : GOTO 2070
2080 PRINT AT(20,56,20)
2090 CONVERT S$TO S
   : IF C$=HEX(81)THEN 2100
   : IF S>T(2)THEN 2070
2100 L$="N"
   : GOSUB '40(2,S)
   : IF X<>0THEN 2060
2110 PRINT AT(3,12);HEX(06);
   : FOR R=1TO 8
   : FOR C=1TO 32
   : C$=STR(R1$(),C+32*(R-1),1)
   : PRINT HEXOF(C$);
   : NEXT C
   : PRINT HEX(0D0A090909090909090909090909);
   : NEXT R
2120 PRINT AT(12,12);HEX(06);
   : FOR R=1TO 4
   : FOR C=1TO 64
   : C$=STR(R1$(),C+64*(R-1),1)
   : IF C$>HEX(0F)THEN 2130
   : C$=HEX(80)
   : PRINT HEX(0202020F);
2130 PRINT C$;HEX(0202000F);
   : NEXT C
   : PRINT HEX(0D0A090909090909090909090909);
   : NEXT R
2140 PRINT AT(20,71);HEX(060E);"READY";AT(23,26);"Key 'EDIT' to return to menu
     ";HEX(0F);
   : KEYIN C$,,2150
   : GOTO 2140
2150 IF C$=HEX(F0)THEN RETURN
   : PRINT AT(20,71,)
   : IF C$=HEX(00)THEN 2060
   : IF C$<>HEX(01)THEN 2140
   : S=S+1
   : CONVERT STO S$,(#####)
   : GOTO 2070
2160 %
2290 GOSUB '59
   : L=0
   : H$="SEQUENTIAL VERIFY ROUTINE"
   : GOSUB '35(H$)
   : T(3)=90000
   : GOSUB '75(2)
   : GOSUB '77
2300 FOR I=STO E
   : IF I=SOR L<>0THEN PRINT AT(11,18);
   : ELSE PRINT TAB(18);
   : PRINT "Verifying Sector: ";
   : GOSUB '39(I)
   : C=0
2310 GOSUB '76(I,2)
   : IF L=0OR L$="N"THEN 2320
   : GOSUB '60
   : GOTO 2310
2320 NEXT I
   : PRINT AT(4,0,30);HEX(0E);
   : IF L=0THEN PRINT "O.K. on ";T$(2)
   : ELSE PRINT "ERROR on ";T$(2)
2330 PRINT AT(18,22);"Sequential Verify Routine Completed"
   : GOSUB '50
   : RETURN
2340 %
2540 GOSUB '59
   : GOSUB '61
   : P=1
   : M1,P1=0
   : H$="SEQUENTIAL READ ROUTINE"
   : GOSUB '35(H$)
   : T(3)=90000
   : GOSUB '75(2)
   : GOSUB '77
2550 PRINT AT(8,0);"Is there a specific ";HEX(0E);"HEX";HEX(0F);" pattern that
      you expect to read? ('Y' or 'N') ";
   : KEYIN C3$,,2550
   : PRINT HEX(0E);C3$
   : IF C3$="N"THEN 2560
   : IF C3$<>"Y"THEN 2550
   : GOSUB '72
2560 PRINT AT(8,0,80)
   : FOR I=STO E
   : IF I=SOR X<>0THEN PRINT AT(11,20);
   : ELSE PRINT TAB(20);
   : PRINT "Reading Sector: ";
   : GOSUB '39(I)
   : C=0
2570 GOSUB '40(2,I)
   : IF X=0OR L$="N"THEN 2580
   : GOSUB '60
   : GOTO 2570
2580 IF C3$="N"OR R1$()=W1$()THEN 2590
   : GOSUB '32
   : IF L$="N"THEN 2590
   : GOSUB '60
   : GOTO 2570
2590 NEXT I
   : IF C1$="2"THEN 2600
   : GOSUB '63
   : GOTO 2560
2600 PRINT AT(4,0,30);HEX(0E);
   : IF P1<>3AND M1=0THEN PRINT "O.K. on ";T$(2)
   : ELSE PRINT "ERROR on ";T$(2)
2610 PRINT AT(18,23);"Sequential Read Routine Completed"
   : GOSUB '50
   : RETURN
2620 %
2770 GOSUB '59
   : L=0
   : H$="PSEUDORANDOM VERIFY ROUTINE"
   : GOSUB '35(H$)
   : T(3)=90000
   : GOSUB '75(2)
   : GOSUB '77
2780 FOR I=0TO M
2790 Q=S+I
   : GOSUB 2830
   : IF S+I=E-ITHEN 2810
2800 Q=E-I
   : GOSUB 2830
2810 NEXT I
   : PRINT AT(4,0,30);HEX(0E);
   : IF L=0THEN PRINT "O.K. on ";T$(2)
   : ELSE PRINT "ERROR on ";T$(2)
2820 PRINT AT(18,21);"Pseudorandom Verify Routine Completed"
   : GOSUB '50
   : RETURN
2830 IF Q=SOR L<>0THEN PRINT AT(11,18);
   : ELSE PRINT TAB(18);
   : PRINT "Verifying Sector: ";
   : GOSUB '39(Q)
   : C=0
2840 GOSUB '76(Q,2)
   : IF L=0OR L$="N"THEN RETURN
   : GOSUB '60
   : GOTO 2840
2850 %
3060 GOSUB '59
   : GOSUB '61
   : P=1
   : M1,P1=0
   : H$="PSEUDORANDOM READ ROUTINE"
   : GOSUB '35(H$)
   : T(3)=90000
   : GOSUB '75(2)
   : GOSUB '77
3070 PRINT AT(8,0);"Is there a specific ";HEX(0E);"HEX";HEX(0F);" pattern that
      you expect to read? ('Y' or 'N') ";
   : KEYIN C3$,,3070
   : PRINT HEX(0E);C3$
   : IF C3$="N"THEN 3080
   : IF C3$<>"Y"THEN 3070
   : GOSUB '72
3080 PRINT AT(8,0,80)
   : FOR I=0TO M
3090 Q=S+I
   : GOSUB 3140
   : IF S+I=E-ITHEN 3110
3100 Q=E-I
   : GOSUB 3140
3110 NEXT I
   : IF C1$="2"THEN 3120
   : GOSUB '63
   : GOTO 3080
3120 PRINT AT(4,0,30);HEX(0E);
   : IF P1<>3AND M1=0THEN PRINT "O.K. on ";T$(2)
   : ELSE PRINT "ERROR on ";T$(2)
3130 PRINT AT(18,22);"Pseudorandom Read Routine Completed"
   : GOSUB '50
   : RETURN
3140 IF Q=SOR X<>0THEN PRINT AT(11,20);
   : ELSE PRINT TAB(20);
   : PRINT "Reading Sector: ";
   : GOSUB '39(Q)
   : C=0
3150 GOSUB '40(2,Q)
   : IF X=0OR L$="N"THEN 3160
   : GOSUB '60
   : GOTO 3150
3160 IF C3$="N"OR R1$()=W1$()THEN RETURN
   : GOSUB '32
   : IF L$="N"THEN RETURN
   : GOSUB '60
   : GOTO 3150
3170 %
3280 M1=0
   : H$="DISK WRITE ENABLE ROUTINE"
   : GOSUB '35(H$)
   : T(3)=90000
   : GOSUB '75(2)
3290 PRINT AT(6,11,);"Initializing disk ";HEX(0E);T$(2);HEX(0F);TAB(50);"Secto
     r";HEX(0E);T(2)
3300 INIT(A5)W1$()
   : W1$(1)="SCRATCH DISK"
   : GOSUB '41(2,T(2),W1$())
   : IF X=0THEN 3330
3310 PRINT AT(10,6);"Do you want to Format this disk? ('Y' OR 'N')";
   : INIT(00)C$
   : LINPUT HEX(0E)C$
   : IF C$="Y"THEN 3320
   : IF C$<>"N"THEN 3310
   : GOTO 3340
3320 GOSUB '241(2,T$(2))
   : IF X=0THEN 3290
   : GOTO 3340
3330 PRINT AT(6,73);HEX(0E);"O.K."
3340 PRINT AT(18,21);"Disk Write Enable Routine Completed"
   : GOSUB '50
   : RETURN
3350 %
3510 M1=0
   : H$="DISK SCRATCH ROUTINE"
   : GOSUB '35(H$)
   : T(3)=90000
   : GOSUB '75(2)
3520 U$="16"
   : IF T(2)>1231THEN U$="47"
   : IF T(2)=52607THEN U$="24"
   : CONVERT T(2)TO U1$,(#####)
   : PRINT AT(4,0,)
3530 PRINT AT(4,7);"How many sectors do you wish to dedicate to catalog index
     area?";
   : LINPUT HEX(0E)U$
   : CONVERT U$TO U
   : ERRORGOTO 3530
3540 IF U>T(2)THEN 3530
3550 PRINT AT(6,9);"How many sectors do you wish to dedicate to catalog area?"
     ;
   : LINPUT HEX(0E)U1$
   : CONVERT U1$TO U1
   : ERRORGOTO 3550
3560 IF U1>T(2)THEN 3550
3570 PRINT HEX(06);AT(4,0,);"Scratching disk ";HEX(0E);T$(2);HEX(0F);AT(5,0);"
     Last index sector =";HEX(0E);U-1;HEX(0F);AT(6,0);"Catalog end =";HEX(0E);
     U1
3580 SCRATCH DISK T#2,LS=U,END =U1
   : ERRORX=ERR
   : GOSUB '70(X,2)
   : GOTO 3620
3590 PRINT AT(4,0);"Verifying disk scratch on ";HEX(0E);T$(2)
   : INIT(00)W1$()
   : STR(W1$(),1,2),STR(W1$(),3,2)=BIN(U,2)
   : STR(W1$(),5,2)=BIN(U1+1,2)
3600 GOSUB '40(2,0)
   : IF X<>0THEN 3620
3610 IF R1$()=W1$()THEN 3640
3620 PRINT HEX(0706);AT(10,25);"Disk did not scratch properly.";AT(11,25);"Do
     you wish to:";AT(12,27);"(1) re-scratch";AT(13,27);"(2) re-format";AT(14,
     25);"(defaults back to menu)";
   : C$=HEX(20)
   : LINPUT HEX(0E)C$
   : IF C$="1"THEN 3570
   : IF C$<>"2"THEN 3620
3630 GOSUB '241(2,T$(2))
   : IF X=0THEN 3580
   : GOTO 3650
3640 PRINT AT(4,0,30);HEX(0E);
   : IF M1=0THEN PRINT "O.K. on ";T$(2)
   : ELSE PRINT "ERROR on ";T$(2)
3650 PRINT AT(18,25);"Disk Scratch Routine Completed"
   : GOSUB '50
   : RETURN
3660 GOSUB '50
   : RETURN
3670 %
3750 M1=0
   : H$="DISK FORMAT ROUTINE"
   : GOSUB '35(H$)
   : PRINT AT(10,11);"Enter the address you wish to FORMAT."
3760 PRINT AT(10,48);
   : LINPUT HEX(0E)-D$
   : GOSUB '74(D$,2)
   : IF D1$=HEX(0000)THEN 3760
3770 GOSUB '241(2,D$)
3780 PRINT AT(15,26,);"Disk FORMAT routine complete"
   : GOSUB '50
   : RETURN
3790 %
4020 GOSUB '59
   : GOSUB '61
   : GOSUB '62
   : P=1
   : M1=0
   : H$="SEQUENTIAL WRITE ROUTINE"
   : GOSUB '35(H$)
   : T(3)=90000
   : GOSUB '75(2)
   : GOSUB '34(2,T(2))
   : GOSUB '77
4030 PRINT AT(8,0);"Is there a ";HEX(0E);"HEX";HEX(0F);" pattern that you want
      to write? ('Y' or 'N') ";
   : KEYIN C3$,,4030
   : PRINT HEX(0E);C3$
   : IF C3$="N"THEN 4040
   : IF C3$<>"Y"THEN 4030
   : GOSUB '72
4040 PRINT AT(8,0,80)
   : IF T$=HEX(D0)THEN PRINT AT(0,68);HEX(0E);"multi-sector"
   : I1=S
   : FOR I=STO E
   : IF I=SOR X<>0THEN PRINT AT(11,19);
   : ELSE PRINT TAB(19);
   : PRINT "Writing Sector: ";
   : GOSUB '39(I)
   : IF T$=HEX(D0)AND I=I1THEN GOSUB '200(D)
4050 C=0
   : IF C3$="Y"THEN 4060
   : STR(W1$(1),1,6),STR(W1$(1),11,6)=Q$
   : STR(W1$(1),7,4)=T$(2)
   : FOR I2=2TO 16
   : W1$(I2)=W1$(I2-1)
   : ROTATEC(W1$(I2),3)
   : W1$(I2)=XOR W1$(17-I2)
   : NEXT I2
4060 GOSUB '41(2,I,W1$())
   : IF X=0OR L$="N"OR T$=HEX(D0)THEN 4070
   : GOSUB '60
   : GOTO 4060
4070 IF T$=HEX(C0)OR I<I1+7THEN 4080
   : I1=I+1
   : GOSUB '201(D)
4080 NEXT I
   : IF I1<>IAND T$=HEX(D0)THEN GOSUB '201(D)
   : IF C1$="2"THEN 4090
   : GOSUB '63
   : GOTO 4040
4090 PRINT AT(4,0,30);HEX(0E);
   : IF M1=0THEN PRINT "O.K. on ";T$(2)
   : ELSE PRINT "ERROR on ";T$(2)
4100 PRINT AT(18,23);"Sequential Write Routine Completed"
   : GOSUB '50
   : RETURN
4110 %
4340 GOSUB '59
   : GOSUB '61
   : GOSUB '62
   : P=1
   : M1=0
   : H$="SEQUENTIAL READ AFTER WRITE ROUTINE"
   : GOSUB '35(H$)
   : T(3)=90000
   : GOSUB '75(2)
   : GOSUB '71
   : IF C2$="1"THEN 4350
   : D=2
   : GOSUB '34(D,T(D))
4350 I1=D
   : GOSUB '77
4360 FOR I=STO E
   : IF C2$="2"THEN 4370
   : FOR D=2TO I1
   : PRINT AT(4,19);HEX(0E);T$(D)
4370 IF C2$="1"OR I=SOR X<>0THEN PRINT AT(11,20);
   : ELSE PRINT TAB(20);
   : PRINT "This is Sector: ";
   : GOSUB '39(I)
4380 STR(W1$(1),1,6),STR(W1$(1),11,6)=Q$
   : STR(W1$(1),7,4)=T$(D)
   : FOR I2=2TO 16
   : W1$(I2)=W1$(I2-1)
   : ROTATEC(W1$(I2),3)
   : W1$(I2)=XOR W1$(17-I2)
   : NEXT I2
   : C=0
4390 GOSUB '41(D,I,W1$())
   : IF X=0OR L$="N"THEN 4400
   : GOSUB '60
   : GOTO 4390
4400 GOSUB '40(D,I)
   : IF X=0OR L$="N"THEN 4410
   : GOSUB '60
   : GOTO 4390
4410 IF R1$()=W1$()THEN 4420
   : GOSUB '32
   : IF L$="N"THEN 4420
   : GOSUB '60
   : GOTO 4390
4420 IF C2$="2"THEN 4430
   : NEXT D
4430 NEXT I
   : PRINT AT(4,0,30);HEX(0E);
   : IF M1<>0AND P<>3THEN 4440
   : IF C2$="2"THEN PRINT "O.K. on ";T$(D)
   : ELSE PRINT "O.K. on all addresses"
   : GOTO 4450
4440 IF C2$="2"THEN PRINT "ERROR on ";T$(D)
   : ELSE PRINT "ERROR"
4450 IF C1$="2"THEN 4460
   : GOSUB '63
   : IF C2$="2"THEN 4360
   : PRINT AT(4,0);"Address:           ";HEX(0E);T$(2)
   : GOTO 4360
4460 PRINT AT(18,18);"Sequential Read After Write Routine Completed"
   : GOSUB '50
   : RETURN
4470 %
4720 GOSUB '59
   : GOSUB '61
   : GOSUB '62
   : P=1
   : M1=0
   : H$="PSEUDORANDOM WRITE ROUTINE"
   : GOSUB '35(H$)
   : T(3)=90000
   : GOSUB '75(2)
   : GOSUB '34(2,T(2))
   : GOSUB '77
4730 PRINT AT(8,0);"Is there a ";HEX(0E);"HEX";HEX(0F);" pattern that you want
      to write? ('Y' or 'N') ";
   : KEYIN C3$,,4730
   : PRINT HEX(0E);C3$
   : IF C3$="N"THEN 4740
   : IF C3$<>"Y"THEN 4730
   : GOSUB '72
4740 PRINT AT(8,0,80)
   : I1=S
   : FOR I=0TO M
4750 Q=S+I
   : GOSUB 4800
   : IF S+I=E-ITHEN 4770
4760 Q=E-I
   : GOSUB 4800
4770 NEXT I
   : IF C1$="2"THEN 4780
   : GOSUB '63
   : GOTO 4740
4780 PRINT AT(4,0,30);HEX(0E);
   : IF M1=0THEN PRINT "O.K. on ";T$(2)
   : ELSE PRINT "ERROR on ";T$(2)
4790 PRINT AT(18,22);"Pseudorandom Write Routine Completed"
   : GOSUB '50
   : RETURN
4800 IF Q=SOR X<>0THEN PRINT AT(11,20);
   : ELSE PRINT TAB(20);
   : PRINT "Writing Sector: ";
   : GOSUB '39(Q)
4810 C=0
   : IF C3$="Y"THEN 4820
   : STR(W1$(1),1,6),STR(W1$(1),11,6)=Q$
   : STR(W1$(1),7,4)=T$(2)
   : FOR I2=2TO 16
   : W1$(I2)=W1$(I2-1)
   : ROTATEC(W1$(I2),3)
   : W1$(I2)=XOR W1$(17-I2)
   : NEXT I2
4820 GOSUB '41(2,Q,W1$())
   : IF X=0OR L$="N"OR T$=HEX(D0)THEN RETURN
   : GOSUB '60
   : GOTO 4820
4830 %
5070 GOSUB '59
   : GOSUB '61
   : GOSUB '62
   : P=1
   : M1=0
   : H$="PSEUDORANDOM READ AFTER WRITE ROUTINE"
   : GOSUB '35(H$)
   : T(3)=90000
   : GOSUB '75(2)
   : GOSUB '71
   : IF C2$="1"THEN 5080
   : D=2
   : GOSUB '34(D,T(D))
   : GOSUB '77
   : GOTO 5090
5080 I1=D
   : GOSUB '77
5090 FOR I=0TO M
5100 Q=S+I
   : GOSUB 5160
   : IF S+I=E-ITHEN 5120
5110 Q=E-I
   : GOSUB 5160
5120 NEXT I
   : PRINT AT(4,0,30);HEX(0E);
   : IF M1<>0AND P<>3THEN 5130
   : IF C2$="2"THEN PRINT "O.K. on ";T$(D)
   : ELSE PRINT "O.K. on all addresses"
   : GOTO 5140
5130 IF C2$="2"THEN PRINT "ERROR on ";T$(D)
   : ELSE PRINT "ERROR"
5140 IF C1$="2"THEN 5150
   : GOSUB '63
   : IF C2$="2"THEN 5090
   : PRINT AT(4,0);"Address:           ";HEX(0E);T$(D)
   : GOTO 5090
5150 PRINT AT(18,18);"Pseudorandom Read After Write Routine Completed"
   : GOSUB '50
   : RETURN
5160 IF C2$="2"THEN 5170
   : FOR D=2TO I1
   : PRINT AT(4,19);HEX(0E);T$(D)
5170 IF C2$="1"OR Q=SOR X<>0THEN PRINT AT(11,20);
   : ELSE PRINT TAB(20);
   : PRINT "This is Sector: ";
   : GOSUB '39(Q)
   : STR(W1$(1),1,6),STR(W1$(1),11,6)=Q$
   : STR(W1$(1),7,4)=T$(D)
   : FOR I2=2TO 16
   : W1$(I2)=W1$(I2-1)
   : ROTATEC(W1$(I2),3)
   : W1$(I2)=XOR W1$(17-I2)
   : NEXT I2
   : C=0
5180 GOSUB '41(D,Q,W1$())
   : IF X=0OR L$="N"THEN 5190
   : GOSUB '60
   : GOTO 5180
5190 GOSUB '40(D,Q)
   : IF X=0OR L$="N"THEN 5200
   : GOSUB '60
   : GOTO 5180
5200 IF R1$()=W1$()THEN 5210
   : GOSUB '32
   : IF L$="N"THEN 5210
   : GOSUB '60
   : GOTO 5180
5210 IF C2$="2"THEN RETURN
   : NEXT D
   : RETURN
5220 %
5710 DEFFN'32
   : IF ERR<>0THEN RETURN
   : PRINT AT(16,18);
   : GOSUB '90
   : PRINT " Data read does not equal data expected"
   : IF L$="N"THEN 5730
5720 PRINT AT(16,17,383)
   : P1=3
   : RETURN
5730 P1=3
5740 FOR B=1TO 256
   : IF STR(R1$(),B,1)=STR(W1$(),B,1)THEN 5790
   : PRINT AT(18,17);HEX(06);"Read  byte is hex(";HEX(0E);HEXOF(STR(R1$(),B,1)
     );HEX(0F);")";AT(19,17);"Write byte is hex(";HEX(0E);HEXOF(STR(W1$(),B,1)
     );HEX(0F);")"
5750 W$()=R1$()
   : GOSUB 5770
   : C7$=C9$
   : PRINT AT(18,38);", in binary is ";C7$
   : W$()=W1$()
   : GOSUB 5770
   : PRINT AT(19,38);", in binary is ";C9$
   : PRINT AT(20,17);HEX(07);"Byte";HEX(0E);B;HEX(0F);"bits not equal (<>)
              "
   : FOR I1=1TO 8
   : IF STR(C7$,I1,1)=STR(C9$,I1,1)THEN 5760
   : PRINT AT(20,52+I1,8);HEX(0E);"^";
5760 NEXT I1
   : GOSUB '50
   : GOTO 5790
5770 C9$=ALL(30)
   : Z$=HEX(01)
   : FOR I1=1TO 8
   : ROTATEC(Z$,-1)
   : C8$=STR(W$(),B,1)AND Z$
   : GOSUB 5780
   : NEXT I1
   : RETURN
5780 IF C8$<>HEX(00)THEN STR(C9$,I1,1)=HEX(31)
   : RETURN
5790 NEXT B
   : RETURN
5800 DEFFN'34(D,T(D))
   : INIT(A5)W1$()
   : W1$(1)="SCRATCH DISK"
   : GOSUB '40(D,T(D))
   : IF X=0THEN 5810
   : GOSUB '50
   : RETURN CLEAR ALL
   : GOTO 880
5810 IF R1$()=W1$()THEN RETURN
   : PRINT HEX(070E);AT(15,21);D$;HEX(0F);" is not an initialized scratch disk
     ";AT(17,10);"Either initialize ";HEX(0E);D$;HEX(0F);" or mount a pre-init
     ialized scratch disk"
   : GOSUB '50
5820 RETURN CLEAR ALL
   : GOTO 830
5830 DEFFN'35(H$)
   : H$=H$&"  Rev. 6174"
   : PRINT HEX(03060E);AT(0,(80-LEN(H$))/2);H$;AT(1,(80-LEN(H$))/2-1);BOX(0,LE
     N(H$)+1)
   : RETURN
5840 DEFFN'39(Q)
   : CONVERT QTO Q$,(#####)
   : PRINT BOX(1,6);HEX(20060E);Q$;HEX(0F0D);
   : RETURN
5850 DEFFN'40(D,R1)
   : X=0
   : DATA LOAD BA T#D,(R1)R1$()
   : ERRORX=ERR
   : GOSUB '70(X,D)
5860 RETURN
5870 DEFFN'41(D,W1,W1$())
   : X=0
   : DATA SAVE BA T#D,(W1)W1$()
   : ERRORX=ERR
   : GOSUB '70(X,D)
5880 RETURN
5890 DEFFN'42(D,E)
   : S(1)=0
   : S(2)=8
   : S(3)=1
   : S(4)=9
   : S(5)=2
   : S(6)=10
   : S(7)=3
   : S(8)=11
   : S(9)=4
   : S(10)=12
   : S(11)=5
   : S(12)=13
   : S(13)=6
   : S(14)=14
   : S(15)=7
   : S(16)=15
   : FOR I1=0TO 76
   : FOR I=1TO 16
   : V=I1*16+S(I)
   : IF V>ETHEN 5900
   : VERIFY T#D,(V,V)L
5900 NEXT I,I1
   : RETURN
5910 DEFFN'50
   : PRINT HEX(060E);AT(23,28);"Key 'RETURN' to continue";
   : KEYIN C$,,5920
   : IF C$<>HEX(0D)THEN 5910
   : INIT(00)C$
   : PRINT AT(23,28,24);HEX(0F);
   : RETURN
5920 IF C$<>HEX(F0)THEN 5910
   : INIT(00)C$
   : RETURN CLEAR ALL
   : GOTO 830
5930 DEFFN'59
   : PRINT AT(14,8);"Do you wish to loop on error? ";
   : LINPUT HEX(0E)L$
   : IF L$<>"Y"AND L$<>"N"THEN 5930
   : RETURN
5940 DEFFN'60
   : C$=HEX(00)
   : KEYIN C$,5950,5960
5950 C=C+1
   : PRINT AT(22,35);"Loop#";C;HEX(0C);
   : IF C<>9999THEN RETURN
   : PRINT HEX(07);AT(22,40,5)
   : C=1
   : RETURN
5960 RETURN CLEAR ALL
   : GOTO 880
5970 DEFFN'61
   : PRINT AT(16,8);"Is this a (1) burn-in or (2) other? ";
   : LINPUT HEX(0E)C1$
   : IF C1$<>"1"AND C1$<>"2"THEN 5970
   : RETURN
5980 DEFFN'62
   : PRINT HEX(03070E);AT(12,0);"This test will \E4\E5\F3\F4\F2\EF\F9 the data
      on the disk. If you want to abort, key 'EDIT'."
   : GOSUB '50
   : RETURN
5990 DEFFN'63
   : P=P+1
   : PRINT AT(0,0);HEX(0E);"Pass#";P
   : RETURN
6000 DEFFN'70(X,D)
   : IF M1=X-89AND C<>0THEN RETURN
   : M1=X-89
   : PRINT AT(17,10,70);
   : GOSUB '90
   : PRINT M1$(M1);" on disk ";HEX(0E);T$(D)
   : IF L$="Y"THEN RETURN
   : GOSUB '50
   : PRINT AT(17,10,70)
   : RETURN
6010 DEFFN'71
   : IF M$(D1)<>"850 DSDD"AND STR(M$(D1),,3)<>"100"THEN 6015
   : C2$="2"
   : RETURN
6015 PRINT AT(13,12);"Do you want to test (1) all the platters on that ";M$(D1
     );HEX(0A0D);TAB(32);"(2) or just ";T$(2);" ?";
   : LINPUT HEX(0E)C2$
   : IF C2$="2"THEN RETURN
   : IF C2$<>"1"THEN 6010
   : D=2
6020 STR(D$,2,1)=AND HEX(33)
   : IF STR(D$,,1)="D"THEN 6030
   : STR(D$,,1)="3"
   : GOSUB 6040
   : STR(D$,,1)="B"
   : GOSUB 6040
   : STR(D$,2,1)=ADDHEX(04)
   : STR(D$,,1)="3"
   : GOSUB 6040
   : STR(D$,,1)="B"
   : GOSUB 6040
   : T(3)=T(2)
   : RETURN
6030 STR(D$,3)="0"
   : GOSUB 6040
   : FOR I=1TO 5
   : STR(D$,3)=ADDHEX(01)
   : GOSUB 6040
   : NEXT I
   : STR(D$,2,1)=OR HEX(04)
   : STR(D$,3)="0"
   : GOSUB 6040
   : FOR I=1TO 5
   : STR(D$,3)=ADDHEX(01)
   : GOSUB 6040
   : NEXT I
   : T(3)=T(2)
   : RETURN
6040 IF D$=T$(2)THEN 6050
   : D=D+1
   : GOSUB '74(D$,D)
   : IF D1$=HEX(0000)THEN D=D-1
   : IF D1$=HEX(0000)THEN RETURN
   : IF T(D)=T(2)THEN 6050
   : PRINT AT(15,23);HEX(0E);T$(D);HEX(0F);" cannot be tested in this mode.";H
     EX(0C0D);
   : SELECT #D/000
   : D=D-1
   : GOSUB '50
   : RETURN
6050 GOSUB '34(D,T(D))
   : RETURN
6060 DEFFN'72
   : I=0
   : W9$=" "
   : INIT(20)W9$()
   : PRINT AT(9,0);"Enter that pattern. \A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A
     0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0\A0";AT(9,20);HEX(
     05);
6070 KEYIN W9$,,6070
   : IF W9$=HEX(0D)OR I=32THEN 6100
   : IF W9$=HEX(08)AND I>0THEN 6080
   : IF W9$>=HEX(30)AND W9$<=HEX(39)OR W9$>=HEX(41)AND W9$<=HEX(46)THEN 6090
   : GOTO 6070
6080 W9$(I)=" "
   : I=I-1
   : PRINT HEX(080E);HEX(0F);
   : GOTO 6070
6090 I=I+1
   : W9$(I)=W9$
   : PRINT HEX(0E);W9$;HEX(0F);
   : GOTO 6070
6100 IF W9$(1)=" "THEN 6060
   : W9$()=W9$()&STR(W9$())
   : HEXPACKW1$()FROMW9$()
   : PRINT HEX(06);
   : RETURN
6110 DEFFN'74(D$,D)
   : MAT SEARCHD$(),=D$TO D1$STEP 3
   : IF D1$=HEX(0000)THEN RETURN
   : D1=((VAL(D1$,2)+2)/3)
   : SELECT #D<D$>
   : $OPEN #D
   : T$=R$(D1)
   : T$(D)=D$(D1)
   : T(D)=E(D1)
   : RETURN
6120 DEFFN'75(D)
   : PRINT AT(4,12);"Which platter or surface do you wish to work with?";AT(6,
     12);"Your choices are:"
6130 PRINT HEX(0A)
   : FOR I=1TO I3
   : IF P1=13AND STR(D$(I),,1)="B"THEN 6140
   : IF P1=13AND STR(D$(I),,1)="D"AND STR(D$(I),3)="0"THEN 6140
   : IF P1=13AND E(I)<1232AND STR(D$(I),2)>HEX(3430)THEN 6140
   : PRINT HEX(2020202020200E);D$(I),
6140 NEXT I
6150 PRINT AT(4,63);
   : LINPUT HEX(0E)-D$
   : GOSUB '74(D$,D)
   : IF D1$=HEX(0000)THEN 6150
   : RETURN
6160 DEFFN'76(Q,D)
   : L=0
   : VERIFY T#D,(Q,Q)L
   : IF L=0THEN 6170
   : IF C=0THEN PRINT HEX(07);
   : PRINT HEX(060E);AT(19,26);"VERIFY ERROR IN SECTOR ";Q$
6170 RETURN
6180 DEFFN'77
   : E1=T(2)
   : IF T(3)<T(2)THEN E1=T(3)
   : IF A1$>HEX(0B)AND E1=T(2)THEN E1=E1-1
6190 PRINT AT(2,0,);AT(6,12);"Enter starting sector address <=";E1;".";
   : LINPUT HEX(0E)S$
   : CONVERT S$TO S
   : ERRORGOTO 6190
6200 IF S>E1OR S<0THEN 6190
   : PRINT AT(7,12);"Enter ending sector address >=";S;"but <=";E1;".";
   : LINPUT HEX(0E)E$
   : CONVERT E$TO E
   : ERRORGOTO 6200
6210 IF E<STHEN 6200
   : IF E>E1THEN 6180
   : M=FIX((E-S)/2)
6220 PRINT AT(4,0,);"Disk address:            ";HEX(0E);D$
   : CONVERT STO S$,(#####)
   : CONVERT ETO E$,(#####)
   : PRINT "Starting sector address: ";HEX(0E);S$;HEX(0F0A0D);"Ending sector a
     ddress:   ";HEX(0E);E$
   : RETURN
6230 DEFFN'90
   : IF C=0THEN PRINT HEX(07);
   : PRINT HEX(060E);"ERROR";HEX(200F);
   : RETURN
6240 DEFFN'200(D)
   : GOSUB '202(D)
   : $GIOBEGINMSWRITE#D,(0600070070A068D070406A1068104000,R$)
   : ERRORX=ERR
   : C=0
   : GOSUB '70
   : RETURN
6250 GOSUB '203
   : RETURN
6260 DEFFN'201(D)
   : GOSUB '202(D)
   : $GIOENDMSWRITE#D,(0600070070A068D070406A10681140008B67,R$)
   : ERRORX=ERR
   : C=0
   : GOSUB '70
   : RETURN
6270 GOSUB '203
   : RETURN
6280 DEFFN'202(D)
   : IF STR(T$(D),3)<>HEX(30)THEN 6290
   : STR(R$,,1)=HEX(30)
   : RETURN
6290 STR(R$,,1)=STR(T$(D),3)AND HEX(0F)SUBHEX(01)OR HEX(20)
   : RETURN
6300 DEFFN'203
   : IF STR(R$,6,1)=HEX(00)THEN 6310
   : IF STR(R$,6,1)=HEX(01)THEN X=98
   : IF STR(R$,6,1)=HEX(02)THEN X=91
   : IF STR(R$,6,1)=HEX(04)THEN X=94
   : GOSUB '70
   : RETURN
6310 IF STR(R$,7,1)=HEX(00)THEN RETURN
   : IF STR(R$,7,1)=HEX(01)THEN X=95
   : IF STR(R$,7,1)=HEX(02)THEN X=93
   : IF STR(R$,7,1)=HEX(04)THEN X=96
   : GOSUB '70
   : RETURN
6320 DEFFN'241(D,T$(D))
   : IF T(D)<52608THEN PRINT AT(2,13);"Format takes approximately 7 minutes wi
     thout retries."
   : IF T(D)<19584THEN PRINT AT(2,13);"Format takes approximately 90 seconds w
     ithout retries."
6330 IF T(D)<1232THEN PRINT AT(2,13);"Format takes approximately 52 seconds wi
     thout retries."
6340 PRINT AT(10,0,);TAB(4);"Formatting ";HEX(0E);T$(D);HEX(0F);" ............
     .............................................."
6350 X=0
   : $FORMATDISK T#D
   : ERRORX=ERR
   : PRINT HEX(0F);AT(10,4,75);"The disk at address ";T$(D);" can't be softwar
     e Formatted. "
   : IF X=92THEN PRINT AT(11,4);"Push the FORMAT button on the disk drive unit
     ."
   : GOSUB '70(X,D)
   : RETURN
6360 PRINT AT(10,73);HEX(0E);"O.K."
   : RETURN