Home » Personal collection » Acorn ADFS disks » Archimedes » RiscOs_Apps_2.ADF » Acorn/HFORM

Acorn/HFORM

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn ADFS disks » Archimedes » RiscOs_Apps_2.ADF
Filename: Acorn/HFORM
Read OK:
File size: 5B9A bytes
Load address: FFFFFB42
Exec address: 29A9CB5D
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10REM >HFORM
   20version$="1.78": date$="18-Jan-90"
   30REM Formatter for ST506 hard discs
   40REM for SCSI hard discs, see SCSI user guide
   50MODE 0
   60PROCInit
   70PROCGetShape
   80PROCDisableEscape
   90PROCFormat
  100PROCVerify
  110PROCStructure
  120PROCRestoreEscape
  130*RMREINIT ADFS
  140OSCLI("-ADFS-%FREE "+STR$Drive%)
  150OSCLI("-ADFS-%DISMOUNT "+STR$Drive%)
  160END
  170:
  180DEF PROCInit
  190MakeParams%=6
  200VerifyRetries%=1
  210DefectRetries%=5
  220Verify%=0
  230Read%=1
  240Write%=2
  250WriteTrack%=4
  260Restore%=6
  270Specify%=&F
  280AltDefectBit%=&10
  290DiscStruc%=&14
  300Log2SecSize%=8
  310SecSize%=2^Log2SecSize%
  320OldMapAdd%=0
  330OldMapSize%=&200
  340DirSize%=&800
  350BootAdd%=&C00
  360BootSize%=&200
  370MaxDefects%=(BootSize%-64-&C-4)DIV4
  380EndDefect%=1 << 29
  390OldLWM%=&E00
  400FreeLink%=1
  410CrossCheck%=3
  420AdfsSwi%=&40240
  430AdfsDiscErr%=&108C7
  440MaxVerifyBad%=16
  450Patterns%=8
  460DIM Buf% &8000, DiscRec% 64+BootSize%, Defect% BootSize%, DirMark% 5, Bad%(MaxVerifyBad%),mc% 100, Pattern%(Patterns%-1)
  470Boot%=DiscRec%+64
  480BootRec%=Boot%+BootSize%-64
  490Pattern%(2)=&FFFFFF
  500Pattern%(3)=&6DB6DB
  510Pattern%(4)=0
  520Pattern%(5)=&2CB2CB
  530Pattern%(6)=&5A5A5A
  540Pattern%(7)=&4D34D3
  550PRINT ''"H A R D   D I S C   F O R M A T T E R   (V ";version$;")"''
  560REPEAT
  570 VDU11
  580 Drive%=FNAsk("Format which drive (4 or 5)",4,4)
  590UNTIL Drive%=4 OR Drive%=5
  600SYS"ADFS_Drives" TO ,,HDiscs%
  610IF (Drive%-3)>HDiscs% THEN
  620 PRINT"This machine is configured as 'HardDiscs ";HDiscs%;"'"
  630 PRINT"please check/alter the configuration and re-run"
  640 PRINT"this program."
  650 END
  660ENDIF
  670SecsPerTrk%=32:Heads%=1:Cyls%=1:LowCurrentCyl%=1:PreCompCyl%=1:ParkCyl%=1
  680RootDirAdd%=&400:Log2Alloc%=10
  690IndRootDirAdd%=RootDirAdd%
  700DiscSize%=SecSize%*SecsPerTrk%*Heads%*Cyls%
  710ON ERROR LOCAL GOTO 730
  720OSCLI("-ADFS-%DISMOUNT "+STR$Drive%)
  730ON ERROR OFF
  740PROCAsm
  750ENDPROC
  760:
  770DEF PROCGetShape
  780PROCInitBootDefects
  790PROCInitDiscRec
  800PROCMoanOp(Restore%,0,0,0)
  810PROCOp(Read%,BootAdd%,Boot%,BootSize%)
  820IF Result%<>0 OR NOT FNGoodDefects THEN
  830 PRINT"The drive has an invalid defect map or has never been formatted"
  840 GOTO 890
  850ENDIF
  860PROCOldShape
  870PROCOp(Verify%,0,0,SecSize%*SecsPerTrk%)
  880IF FNConfirmMake GOTO 940
  890PROCAskMake
  900FOR I%=0 TO BootSize%-4
  910 Boot%!I%=0
  920NEXT I%
  930PROCInitBootDefects
  940Formatted%=(Result%=0)
  950PROCAskShape
  960SoakFlag%=FNChoose("Do you want to soak test the hard disc for defects (Y/N)","YN")="Y"
  970IF FNChoose("Are you certain you want to format drive "+STR$Drive%+" (Y/N)","YN")="N" END
  980PROCMoanOp(Specify%,0,0,0)
  990ENDPROC
 1000:
 1010DEF PROCOldShape
 1020SecsPerTrk%=BootRec%?1
 1030Heads%=BootRec%?2
 1040Log2Alloc%=BootRec%?5
 1050DiscSize%=BootRec%!&10
 1060Cyls%=DiscSize% DIV (SecSize%*SecsPerTrk%*Heads%)
 1070LowCurrentCyl%=(BootRec%!-8) AND &3FF
 1080PreCompCyl%=(BootRec%!-6) AND &3FF
 1090ParkCyl%=(BootRec%!-4)DIV(SecSize%*SecsPerTrk%*Heads%)
 1100PROCInitDiscRec
 1110ENDPROC
 1120:
 1130DEF PROCAskMake
 1140RESTORE
 1150Makes%=0
 1160REPEAT
 1170 READ Make$
 1180 Makes%+=1
 1190 PRINT ;Makes%;". ";Make$
 1200 FOR I%=1 TO MakeParams%
 1210  READ A$
 1220 NEXT I%
 1230UNTIL Make$="OTHER"
 1240Make%=FNInputDec("Which make of hard disc ",1,Makes%)
 1250RESTORE
 1260I%=(Make%-1)*(MakeParams%+1)
 1270WHILE I%>0
 1280 READ A$
 1290 I%-=1
 1300ENDWHILE
 1310READ Make$, SecsPerTrk%, Heads%, Cyls%, LowCurrentCyl%, PreCompCyl%, ParkCyl%
 1320PRINT Make$;" chosen"
 1330ENDPROC
 1340:
 1350DEF FNConfirmMake
 1360RESTORE
 1370READ Make$, P1%, P2%, P3%, P4%, P5%, P6%
 1380IF Make$="OTHER" THEN
 1390 PRINT "The shape written on the disc does not match any of the standard"
 1400 PRINT "drive shapes known by this program."
 1410 =FNChoose("Do you wish to retain this shape (Y/N)","YN")="Y"
 1420ENDIF
 1430IF P1%<>SecsPerTrk% OR P2%<>Heads% OR P3%<>Cyls% OR P4%<>LowCurrentCyl% OR P5%<>PreCompCyl% OR P6%<>ParkCyl% GOTO 1370
 1440PRINT "The shape written on the disc matches that of a ";Make$;" disc."
 1450=FNChoose("Do you wish to retain this shape (Y/N)","YN")="Y"
 1460:
 1470DEF PROCAskShape
 1480ON ERROR LOCAL:ON ERROR OFF:IF ERR=&1E6 NewMap%=FALSE:GOTO 1560 ELSE REPORT:PRINT;" @ ";ERL:END
 1490SYS "XFileCore_Create", 0
 1500PRINT
 1510REPEAT
 1520 VDU11
 1530 char%=ASC(FNStrAsk("Old or New map format (O/N)","N")) AND &DF
 1540UNTIL char%=ASC"O" OR char%=ASC"N"
 1550NewMap%=(char%=ASC"N")
 1560SecsPerTrk%=FNAsk("Sectors per track",SecsPerTrk%,1)
 1570DiscRec%?1=SecsPerTrk%
 1580Heads%=FNAsk("Heads",Heads%,1)
 1590IF Heads%>8 PRINT'"WARNING - since the drive has more than 8 heads, the computer's"'"          'low write current/head select 3' links may need changing."'
 1600DiscRec%?2=Heads%
 1610Cyls%=FNAsk("Cylinders",Cyls%,1)
 1620DiscSize%=SecSize%*SecsPerTrk%*Heads%*Cyls%
 1630DiscRec%!&10=DiscSize%
 1640LowCurrentCyl%=FNAsk("Low current cylinder",LowCurrentCyl%,0)
 1650PreCompCyl%=FNAsk("Precompensation cylinder",PreCompCyl%,0)
 1660ParkCyl%=FNAsk("Parking cylinder",ParkCyl%,0)
 1670FOR I%=0 TO BootSize%-4 STEP 4
 1680 Defect%!I%=Boot%!I%
 1690NEXT I%
 1700Boot%!0=EndDefect%
 1710REPEAT
 1720 ptr%=0
 1730 PRINT '"Current Defects (Cylinder,Head,Sector)"
 1740 WHILE Defect%!ptr%<EndDefect%
 1750  defect%=Defect%!ptr%
 1760  defect%=defect% DIV SecSize%
 1770  sector%=defect% MOD SecsPerTrk%
 1780  defect%=defect% DIV SecsPerTrk%
 1790  PRINT TAB(((ptr%DIV4)MOD6)*13);"(";defect%DIVHeads%;",";defect%MODHeads%;",";sector%;")";
 1800  ptr%=ptr%+4
 1810 ENDWHILE
 1820 Defects%=ptr%DIV4
 1830 PRINT
 1840 PRINT "A: no more changes"
 1850 PRINT "B: add defect by cylinder, head, byte/sector"
 1860 IF NewMap% THEN
 1870  PRINT "C: add defect by disc address"
 1880 ELSE
 1890  PRINT "C: add defect by LOGICAL disc address (eg disc error)"
 1900 ENDIF
 1910 PRINT "D: remove defect"
 1920 opt$=FNChoose("A,B,C or D","ABCD")
 1930 CASE opt$ OF
 1940  WHEN "B","D":
 1950   cyl%=FNInputDec("Cylinder",0,Cyls%-1)
 1960   head%=FNInputDec("Head",0,Heads%-1)
 1970   sector%=FNInputDec2("Bytes from index MFM"," or -ve for sector",1-SecsPerTrk%,&10000)
 1980   IF sector%>=0 THEN
 1990    sector%=sector% DIV 320
 2000   ELSE
 2010    sector%=-sector%
 2020   ENDIF
 2030   defect%=((cyl%*Heads%+head%)*SecsPerTrk%+sector%)*SecSize%
 2040   IF opt$="B" THEN
 2050    PROCAddPhysDefect(defect%)
 2060   ELSE
 2070    PROCRemovePhysDefect(defect%)
 2080   ENDIF
 2090  WHEN "C":
 2100   IF NewMap% THEN
 2110    PROCAddPhysDefect((FNInputHex("Disc address in bytes")DIVSecSize%)*SecSize%)
 2120   ELSE
 2130    PRINT "If ADFS gives an error such as 'Disc error 13 at :4/00012A00' then 00012A00 is a logical disc address. The logical to physical disc address mapping depends on the defect list. ";
 2140    PRINT " When these defects are added to the defect list, it is     important that they are added in DESCENDING order BEFORE the list is changed in any other way!"
 2150    defect%=(FNInputHex("Logical disc address in bytes")DIVSecSize%)*SecSize%
 2160    PROCAddPhysDefect(FNLogToPhys(defect%))
 2170   ENDIF
 2180 ENDCASE
 2190UNTIL opt$="A"
 2200FOR I%=0 TO DiscStruc%-4 STEP 4
 2210 BootRec%!I%=DiscRec%!I%
 2220NEXT I%
 2230PROCInitHardDesc
 2240ENDPROC
 2250:
 2260DEF PROCFormat
 2270TIME=0
 2280LOCAL I%,J%,cyl%,head%
 2290PROCMoanOp(Specify%,0,0,0)
 2300PROCMoanOp(Restore%,0,0,0)
 2310PRINT "Formatting"
 2320FOR I%=0 TO 512-4 STEP 4:Buf%!I%=&077F03FF:NEXT
 2330FOR cyl%=0 TO Cyls%-1
 2340 VDU13:PRINTcyl%;
 2350 FOR head%=0 TO Heads%-1
 2360  IF cyl%=0 IF head%=0 IF Formatted% GOTO 2410
 2370  J%=cyl% OR (head%<<24)
 2380  FOR I%=0 TO (SecsPerTrk%-1)*4 STEP 4:Buf%!I%=J% OR (I%<<14):NEXT
 2390  PROCOp(WriteTrack%,(cyl%*Heads%+head%)*SecsPerTrk%*SecSize%,Buf%,512)
 2400  IF Result% PRINT ;" format error on this track"
 2410 NEXT
 2420NEXT
 2430PRINT
 2440ENDPROC
 2450:
 2460DEF PROCVerify
 2470IF SoakFlag% PRINT '"PRESSING THE SPACE BAR WILL CAUSE THE SOAK TEST TO END AT THE END OF THAT CYCLE"
 2480LOCAL add%,ptr%,sector%,head%,cyl%
 2490Cycle%=1:ErrorCycle%=-100
 2500CylSize%=SecSize%*SecsPerTrk%*Heads%
 2510suspects%=0:MaxSuspects%=1000
 2520DIM CylBuf% CylSize%+4, SusAdd%(MaxSuspects%), SusCount% MaxSuspects%
 2530REPEAT
 2540 IF Cycle%>1 THEN
 2550  I%=Cycle% MOD Patterns%
 2560  IF I%>1 THEN
 2570   J%=Pattern%(I%)
 2580   J%=(J%>>>1) OR ((J% AND 1)<<23)
 2590   Pattern%(I%)=J%
 2600  ELSE
 2610   J%=RND(&1000000)-1
 2620  ENDIF
 2630  IF NOT SoakFlag% THEN PRINT "Writing pattern &";~J%
 2640  FOR I%=CylBuf% TO CylBuf%+CylSize% STEP 3:!I%=J%:NEXT
 2650  ptr%=0
 2660  IF Formatted% add%=SecSize%*SecsPerTrk% ELSE add%=0
 2670  REPEAT
 2680   CylEnd%=add% - (add% MOD CylSize%) + CylSize%
 2690   defect%=Defect%!ptr%
 2700   IF defect%>CylEnd% THEN
 2710    length%=CylEnd%-add%
 2720   ELSE
 2730    length%=defect%-add%
 2740   ENDIF
 2750   PROCOp(Write%,add%,0,length%)
 2760   IF Result% THEN
 2770    add%=(ErrDiscAdd% AND &1FFFFF00)+SecSize%
 2780   ELSE
 2790    add%+=length%
 2800   ENDIF
 2810   IF add%=defect% THEN add%+=SecSize%:ptr%+=4
 2820  UNTIL add%>=DiscSize%
 2830 ENDIF
 2840 IF NOT SoakFlag% THEN PRINT "Verifying"
 2850 add%=0:ptr%=0
 2860 PROCMoanOp(Restore%,0,0,0)
 2870 REPEAT
 2880  WHILE Defect%!ptr%<add%
 2890   ptr%+=4
 2900  ENDWHILE
 2910  defect%=Defect%!ptr%
 2920  IF defect%>DiscSize% THEN
 2930   length%=DiscSize%-add%
 2940  ELSE
 2950   length%=defect%-add%
 2960  ENDIF
 2970  PROCOp(Verify%,add%,0,length%)
 2980  IF Result% THEN
 2990   add%=ErrDiscAdd% AND &1FFFFF00
 3000   Try%=0
 3010   REPEAT
 3020    Try%+=1
 3030    PROCMoanOp(Restore%,0,0,0)
 3040    PROCOp(Verify%,add%,0,&100)
 3050   UNTIL Result%=0 OR Try%=5
 3060   IF Result% Try%+=1
 3070   sector%=add% DIV SecSize%
 3080   head%=sector% DIV SecsPerTrk%
 3090   sector%=sector% MOD SecsPerTrk%
 3100   cyl%=head% DIV Heads%
 3110   head%=head% MOD Heads%
 3120   PRINT "Cyl=";cyl%;" Head=";head%;" Sector=";sector%;" ";
 3130   sus%=0
 3140   WHILE sus%<suspects% AND SusAdd%(sus%)<>add%:sus%+=1:ENDWHILE
 3150   IF sus%=suspects% THEN
 3160    IF suspects%=MaxSuspects% THEN
 3170     sus%=RND(MaxSuspects%)-1
 3180    ELSE
 3190     suspects%+=1
 3200    ENDIF
 3210    SusAdd%(sus%)=add%
 3220    SusCount%?sus%=0
 3230   ENDIF
 3240   score%=2^(Try%-1)-1
 3250   IF NOT SoakFlag% score%=score%*4
 3260   SusCount%?sus%+=score%
 3270   IF SusCount%?sus%>30 THEN
 3280    PRINT "defect ";
 3290    IF SoakFlag% THEN
 3300     OSCLI("TIME")
 3310    ELSE
 3320     PRINT
 3330    ENDIF
 3340    PROCAddPhysDefect(add%)
 3350    ErrorCycle%=Cycle%
 3360   ELSE
 3370    IF SoakFlag% THEN
 3380     TIME=0:REPEAT UNTIL TIME>500:VDU 13:PRINTSPC(39);:VDU13
 3390    ELSE
 3400     PRINT ;Try%;" retries needed"
 3410    ENDIF
 3420   ENDIF
 3430   add%=add%+SecSize%
 3440  ELSE
 3450   add%=add%+length%+SecSize%
 3460  ENDIF
 3470  IF add%>defect% THEN
 3480   ptr%+=4
 3490  ENDIF
 3500 UNTIL add%>=DiscSize%
 3510 IF SoakFlag% THEN
 3520  REPEAT
 3530   Key%=INKEY(0)
 3540  UNTIL Key%=-1 OR Key%=32
 3550  done%=(Key%=32)
 3560 ELSE
 3570  done%=Cycle%>ErrorCycle%+2
 3580 ENDIF
 3590 Cycle%+=1
 3600UNTIL done%
 3610ENDPROC
 3620:
 3630DEF PROCStructure
 3640IF NewMap% THEN
 3650 PROCNewStructure
 3660ELSE
 3670 PROCOldStructure
 3680ENDIF
 3690ENDPROC
 3700:
 3710DEF PROCOldStructure
 3720PROCWriteDefectList
 3730PROCWriteOldFsMap
 3740PROCWriteRootDir
 3750ENDPROC
 3760:
 3770DEF PROCNewStructure
 3780Zone0Bits%=60*8
 3790ZoneBits%=SecSize%*8
 3800Log2Alloc%=9: REM requested by TCs ECR
 3810IF Log2Alloc%<8 OR Log2Alloc%>12 THEN Log2Alloc%=10
 3820REPEAT: REM allocation size loop
 3830 Alloc%=FNAsk("Large file allocation unit",2^Log2Alloc%,256)
 3840 Log%=7
 3850 REPEAT
 3860  Log%+=1
 3870 UNTIL Alloc%=2^Log% OR Log%=13
 3880 IF Log%=13 UNTIL FALSE:REM restart alloc size loop
 3890 Log2Alloc%=Log%
 3900 MapBits%=DiscSize% DIV Alloc%
 3910 RoundSize%=MapBits% * Alloc%
 3920 BestZones%=1 << 30      :REM init to rogue values
 3930 BestCylOff%=1 << 30
 3940 FOR DummySpare%=1 TO 1
 3950 FOR SpareBits% = 4*8 TO ZoneBits%-Zone0Bits%-8*8
 3960  PROCCalcZones
 3970  LinkBits%=10
 3980  REPEAT LinkBits%+=1
 3990   PROCCalcIds
 4000  UNTIL Ids%<=2^LinkBits%
 4010  IF SpareBits%-4*8>0 AND SpareBits%-4*8<=LinkBits% NEXT SpareBits%
 4020  IF OddBits%>0 AND OddBits%<=LinkBits% NEXT SpareBits%
 4030  IF LinkBits%>15 OR Zones%>127 THEN
 4040   PRINT "Allocation unit too small"
 4050   Log2Alloc%+=1
 4060   NEXT DummySpare%
 4070   UNTIL FALSE  :REM restart alloc size loop
 4080  ENDIF
 4090  IF Zones% <= BestZones% THEN
 4100   Crucial%=Zones%*SecSize%*2+DirSize%
 4110   IF MapZone%=0 Crucial%=BootAdd%+BootSize%
 4120   IF Crucial%<Alloc%*(LinkBits%+1) Crucial%=Alloc%*(LinkBits%+1)
 4130   CrucialEnd%=MapAdd%+Crucial%
 4140   DefPtr%=Defect%
 4150   REPEAT
 4160    defect%=!DefPtr%
 4170    DefPtr%+=4
 4180   UNTIL defect%>=EndDefect% OR (defect%>=MapAdd% AND defect%<CrucialEnd%)
 4190   CylOff%=MapAdd% MOD (SecSize%*SecsPerTrk%*Heads%)
 4200   IF defect%>=EndDefect% AND CylOff%<BestCylOff% THEN
 4210    BestCylOff%=CylOff%
 4220    BestLinkBits%=LinkBits%
 4230    BestSpare%=SpareBits%
 4240    BestZones%=Zones%
 4250   ENDIF
 4260   IF BestCylOff% NEXT SpareBits%
 4270   NEXT DummySpare%
 4280  ELSE
 4290   NEXT DummySpare%
 4300  ENDIF
 4310IF BestZones%=(1<<30) THEN PRINT "Can't use this allocation size":UNTIL FALSE
 4320UNTIL TRUE
 4330LinkBits%=BestLinkBits%
 4340SpareBits%=BestSpare%
 4350PROCCalcZones
 4360PROCCalcIds
 4370Crucial%=Zones%*SecSize%*2+DirSize%
 4380IF MapZone%=0 Crucial%=BootAdd%+BootSize%
 4390IF Crucial%<Alloc%*(LinkBits%+1) Crucial%=Alloc%*(LinkBits%+1)
 4400IF Crucial% MOD Alloc%<>0 Crucial%+=Alloc%-Crucial% MOD Alloc%
 4410IF MapZone%=0 THEN
 4420 RootDirAdd%=BootAdd%+BootSize%
 4430 IndRootDirAdd%=&200 + (BootAdd%+BootSize%) DIV SecSize% + 1
 4440ELSE
 4450 RootDirAdd%=MapAdd%+MapLen%*2
 4460 IndRootDirAdd%=&200+Zones%*2+1
 4470ENDIF
 4480DiscRec%?4=LinkBits%
 4490DiscRec%?5=Log2Alloc%
 4500DiscRec%?9=Zones%
 4510DiscRec%?&A=SpareBits% MOD 256
 4520DiscRec%?&B=SpareBits% DIV 256
 4530DiscRec%!&C=IndRootDirAdd%
 4540BootRec%!4=DiscRec%!4
 4550BootRec%!8=DiscRec%!8
 4560BootRec%!&C=DiscRec%!&C
 4570FOR I%=0 TO Zones%*SecSize%-4 STEP 4
 4580 Buf%!I%=0
 4590NEXT I%
 4600FOR I%=0 TO 60-4 STEP 4
 4610 Buf%!(I%+4)=DiscRec%!I%
 4620NEXT I%
 4630PROCWriteDefectList
 4640PRINT "Creating Map"
 4650ptr%=0
 4660DefectStart%=0
 4670DiscEndBit%=FNDiscToMap(DiscSize%)
 4680ZoneStart%=Buf%
 4690ZoneStartBit%=0
 4700FOR zone%=0 TO Zones%-1
 4710 !ZoneStart%=1<<(15+FreeLink%*8)
 4720 ZoneEndBit%=ZoneStartBit%+ZoneBits%
 4730 UsedZoneEndBit%=ZoneEndBit%-SpareBits%+4*8
 4740 IF UsedZoneEndBit%>DiscEndBit% THEN
 4750  UsedZoneEndBit%=DiscEndBit%
 4760 ENDIF
 4770 PreFree%=ZoneStartBit%+FreeLink%*8
 4780 ZoneBit%=ZoneStartBit%+4*8
 4790 IF zone%=0 THEN
 4800  ZoneBit%=ZoneBit%+Zone0Bits%
 4810  length%=(BootAdd%+BootSize%) DIV Alloc%
 4820  IF length%<LinkBits%+1 length%=LinkBits%+1
 4830  PROCWriteLink(ZoneBit%,2)
 4840  PROCWriteLength(ZoneBit%,length%)
 4850  ZoneBit%=ZoneBit%+length%
 4860 ELSE
 4870  IF zone%=MapZone% THEN
 4880   length%=Crucial% DIV Alloc%
 4890   PROCWriteLink(ZoneBit%,2)
 4900   PROCWriteLength(ZoneBit%,length%)
 4910   ZoneBit%=ZoneBit%+length%
 4920  ENDIF
 4930 ENDIF
 4940 REPEAT
 4950  IF ZoneBit%>DefectStart% THEN
 4960   DefectStart%=FNDiscToMap(Defect%!ptr%)
 4970   IF DefectStart%>=UsedZoneEndBit% THEN
 4980    DefectStart%=ZoneEndBit%
 4990   ELSE
 5000    DefectEnd%=DefectStart%+1
 5010    ptr%+=4
 5020    REPEAT
 5030     done1%=TRUE
 5040     REPEAT
 5050      done2%=TRUE
 5060      NextDefect%=FNDiscToMap(Defect%!ptr%)
 5070      IF NextDefect%<UsedZoneEndBit% THEN
 5080       IF NextDefect%>ZoneEndBit%-(LinkBits%+1) THEN
 5090        NextDef%=ZoneEndBit%-(LinkBits%+1)
 5100       ELSE
 5110        NextDef%=NextDefect%
 5120       ENDIF
 5130       IF NextDef%-DefectEnd%<LinkBits%+1 THEN
 5140        IF NextDefect%+1>DefectEnd% THEN
 5150         DefectEnd%=NextDefect%+1
 5160        ENDIF
 5170        ptr%+=4
 5180        done2%=FALSE
 5190       ENDIF
 5200      ENDIF
 5210     UNTIL done2%
 5220     IF DefectEnd%-DefectStart%<LinkBits%+1 THEN
 5230      DefectEnd%=DefectStart%+LinkBits%+1
 5240      IF DefectEnd%>ZoneEndBit% THEN
 5250       DefectEnd%=ZoneEndBit%
 5260      ENDIF
 5270      done1%=FALSE
 5280     ENDIF
 5290     IF DefectEnd%>ZoneEndBit%-(LinkBits%+1) AND DefectEnd%<>ZoneEndBit% THEN
 5300      DefectEnd%=ZoneEndBit%
 5310      done1%=FALSE
 5320     ENDIF
 5330     IF DefectEnd%-DefectStart%<LinkBits%+1 THEN
 5340      DefectStart%=DefectEnd%-(LinkBits%+1)
 5350     ENDIF
 5360    UNTIL done1%
 5370   ENDIF
 5380  ENDIF
 5390  IF ZoneBit%>DefectStart% PRINT "PROGRAM ERROR 1":END
 5400  IF DefectStart%-ZoneBit% <= LinkBits% THEN DefectStart%=ZoneBit%
 5410  IF DefectStart%>ZoneBit% THEN
 5420   PROCWriteLink(PreFree%,ZoneBit%-PreFree%)
 5430   IF DefectStart%>=UsedZoneEndBit% THEN
 5440    PROCWriteLength(ZoneBit%,UsedZoneEndBit%-ZoneBit%)
 5450    IF ZoneEndBit%>UsedZoneEndBit% THEN
 5460     PROCWriteLink(UsedZoneEndBit%,1)
 5470     PROCWriteLength(UsedZoneEndBit%,ZoneEndBit%-UsedZoneEndBit%)
 5480    ENDIF
 5490   ELSE
 5500    PROCWriteLength(ZoneBit%,DefectStart%-ZoneBit%)
 5510   ENDIF
 5520  PreFree%=ZoneBit%
 5530  ENDIF
 5540  IF DefectStart%<ZoneEndBit% THEN
 5550   IF DefectEnd%>UsedZoneEndBit%-(LinkBits%+1) THEN
 5560    DefectEnd%=ZoneEndBit%
 5570   ENDIF
 5580   PROCWriteLink(DefectStart%,1)
 5590   PROCWriteLength(DefectStart%,DefectEnd%-DefectStart%)
 5600   ZoneBit%=DefectEnd%
 5610  ELSE
 5620   ZoneBit%=ZoneEndBit%
 5630  ENDIF
 5640 UNTIL ZoneBit%=ZoneEndBit%
 5650 PROCWriteLink(PreFree%,0)
 5660 IF zone%=0 THEN
 5670  ZoneStart%?CrossCheck%=&FF
 5680 ELSE
 5690  ZoneStart%?CrossCheck%=0
 5700 ENDIF
 5710 ?ZoneStart%=FNNewMapCheck(ZoneStart%,SecSize%)
 5720 ZoneStart%=ZoneStart%+SecSize%
 5730 ZoneStartBit%=ZoneEndBit%
 5740NEXT zone%
 5750PRINT "Writing map"
 5760PROCMoanOp(Write%,MapAdd%,Buf%,MapLen%)
 5770PROCMoanOp(Write%,MapAdd%+MapLen%,Buf%,MapLen%)
 5780PROCWriteRootDir
 5790ENDPROC
 5800:
 5810DEF PROCCalcZones
 5820UsedBits%=SecSize%*8-SpareBits%
 5830WholeZones%=(MapBits%+Zone0Bits%) DIV UsedBits%
 5840OddBits%=(MapBits%+Zone0Bits%) MOD UsedBits%
 5850IF OddBits% Zones%=WholeZones%+1 ELSE Zones%=WholeZones%
 5860MapZone%=Zones% DIV 2
 5870IF MapZone%=0 THEN
 5880 MapAdd%=0
 5890ELSE
 5900 MapAdd%=(UsedBits%*MapZone%-Zone0Bits%)*Alloc%
 5910ENDIF
 5920MapLen%=Zones%*SecSize%
 5930ENDPROC
 5940:
 5950DEF PROCCalcIds
 5960IdsPerZone%=UsedBits% DIV (LinkBits%+1)
 5970Ids%=IdsPerZone% * WholeZones% + OddBits% DIV (LinkBits%+1)
 5980ENDPROC
 5990:
 6000DEF FNDiscToMap(discadd%)
 6010LOCAL bit%,zone%
 6020bit%=(discadd% DIV Alloc%)+Zone0Bits%
 6030zone%=bit% DIV UsedBits%
 6040bit%=bit%+(bit% DIV UsedBits%)*SpareBits%+4*8
 6050= bit%
 6060:
 6070DEF PROCWriteLink(off%,link%)
 6080IF link%>=2^LinkBits% PRINT "PROGRAM ERROR 2":END
 6090LOCAL bit%,add%,mask%
 6100bit%=off% MOD 8
 6110add%=Buf%+off% DIV 8
 6120mask%=2^LinkBits%-1
 6130!add%=(!add% AND NOT (mask%<<bit%)) OR link%<<bit%
 6140ENDPROC
 6150:
 6160DEF PROCWriteLength(off%,len%)
 6170IF len%<=LinkBits% PRINT "PROGRAM ERROR 3":END
 6180off%=off%+len%-1
 6190Buf%?(off%DIV8)+=2^(off%MOD8)
 6200ENDPROC
 6210:
 6220DEF PROCWriteDefectList
 6230PRINT "Writing defect list"
 6240ptr%=0
 6250check%=0
 6260WHILE Defect%!ptr%<EndDefect%
 6270 Boot%!ptr%=Defect%!ptr%
 6280 PROCCheckPut(Boot%!ptr%)
 6290 ptr%=ptr%+4
 6300ENDWHILE
 6310check%=check% EOR (check%>>>16)
 6320check%=(check% EOR (check%>>>8))AND &FF
 6330Boot%!ptr%=EndDefect% OR check%
 6340PROCSum(Boot%,BootSize%)
 6350PROCMoanOp(Write%,BootAdd%,Boot%,BootSize%)
 6360ENDPROC
 6370:
 6380DEF PROCWriteOldFsMap
 6390PRINT "Writing free space map"
 6400LOCAL s%,I%
 6410s%=OldMapSize% DIV 2
 6420FOR I%=0 TO OldMapSize%-4 STEP 4:Buf%!I%=0:NEXT
 6430!Buf%=OldLWM% DIV &100
 6440Buf%!s%=(DiscSize%-OldLWM%-Defects%*SecSize%) DIV &100
 6450!(Buf%+s%-4)=DiscSize% DIV &100
 6460!(Buf%+OldMapSize%-5)=RND(&10000)-1
 6470!(Buf%+OldMapSize%-2)=3
 6480PROCSum(Buf%,s%)
 6490PROCSum(Buf%+s%,s%)
 6500PROCMoanOp(Write%,OldMapAdd%,Buf%,OldMapSize%)
 6510ENDPROC
 6520:
 6530DEF PROCWriteRootDir
 6540PRINT "Writing root directory"
 6550LOCAL BF%
 6560FOR I%=0 TO DirSize%-4 STEP 4:Buf%!I%=0:NEXT
 6570IF NewMap% THEN
 6580 $DirMark%="Hugo"
 6590ELSE
 6600 $DirMark%="Hugo"
 6610ENDIF
 6620Buf%!1=!DirMark%
 6630BF%=Buf%+DirSize%
 6640IF NewMap% THEN
 6650 BF%!-38=IndRootDirAdd%
 6660ELSE
 6670 BF%!-38=IndRootDirAdd% DIV &100
 6680ENDIF
 6690BF%?-35=ASC"$"
 6700BF%?-16=ASC"$"
 6710BF%!-5=!DirMark%
 6720check%=0
 6730PROCCheckPut(!Buf%)
 6740PROCCheckPut(Buf%?4)
 6750I%=BF%-40
 6760WHILE I%AND3
 6770 PROCCheckPut(?I%)
 6780 I%=I%+1
 6790ENDWHILE
 6800WHILE I%<BF%-4
 6810 PROCCheckPut(!I%)
 6820 I%=I%+4
 6830ENDWHILE
 6840check%=check% EOR (check%>>>16)
 6850check%=(check% EOR (check%>>>8))AND &FF
 6860BF%?-1=check%
 6870PROCMoanOp(Write%,RootDirAdd%,Buf%,DirSize%)
 6880ENDPROC
 6890:
 6900DEF FNLogToPhys(add%)
 6910LOCAL ptr%
 6920ptr%=0
 6930WHILE add%>=Defect%!ptr%
 6940 ptr%=ptr%+4
 6950 add%=add%+SecSize%
 6960ENDWHILE
 6970=add%
 6980:
 6990DEF PROCAddPhysDefect(add%)
 7000LOCAL ptr%,ptr2%,defect%
 7010IF Defects%<MaxDefects% THEN
 7020 WHILE Defect%!ptr%<add%
 7030  ptr%=ptr%+4
 7040 ENDWHILE
 7050 defect%=Defect%!ptr%
 7060 IF defect%=add% THEN
 7070  PRINT "Defect already in defect list"
 7080 ELSE
 7090  ptr2%=Defects%*4
 7100  WHILE ptr2%>=ptr%
 7110   Defect%!(ptr2%+4)=Defect%!ptr2%
 7120   ptr2%=ptr2%-4
 7130  ENDWHILE
 7140  Defect%!ptr%=add%
 7150  Defects%=Defects%+1
 7160 ENDIF
 7170ELSE
 7180 PRINT "Defect list full"
 7190ENDIF
 7200ENDPROC
 7210:
 7220DEF PROCRemovePhysDefect(add%)
 7230LOCAL ptr%,ptr2%,defect%
 7240WHILE Defect%!ptr%<add%
 7250 ptr%=ptr%+4
 7260ENDWHILE
 7270defect%=Defect%!ptr%
 7280IF defect%=add% THEN
 7290 WHILE ptr%<Defects%*4
 7300  Defect%!ptr%=Defect%!(ptr%+4)
 7310  ptr%=ptr%+4
 7320 ENDWHILE
 7330 Defects%=Defects%-1
 7340ELSE
 7350 PRINT "Defect not in defect list"
 7360ENDIF
 7370ENDPROC
 7380:
 7390DEF FNGoodDefects
 7400ptr%=-4
 7410check%=0
 7420last%=-1
 7430good%=TRUE
 7440REPEAT
 7450 ptr%=ptr%+4
 7460 defect%=Boot%!ptr%
 7470 IF defect%<=last% good%=FALSE
 7480 last%=defect%
 7490 IF defect%<EndDefect% PROCCheckPut(defect%)
 7500UNTIL (defect% >= EndDefect%) OR NOT good%
 7510Defects%=ptr%DIV4
 7520check%=check% EOR (check%>>>16)
 7530check%=(check% EOR (check%>>>8))AND &FF
 7540= good% AND ((defect%AND&FF) = check%) AND (FNsum(Boot%,BootSize%)=Boot%?(BootSize%-1))
 7550:
 7560DEF PROCInitDiscRec
 7570FOR I%=0 TO 64-4 STEP 4
 7580 DiscRec%!I%=0
 7590NEXT I%
 7600?DiscRec%=Log2SecSize%
 7610DiscRec%?1=SecsPerTrk%
 7620DiscRec%?2=Heads%
 7630DiscRec%!&C=IndRootDirAdd%
 7640DiscRec%!&10=DiscSize%
 7650DiscRec%!&14=RND(&10000)-1
 7660$(DiscRec%+&16)="HardDisc"+STR$Drive%
 7670DiscRec%?&22=Drive%
 7680ENDPROC
 7690:
 7700DEF PROCInitBootDefects
 7710!Boot%=EndDefect%
 7720Defects%=0
 7730PROCInitHardDesc
 7740ENDPROC
 7750:
 7760DEF PROCInitHardDesc
 7770BootRec%!-&10= &00000000      :REM SL xxxxxx
 7780BootRec%!-&C = &0D0C200A      :REM GPL2 GPL3 SH GPL1
 7790REM BootRec%!-&10= &16000000  slow stepping alternative
 7800REM BootRec%!-&C = &0D0CA80A  slow stepping alternative
 7810BootRec%!-8  = LowCurrentCyl% OR (PreCompCyl%<<16)
 7820BootRec%!-4  = SecSize%*SecsPerTrk%*Heads%*ParkCyl%
 7830ENDPROC
 7840:
 7850DEF FNAsk(String$,Default%,min%)
 7860LOCAL X,Y,reply$,value%
 7870LOCAL ERROR
 7880PRINT:VDU11
 7890PRINT String$;" ?";: X=POS: Y=VPOS
 7900ON ERROR LOCAL
 7910REPEAT
 7920 PRINT TAB(X,Y);Default%;SPC3;TAB(X,Y);
 7930 *FX 15,1
 7940 INPUT""reply$
 7950 IF reply$="" THEN
 7960  value%=Default%
 7970 ELSE
 7980  value%=EVAL(reply$)
 7990 ENDIF
 8000UNTIL value%>=min%
 8010PRINT TAB(X,Y);value%;SPC3
 8020=value%
 8030:
 8040DEF FNStrAsk(String$,Default$)
 8050LOCAL X,Y,reply$
 8060PRINT:VDU11
 8070PRINT String$;" ?";: X=POS: Y=VPOS
 8080PRINT TAB(X,Y);Default$;SPC12;TAB(X,Y);: INPUT""reply$
 8090IF reply$="" THEN reply$ = Default$
 8100PRINT TAB(X,Y);reply$;SPC3
 8110= reply$
 8120:
 8130DEF FNInputDec(String$,min%,max%)
 8140LOCAL X,Y,reply$,value%
 8150LOCAL ERROR
 8160PRINT:VDU11
 8170PRINT String$;" (";min%;" to ";max%;" ) ";: X=POS: Y=VPOS
 8180ON ERROR LOCAL
 8190REPEAT
 8200 PRINT TAB(X,Y);SPC12;TAB(X,Y);: INPUT reply$
 8210 value%=EVAL(reply$)
 8220UNTIL value%>=min% AND value%<=max%
 8230= value%
 8240:
 8250DEF FNInputDec2(String1$,String2$,min%,max%)
 8260LOCAL X,Y,reply$,value%
 8270LOCAL ERROR
 8280PRINT:VDU11
 8290PRINT String1$;" (1 to ";max%;" ),";
 8300PRINT String2$;" (0 to ";min%;" ) ";: X=POS: Y=VPOS
 8310ON ERROR LOCAL
 8320REPEAT
 8330 PRINT TAB(X,Y);SPC12;TAB(X,Y);: INPUT reply$
 8340 value%=EVAL(reply$)
 8350UNTIL value%>=min% AND value%<=max%
 8360= value%
 8370:
 8380DEF FNInputHex(String$)
 8390LOCAL X,Y,reply$,value%
 8400LOCAL ERROR
 8410PRINT:VDU11
 8420PRINT String$;" &";: X=POS: Y=VPOS
 8430ON ERROR LOCAL
 8440PRINT TAB(X,Y);SPC12;TAB(X,Y);: INPUT ""reply$
 8450=EVAL("&"+reply$)
 8460:
 8470DEF FNChoose(String$,opt$)
 8480LOCAL X,Y,reply$
 8490PRINT:VDU11
 8500PRINT String$;" ?";: X=POS: Y=VPOS
 8510REPEAT
 8520 REPEAT
 8530  PRINT TAB(X,Y);SPC12;TAB(X,Y);: INPUT ""reply$
 8540 UNTIL LEN(reply$)=1
 8550 reply$=CHR$(ASC(reply$)AND&DF)
 8560UNTIL INSTR(opt$,reply$)
 8570=reply$
 8580:
 8590DEF PROCCheckPut(I%)
 8600check%=(check% >>> 13) EOR ((check% AND (2^13-1)) << (32-13)) EOR I%
 8610ENDPROC
 8620:
 8630DEF FNsum(base%,len%)
 8640sum%=0:c%=0
 8650FOR I%=len%-2 TO 0 STEP-1
 8660sum%=sum%+base%?I%+c%
 8670IF sum%<&100 c%=0 ELSE sum%=sum% AND &FF:c%=1
 8680NEXT I%
 8690=sum%
 8700:
 8710DEF PROCSum(base%,len%)
 8720base%?(len%-1)=FNsum(base%,len%)
 8730ENDPROC
 8740:
 8750DEF FNNewMapCheck(B%,C%)=USR(NewCheck%)
 8760:
 8770DEF PROCAsm
 8780FOR opt%=0 TO 2 STEP 2
 8790 P%=mc%
 8800 [ OPT opt%
 8810.NewCheck%
 8820 MOV  R0,#0
 8830 ADDS R2,R1,R2  \C=0
 8840.loop%
 8850 LDR  R3,[R2,#-4]!
 8860 ADCS R0,R0,R3
 8870 TEQS R2,R1
 8880 BNE  loop%
 8890 AND  R3,R3,#&FF
 8900 SUB  R0,R0,R3
 8910 EOR  R0,R0,R0,LSR #16
 8920 EOR  R0,R0,R0,LSR #8
 8930 AND  R0,R0,#&FF
 8940 MOVS PC,R14
 8950 ]
 8960NEXT opt%
 8970ENDPROC
 8980:
 8990DEF PROCDisableEscape
 9000SYS "XOS_Byte",200,1,0 TO R0,OldEscState%
 9010SYS "XOS_Byte",247,%10101010,0 TO R0,OldBreakState%
 9020ENDPROC
 9030:
 9040DEF PROCRestoreEscape
 9050SYS "XOS_Byte",200,OldEscState%,0
 9060SYS "XOS_Byte",247,OldBreakState%,0
 9070ENDPROC
 9080:
 9090DEF PROCMoanOp(b%, C%, D%, E%)
 9100SYS AdfsSwi%, 0, b% OR AltDefectBit% OR (DiscRec%<<6), C% OR Drive%<< 29, D%, E%
 9110ENDPROC
 9120:
 9130DEF PROCOp(b%, C%, D%, E%)
 9140SYS AdfsSwi% OR (1<<17), 0, b% OR AltDefectBit% OR (DiscRec%<<6), C% OR Drive%<< 29, D%, E% TO Result%, R1%, ErrDiscAdd%
 9150IF Result% THEN
 9160 IF Result% AND (1 << 31) THEN
 9170  PRINT "Error &";~Result% AND &3FFFFFFF:END
 9180 ELSE
 9190  IF ((!Result%) AND &FFFFFF)=AdfsDiscErr% THEN
 9200   Result%=Result%?3
 9210  ELSE
 9220   PRINT "Error &";~!Result%;" ";
 9230   I%=4
 9240   WHILE Result%?I%
 9250    VDU Result%?I%
 9260    I%=I%+1
 9270   ENDWHILE
 9280   END
 9290  ENDIF
 9300 ENDIF
 9310ELSE
 9320ENDIF
 9330ENDPROC
 9340:
 9350REM Manufacturer, Sectors per track, heads, cylinders, low current cylinder, precompensation cylinder, parking cylinder
 9360DATA 20Mb Miniscribe 8425,                    32, 4, 615, &3FF,  128, 663
 9370DATA 53Mb Rodime RO3065,                      32, 7, 872, &3FF,  650, 871
 9380DATA OTHER,                                   32, 4, 612, &3FF,  128, 611:REM MUST BE LAST
 9390REM  20Mb Western Digital WD362/Tandon TM362, 32, 4, 615, &3FF, &3FF, 663
 9400REM  20Mb NEC,                                32, 4, 612, &3FF,  256, 672
 9410REM  20Mb Olivetti,                           32, 4, 612, &3FF,  128, 670
 9420REM For slow stepping drives you will need to use the alternate lines in PROCInitHardDesc

� >HFORM
&version$="1.78": date$="18-Jan-90"
$� Formatter for ST506 hard discs
(.� for SCSI hard discs, see SCSI user guide
2� 0
<	�Init
F
�GetShape
P�DisableEscape
Z�Format
d�Verify
n�Structure
x�RestoreEscape
�*RMREINIT ADFS
��("-ADFS-%FREE "+�Drive%)
�!�("-ADFS-%DISMOUNT "+�Drive%)
��
�:
�� �Init
�MakeParams%=6
�VerifyRetries%=1
�DefectRetries%=5
�
Verify%=0
�Read%=1
�Write%=2
�WriteTrack%=4
Restore%=6
Specify%=&F
AltDefectBit%=&10
"DiscStruc%=&14
,Log2SecSize%=8
6SecSize%=2^Log2SecSize%
@OldMapAdd%=0
JOldMapSize%=&200
TDirSize%=&800
^BootAdd%=&C00
hBootSize%=&200
r%MaxDefects%=(BootSize%-64-&C-4)�4
|EndDefect%=1 << 29
�OldLWM%=&E00
�FreeLink%=1
�CrossCheck%=3
�AdfsSwi%=&40240
�AdfsDiscErr%=&108C7
�MaxVerifyBad%=16
�Patterns%=8
�z� Buf% &8000, DiscRec% 64+BootSize%, Defect% BootSize%, DirMark% 5, Bad%(MaxVerifyBad%),mc% 100, Pattern%(Patterns%-1)
�Boot%=DiscRec%+64
�BootRec%=Boot%+BootSize%-64
�Pattern%(2)=&FFFFFF
�Pattern%(3)=&6DB6DB
�Pattern%(4)=0
Pattern%(5)=&2CB2CB
Pattern%(6)=&5A5A5A
Pattern%(7)=&4D34D3
&D� ''"H A R D   D I S C   F O R M A T T E R   (V ";version$;")"''
0�
: �11
D3 Drive%=�Ask("Format which drive (4 or 5)",4,4)
N� Drive%=4 � Drive%=5
Xș"ADFS_Drives" � ,,HDiscs%
b� (Drive%-3)>HDiscs% �
l= �"This machine is configured as 'HardDiscs ";HDiscs%;"'"
v7 �"please check/alter the configuration and re-run"
� �"this program."
� �
��
�MSecsPerTrk%=32:Heads%=1:Cyls%=1:LowCurrentCyl%=1:PreCompCyl%=1:ParkCyl%=1
�"RootDirAdd%=&400:Log2Alloc%=10
�IndRootDirAdd%=RootDirAdd%
�/DiscSize%=SecSize%*SecsPerTrk%*Heads%*Cyls%
�� � � � �dZB
�!�("-ADFS-%DISMOUNT "+�Drive%)
�	� � �
��Asm
��
�:
� �GetShape
�InitBootDefects
�InitDiscRec
 �MoanOp(Restore%,0,0,0)
*'�Op(Read%,BootAdd%,Boot%,BootSize%)
4#� Result%<>0 � � �GoodDefects �
>G �"The drive has an invalid defect map or has never been formatted"
H � �DzC
R�
\
�OldShape
f)�Op(Verify%,0,0,SecSize%*SecsPerTrk%)
p� �ConfirmMake � �tlC
z�AskMake
�� I%=0 � BootSize%-4
� Boot%!I%=0
�� I%
��InitBootDefects
�Formatted%=(Result%=0)
�
�AskShape
�ZSoakFlag%=�Choose("Do you want to soak test the hard disc for defects (Y/N)","YN")="Y"
�V� �Choose("Are you certain you want to format drive "+�Drive%+" (Y/N)","YN")="N" �
��MoanOp(Specify%,0,0,0)
��
�:
�� �OldShape
�SecsPerTrk%=BootRec%?1
Heads%=BootRec%?2
Log2Alloc%=BootRec%?5
DiscSize%=BootRec%!&10
$3Cyls%=DiscSize% � (SecSize%*SecsPerTrk%*Heads%)
.'LowCurrentCyl%=(BootRec%!-8) � &3FF
8$PreCompCyl%=(BootRec%!-6) � &3FF
B8ParkCyl%=(BootRec%!-4)�(SecSize%*SecsPerTrk%*Heads%)
L�InitDiscRec
V�
`:
j� �AskMake
t�
~Makes%=0
��
� � Make$
� Makes%+=1
� � ;Makes%;". ";Make$
� � I%=1 � MakeParams%
�
  � A$
�	 � I%
�� Make$="OTHER"
�8Make%=�InputDec("Which make of hard disc ",1,Makes%)
��
� I%=(Make%-1)*(MakeParams%+1)
�ȕ I%>0
	 � A$


 I%-=1
�
N� Make$, SecsPerTrk%, Heads%, Cyls%, LowCurrentCyl%, PreCompCyl%, ParkCyl%
(� Make$;" chosen"
2�
<:
F� �ConfirmMake
P�
Z)� Make$, P1%, P2%, P3%, P4%, P5%, P6%
d� Make$="OTHER" �
nI � "The shape written on the disc does not match any of the standard"
x, � "drive shapes known by this program."
�@ =�Choose("Do you wish to retain this shape (Y/N)","YN")="Y"
��
�q� P1%<>SecsPerTrk% � P2%<>Heads% � P3%<>Cyls% � P4%<>LowCurrentCyl% � P5%<>PreCompCyl% � P6%<>ParkCyl% � �DZE
�G� "The shape written on the disc matches that of a ";Make$;" disc."
�?=�Choose("Do you wish to retain this shape (Y/N)","YN")="Y"
�:
�� �AskShape
�9� � �:� � �:� �=&1E6 NewMap%=�:� �TXF � �:�;" @ ";�:�
�ș "XFileCore_Create", 0
��
��
� �11
�> char%=�(�StrAsk("Old or New map format (O/N)","N")) � &DF
� char%=�"O" � char%=�"N"
NewMap%=(char%=�"N")
7SecsPerTrk%=�Ask("Sectors per track",SecsPerTrk%,1)
"DiscRec%?1=SecsPerTrk%
,!Heads%=�Ask("Heads",Heads%,1)
6�� Heads%>8 �'"WARNING - since the drive has more than 8 heads, the computer's"'"          'low write current/head select 3' links may need changing."'
@DiscRec%?2=Heads%
J#Cyls%=�Ask("Cylinders",Cyls%,1)
T/DiscSize%=SecSize%*SecsPerTrk%*Heads%*Cyls%
^DiscRec%!&10=DiscSize%
h@LowCurrentCyl%=�Ask("Low current cylinder",LowCurrentCyl%,0)
r>PreCompCyl%=�Ask("Precompensation cylinder",PreCompCyl%,0)
|0ParkCyl%=�Ask("Parking cylinder",ParkCyl%,0)
�� I%=0 � BootSize%-4 � 4
� Defect%!I%=Boot%!I%
�� I%
�Boot%!0=EndDefect%
��
� ptr%=0
�0 � '"Current Defects (Cylinder,Head,Sector)"
� ȕ Defect%!ptr%<EndDefect%
�  defect%=Defect%!ptr%
�   defect%=defect% � SecSize%
�#  sector%=defect% � SecsPerTrk%
�#  defect%=defect% � SecsPerTrk%
�P  � �((ptr%�4)�6)*13);"(";defect%�Heads%;",";defect%�Heads%;",";sector%;")";
  ptr%=ptr%+4
 �
 Defects%=ptr%�4
& �
0 � "A: no more changes"
:5 � "B: add defect by cylinder, head, byte/sector"
D � NewMap% �
N'  � "C: add defect by disc address"
X �
b?  � "C: add defect by LOGICAL disc address (eg disc error)"
l �
v � "D: remove defect"
�& opt$=�Choose("A,B,C or D","ABCD")
� Ȏ opt$ �
�  � "B","D":
�+   cyl%=�InputDec("Cylinder",0,Cyls%-1)
�)   head%=�InputDec("Head",0,Heads%-1)
�[   sector%=�InputDec2("Bytes from index MFM"," or -ve for sector",1-SecsPerTrk%,&10000)
�   � sector%>=0 �
�    sector%=sector% � 320
�   �
�    sector%=-sector%
�   �
�A   defect%=((cyl%*Heads%+head%)*SecsPerTrk%+sector%)*SecSize%
�   � opt$="B" �
    �AddPhysDefect(defect%)
   �
"    �RemovePhysDefect(defect%)
    �
*  � "C":
4   � NewMap% �
>N    �AddPhysDefect((�InputHex("Disc address in bytes")�SecSize%)*SecSize%)
H   �
R�    � "If ADFS gives an error such as 'Disc error 13 at :4/00012A00' then 00012A00 is a logical disc address. The logical to physical disc address mapping depends on the defect list. ";
\�    � " When these defects are added to the defect list, it is     important that they are added in DESCENDING order BEFORE the list is changed in any other way!"
fN    defect%=(�InputHex("Logical disc address in bytes")�SecSize%)*SecSize%
p+    �AddPhysDefect(�LogToPhys(defect%))
z   �
� �
�� opt$="A"
�� I%=0 � DiscStruc%-4 � 4
� BootRec%!I%=DiscRec%!I%
�� I%
��InitHardDesc
��
�:
�
� �Format
��=0
�� I%,J%,cyl%,head%
��MoanOp(Specify%,0,0,0)
��MoanOp(Restore%,0,0,0)
	� "Formatting"
	*� I%=0 � 512-4 � 4:Buf%!I%=&077F03FF:�
	� cyl%=0 � Cyls%-1
	$ �13:�cyl%;
	. � head%=0 � Heads%-1
	8,  � cyl%=0 � head%=0 � Formatted% � �DjI
	B  J%=cyl% � (head%<<24)
	L<  � I%=0 � (SecsPerTrk%-1)*4 � 4:Buf%!I%=J% � (I%<<14):�
	VH  �Op(WriteTrack%,(cyl%*Heads%+head%)*SecsPerTrk%*SecSize%,Buf%,512)
	`0  � Result% � ;" format error on this track"
	j �
	t�
	~�
	��
	�:
	�
� �Verify
	�d� SoakFlag% � '"PRESSING THE SPACE BAR WILL CAUSE THE SOAK TEST TO END AT THE END OF THAT CYCLE"
	�"� add%,ptr%,sector%,head%,cyl%
	�Cycle%=1:ErrorCycle%=-100
	�(CylSize%=SecSize%*SecsPerTrk%*Heads%
	�!suspects%=0:MaxSuspects%=1000
	�G� CylBuf% CylSize%+4, SusAdd%(MaxSuspects%), SusCount% MaxSuspects%
	��
	� � Cycle%>1 �
	�  I%=Cycle% � Patterns%
  � I%>1 �

   J%=Pattern%(I%)
#   J%=(J%>>>1) � ((J% � 1)<<23)
   Pattern%(I%)=J%
(  �
2   J%=�(&1000000)-1
<  �
F/  � � SoakFlag% � � "Writing pattern &";~J%
P2  � I%=CylBuf% � CylBuf%+CylSize% � 3:!I%=J%:�
Z  ptr%=0
d5  � Formatted% add%=SecSize%*SecsPerTrk% � add%=0
n  �
x2   CylEnd%=add% - (add% � CylSize%) + CylSize%
�   defect%=Defect%!ptr%
�   � defect%>CylEnd% �
�    length%=CylEnd%-add%
�   �
�    length%=defect%-add%
�   �
�!   �Op(Write%,add%,0,length%)
�   � Result% �
�/    add%=(ErrDiscAdd% � &1FFFFF00)+SecSize%
�   �
�    add%+=length%
�   �
�.   � add%=defect% � add%+=SecSize%:ptr%+=4
  � add%>=DiscSize%
 �
" � � SoakFlag% � � "Verifying"
" add%=0:ptr%=0
, �MoanOp(Restore%,0,0,0)
6 �
@  ȕ Defect%!ptr%<add%
J   ptr%+=4
T  �
^  defect%=Defect%!ptr%
h  � defect%>DiscSize% �
r   length%=DiscSize%-add%
|  �
�   length%=defect%-add%
�  �
�!  �Op(Verify%,add%,0,length%)
�  � Result% �
�#   add%=ErrDiscAdd% � &1FFFFF00
�
   Try%=0
�   �
�    Try%+=1
�    �MoanOp(Restore%,0,0,0)
�     �Op(Verify%,add%,0,&100)
�   � Result%=0 � Try%=5
�   � Result% Try%+=1
�   sector%=add% � SecSize%
"   head%=sector% � SecsPerTrk%
$   sector%=sector% � SecsPerTrk%
   cyl%=head% � Heads%
&   head%=head% � Heads%
0;   � "Cyl=";cyl%;" Head=";head%;" Sector=";sector%;" ";
:
   sus%=0
D8   ȕ sus%<suspects% � SusAdd%(sus%)<>add%:sus%+=1:�
N   � sus%=suspects% �
X"    � suspects%=MaxSuspects% �
b     sus%=�(MaxSuspects%)-1
l	    �
v     suspects%+=1
�	    �
�    SusAdd%(sus%)=add%
�    SusCount%?sus%=0
�   �
�   score%=2^(Try%-1)-1
�$   � � SoakFlag% score%=score%*4
�   SusCount%?sus%+=score%
�   � SusCount%?sus%>30 �
�    � "defect ";
�    � SoakFlag% �
�     �("TIME")
�	    �
�
     �

	    �

    �AddPhysDefect(add%)

    ErrorCycle%=Cycle%

    �

*    � SoakFlag% �

4'     �=0:� � �>500:� 13:�(39);:�13

>	    �

H"     � ;Try%;" retries needed"

R	    �

\   �

f   add%=add%+SecSize%

p  �

z!   add%=add%+length%+SecSize%

�  �

�  � add%>defect% �

�   ptr%+=4

�  �

� � add%>=DiscSize%

� � SoakFlag% �

�  �

�   Key%=�(0)

�  � Key%=-1 � Key%=32

�  done%=(Key%=32)

� �

�   done%=Cycle%>ErrorCycle%+2

� �
 Cycle%+=1
� done%
�
$:
.� �Structure
8� NewMap% �
B �NewStructure
L�
V �OldStructure
`�
j�
t:
~� �OldStructure
��WriteDefectList
��WriteOldFsMap
��WriteRootDir
��
�:
�� �NewStructure
�Zone0Bits%=60*8
�ZoneBits%=SecSize%*8
�(Log2Alloc%=9: � requested by TCs ECR
�2� Log2Alloc%<8 � Log2Alloc%>12 � Log2Alloc%=10
��: � allocation size loop
�? Alloc%=�Ask("Large file allocation unit",2^Log2Alloc%,256)
 Log%=7

 �

  Log%+=1
 � Alloc%=2^Log% � Log%=13
(, � Log%=13 � �:� restart alloc size loop
2 Log2Alloc%=Log%
<  MapBits%=DiscSize% � Alloc%
F! RoundSize%=MapBits% * Alloc%
P4 BestZones%=1 << 30      :� init to rogue values
Z BestCylOff%=1 << 30
d � DummySpare%=1 � 1
n2 � SpareBits% = 4*8 � ZoneBits%-Zone0Bits%-8*8
x  �CalcZones
�  LinkBits%=10
�  � LinkBits%+=1
�   �CalcIds
�  � Ids%<=2^LinkBits%
�A  � SpareBits%-4*8>0 � SpareBits%-4*8<=LinkBits% � SpareBits%
�5  � OddBits%>0 � OddBits%<=LinkBits% � SpareBits%
�#  � LinkBits%>15 � Zones%>127 �
�$   � "Allocation unit too small"
�   Log2Alloc%+=1
�   � DummySpare%
�&   � �  :� restart alloc size loop
�  �
�  � Zones% <= BestZones% �
*   Crucial%=Zones%*SecSize%*2+DirSize%
/   � MapZone%=0 Crucial%=BootAdd%+BootSize%
D   � Crucial%<Alloc%*(LinkBits%+1) Crucial%=Alloc%*(LinkBits%+1)
"#   CrucialEnd%=MapAdd%+Crucial%
,   DefPtr%=Defect%
6   �
@    defect%=!DefPtr%
J    DefPtr%+=4
TG   � defect%>=EndDefect% � (defect%>=MapAdd% � defect%<CrucialEnd%)
^6   CylOff%=MapAdd% � (SecSize%*SecsPerTrk%*Heads%)
h4   � defect%>=EndDefect% � CylOff%<BestCylOff% �
r    BestCylOff%=CylOff%
|    BestLinkBits%=LinkBits%
�    BestSpare%=SpareBits%
�    BestZones%=Zones%
�   �
�!   � BestCylOff% � SpareBits%
�   � DummySpare%
�  �
�   � DummySpare%
�  �
�A� BestZones%=(1<<30) � � "Can't use this allocation size":� �
�� �
�LinkBits%=BestLinkBits%
�SpareBits%=BestSpare%
��CalcZones
�CalcIds
'Crucial%=Zones%*SecSize%*2+DirSize%
,� MapZone%=0 Crucial%=BootAdd%+BootSize%
&A� Crucial%<Alloc%*(LinkBits%+1) Crucial%=Alloc%*(LinkBits%+1)
0=� Crucial% � Alloc%<>0 Crucial%+=Alloc%-Crucial% � Alloc%
:� MapZone%=0 �
D# RootDirAdd%=BootAdd%+BootSize%
N> IndRootDirAdd%=&200 + (BootAdd%+BootSize%) � SecSize% + 1
X�
b" RootDirAdd%=MapAdd%+MapLen%*2
l# IndRootDirAdd%=&200+Zones%*2+1
v�
�DiscRec%?4=LinkBits%
�DiscRec%?5=Log2Alloc%
�DiscRec%?9=Zones%
� DiscRec%?&A=SpareBits% � 256
� DiscRec%?&B=SpareBits% � 256
�DiscRec%!&C=IndRootDirAdd%
�BootRec%!4=DiscRec%!4
�BootRec%!8=DiscRec%!8
�BootRec%!&C=DiscRec%!&C
�"� I%=0 � Zones%*SecSize%-4 � 4
� Buf%!I%=0
�� I%
�� I%=0 � 60-4 � 4
 Buf%!(I%+4)=DiscRec%!I%
� I%
�WriteDefectList
 � "Creating Map"
*
ptr%=0
4DefectStart%=0
>%DiscEndBit%=�DiscToMap(DiscSize%)
HZoneStart%=Buf%
RZoneStartBit%=0
\� zone%=0 � Zones%-1
f$ !ZoneStart%=1<<(15+FreeLink%*8)
p( ZoneEndBit%=ZoneStartBit%+ZoneBits%
z/ UsedZoneEndBit%=ZoneEndBit%-SpareBits%+4*8
�$ � UsedZoneEndBit%>DiscEndBit% �
�!  UsedZoneEndBit%=DiscEndBit%
� �
�' PreFree%=ZoneStartBit%+FreeLink%*8
� ZoneBit%=ZoneStartBit%+4*8
� � zone%=0 �
�"  ZoneBit%=ZoneBit%+Zone0Bits%
�+  length%=(BootAdd%+BootSize%) � Alloc%
�/  � length%<LinkBits%+1 length%=LinkBits%+1
�  �WriteLink(ZoneBit%,2)
�$  �WriteLength(ZoneBit%,length%)
�  ZoneBit%=ZoneBit%+length%
� �
  � zone%=MapZone% �
    length%=Crucial% � Alloc%
   �WriteLink(ZoneBit%,2)
$%   �WriteLength(ZoneBit%,length%)
.    ZoneBit%=ZoneBit%+length%
8  �
B �
L �
V  � ZoneBit%>DefectStart% �
`,   DefectStart%=�DiscToMap(Defect%!ptr%)
j(   � DefectStart%>=UsedZoneEndBit% �
t     DefectStart%=ZoneEndBit%
~   �
�!    DefectEnd%=DefectStart%+1
�    ptr%+=4
�	    �
�     done1%=�
�
     �
�      done2%=�
�.      NextDefect%=�DiscToMap(Defect%!ptr%)
�)      � NextDefect%<UsedZoneEndBit% �
�4       � NextDefect%>ZoneEndBit%-(LinkBits%+1) �
�.        NextDef%=ZoneEndBit%-(LinkBits%+1)
�       �
�         NextDef%=NextDefect%
       �

.       � NextDef%-DefectEnd%<LinkBits%+1 �
(        � NextDefect%+1>DefectEnd% �
%         DefectEnd%=NextDefect%+1
(
        �
2        ptr%+=4
<        done2%=�
F       �
P      �
Z     � done2%
d0     � DefectEnd%-DefectStart%<LinkBits%+1 �
n-      DefectEnd%=DefectStart%+LinkBits%+1
x$      � DefectEnd%>ZoneEndBit% �
�!       DefectEnd%=ZoneEndBit%
�      �
�      done1%=�
�
     �
�K     � DefectEnd%>ZoneEndBit%-(LinkBits%+1) � DefectEnd%<>ZoneEndBit% �
�       DefectEnd%=ZoneEndBit%
�      done1%=�
�
     �
�0     � DefectEnd%-DefectStart%<LinkBits%+1 �
�/      DefectStart%=DefectEnd%-(LinkBits%+1)
�
     �
�    � done1%
�   �
  �
3  � ZoneBit%>DefectStart% � "PROGRAM ERROR 1":�
B  � DefectStart%-ZoneBit% <= LinkBits% � DefectStart%=ZoneBit%
"  � DefectStart%>ZoneBit% �
,-   �WriteLink(PreFree%,ZoneBit%-PreFree%)
6(   � DefectStart%>=UsedZoneEndBit% �
@7    �WriteLength(ZoneBit%,UsedZoneEndBit%-ZoneBit%)
J'    � ZoneEndBit%>UsedZoneEndBit% �
T&     �WriteLink(UsedZoneEndBit%,1)
^B     �WriteLength(UsedZoneEndBit%,ZoneEndBit%-UsedZoneEndBit%)
h	    �
r   �
|4    �WriteLength(ZoneBit%,DefectStart%-ZoneBit%)
�   �
�  PreFree%=ZoneBit%
�  �
�"  � DefectStart%<ZoneEndBit% �
�3   � DefectEnd%>UsedZoneEndBit%-(LinkBits%+1) �
�    DefectEnd%=ZoneEndBit%
�   �
�!   �WriteLink(DefectStart%,1)
�9   �WriteLength(DefectStart%,DefectEnd%-DefectStart%)
�   ZoneBit%=DefectEnd%
�  �
�   ZoneBit%=ZoneEndBit%
�  �
 � ZoneBit%=ZoneEndBit%
 �WriteLink(PreFree%,0)
 � zone%=0 �
&   ZoneStart%?CrossCheck%=&FF
0 �
:  ZoneStart%?CrossCheck%=0
D �
N2 ?ZoneStart%=�NewMapCheck(ZoneStart%,SecSize%)
X# ZoneStart%=ZoneStart%+SecSize%
b ZoneStartBit%=ZoneEndBit%
l� zone%
v� "Writing map"
�(�MoanOp(Write%,MapAdd%,Buf%,MapLen%)
�0�MoanOp(Write%,MapAdd%+MapLen%,Buf%,MapLen%)
��WriteRootDir
��
�:
�� �CalcZones
�#UsedBits%=SecSize%*8-SpareBits%
�1WholeZones%=(MapBits%+Zone0Bits%) � UsedBits%
�.OddBits%=(MapBits%+Zone0Bits%) � UsedBits%
�8� OddBits% Zones%=WholeZones%+1 � Zones%=WholeZones%
�MapZone%=Zones% � 2
�� MapZone%=0 �
� MapAdd%=0
�
3 MapAdd%=(UsedBits%*MapZone%-Zone0Bits%)*Alloc%
�
 MapLen%=Zones%*SecSize%
*�
4:
>� �CalcIds
H)IdsPerZone%=UsedBits% � (LinkBits%+1)
R=Ids%=IdsPerZone% * WholeZones% + OddBits% � (LinkBits%+1)
\�
f:
p� �DiscToMap(discadd%)
z� bit%,zone%
�'bit%=(discadd% � Alloc%)+Zone0Bits%
�zone%=bit% � UsedBits%
�/bit%=bit%+(bit% � UsedBits%)*SpareBits%+4*8
�
= bit%
�:
�� �WriteLink(off%,link%)
�.� link%>=2^LinkBits% � "PROGRAM ERROR 2":�
�� bit%,add%,mask%
�bit%=off% � 8
�add%=Buf%+off% � 8
�mask%=2^LinkBits%-1
�1!add%=(!add% � � (mask%<<bit%)) � link%<<bit%
��
:
� �WriteLength(off%,len%)
+� len%<=LinkBits% � "PROGRAM ERROR 3":�
$off%=off%+len%-1
.Buf%?(off%�8)+=2^(off%�8)
8�
B:
L� �WriteDefectList
V� "Writing defect list"
`
ptr%=0
jcheck%=0
tȕ Defect%!ptr%<EndDefect%
~ Boot%!ptr%=Defect%!ptr%
� �CheckPut(Boot%!ptr%)
� ptr%=ptr%+4
��
�!check%=check% � (check%>>>16)
�'check%=(check% � (check%>>>8))� &FF
�"Boot%!ptr%=EndDefect% � check%
��Sum(Boot%,BootSize%)
�,�MoanOp(Write%,BootAdd%,Boot%,BootSize%)
��
�:
�� �WriteOldFsMap
�� "Writing free space map"
� s%,I%

s%=OldMapSize% � 2
*� I%=0 � OldMapSize%-4 � 4:Buf%!I%=0:�
!Buf%=OldLWM% � &100
(8Buf%!s%=(DiscSize%-OldLWM%-Defects%*SecSize%) � &100
2!!(Buf%+s%-4)=DiscSize% � &100
<%!(Buf%+OldMapSize%-5)=�(&10000)-1
F!(Buf%+OldMapSize%-2)=3
P�Sum(Buf%,s%)
Z�Sum(Buf%+s%,s%)
d/�MoanOp(Write%,OldMapAdd%,Buf%,OldMapSize%)
n�
x:
�� �WriteRootDir
�� "Writing root directory"
�	� BF%
�'� I%=0 � DirSize%-4 � 4:Buf%!I%=0:�
�� NewMap% �
� $DirMark%="Hugo"
��
� $DirMark%="Hugo"
��
�Buf%!1=!DirMark%
�BF%=Buf%+DirSize%
�� NewMap% �
� BF%!-38=IndRootDirAdd%
�
" BF%!-38=IndRootDirAdd% � &100
�
"BF%?-35=�"$"
,BF%?-16=�"$"
6BF%!-5=!DirMark%
@check%=0
J�CheckPut(!Buf%)
T�CheckPut(Buf%?4)
^
I%=BF%-40
hȕ I%�3
r �CheckPut(?I%)
| I%=I%+1
��
�ȕ I%<BF%-4
� �CheckPut(!I%)
� I%=I%+4
��
�!check%=check% � (check%>>>16)
�'check%=(check% � (check%>>>8))� &FF
�BF%?-1=check%
�-�MoanOp(Write%,RootDirAdd%,Buf%,DirSize%)
��
�:
�� �LogToPhys(add%)
�
� ptr%

ptr%=0
ȕ add%>=Defect%!ptr%
 ptr%=ptr%+4
& add%=add%+SecSize%
0�
:	=add%
D:
N� �AddPhysDefect(add%)
X� ptr%,ptr2%,defect%
b� Defects%<MaxDefects% �
l ȕ Defect%!ptr%<add%
v  ptr%=ptr%+4
� �
� defect%=Defect%!ptr%
� � defect%=add% �
�'  � "Defect already in defect list"
� �
�  ptr2%=Defects%*4
�  ȕ ptr2%>=ptr%
�&   Defect%!(ptr2%+4)=Defect%!ptr2%
�   ptr2%=ptr2%-4
�  �
�  Defect%!ptr%=add%
�  Defects%=Defects%+1
� �
�
 � "Defect list full"
�
 �
*:
4� �RemovePhysDefect(add%)
>� ptr%,ptr2%,defect%
Hȕ Defect%!ptr%<add%
R ptr%=ptr%+4
\�
fdefect%=Defect%!ptr%
p� defect%=add% �
z ȕ ptr%<Defects%*4
�#  Defect%!ptr%=Defect%!(ptr%+4)
�  ptr%=ptr%+4
� �
� Defects%=Defects%-1
��
�" � "Defect not in defect list"
��
��
�:
�� �GoodDefects
�ptr%=-4
�check%=0
�last%=-1
good%=�
�
 ptr%=ptr%+4
$ defect%=Boot%!ptr%
. � defect%<=last% good%=�
8 last%=defect%
B, � defect%<EndDefect% �CheckPut(defect%)
L'� (defect% >= EndDefect%) � � good%
VDefects%=ptr%�4
`!check%=check% � (check%>>>16)
j'check%=(check% � (check%>>>8))� &FF
tT= good% � ((defect%�&FF) = check%) � (�sum(Boot%,BootSize%)=Boot%?(BootSize%-1))
~:
�� �InitDiscRec
�� I%=0 � 64-4 � 4
� DiscRec%!I%=0
�� I%
�?DiscRec%=Log2SecSize%
�DiscRec%?1=SecsPerTrk%
�DiscRec%?2=Heads%
�DiscRec%!&C=IndRootDirAdd%
�DiscRec%!&10=DiscSize%
�DiscRec%!&14=�(&10000)-1
�&$(DiscRec%+&16)="HardDisc"+�Drive%
�DiscRec%?&22=Drive%
�

:
� �InitBootDefects
!Boot%=EndDefect%
(Defects%=0
2�InitHardDesc
<�
F:
P� �InitHardDesc
Z.BootRec%!-&10= &00000000      :� SL xxxxxx
d6BootRec%!-&C = &0D0C200A      :� GPL2 GPL3 SH GPL1
n9� BootRec%!-&10= &16000000  slow stepping alternative
x9� BootRec%!-&C = &0D0CA80A  slow stepping alternative
�5BootRec%!-8  = LowCurrentCyl% � (PreCompCyl%<<16)
�7BootRec%!-4  = SecSize%*SecsPerTrk%*Heads%*ParkCyl%
��
�:
�!� �Ask(String$,Default%,min%)
�� X,Y,reply$,value%
�� �
�	�:�11
�� String$;" ?";: X=�: Y=�
�	� � �
��
� � �X,Y);Default%;�3;�X,Y);
�
 *FX 15,1
 �""reply$
 � reply$="" �
  value%=Default%
" �
,  value%=�(reply$)
6 �
@� value%>=min%
J� �X,Y);value%;�3
T=value%
^:
h� �StrAsk(String$,Default$)
r� X,Y,reply$
|	�:�11
�� String$;" ?";: X=�: Y=�
�*� �X,Y);Default$;�12;�X,Y);: �""reply$
�#� reply$="" � reply$ = Default$
�� �X,Y);reply$;�3
�= reply$
�:
�"� �InputDec(String$,min%,max%)
�� X,Y,reply$,value%
�� �
�	�:�11
�4� String$;" (";min%;" to ";max%;" ) ";: X=�: Y=�
�	� � �
��
 ! � �X,Y);�12;�X,Y);: � reply$
  value%=�(reply$)
 !� value%>=min% � value%<=max%
 &= value%
 0:
 :-� �InputDec2(String1$,String2$,min%,max%)
 D� X,Y,reply$,value%
 N� �
 X	�:�11
 b$� String1$;" (1 to ";max%;" ),";
 l.� String2$;" (0 to ";min%;" ) ";: X=�: Y=�
 v	� � �
 ��
 �! � �X,Y);�12;�X,Y);: � reply$
 � value%=�(reply$)
 �!� value%>=min% � value%<=max%
 �= value%
 �:
 �� �InputHex(String$)
 �� X,Y,reply$,value%
 �� �
 �	�:�11
 �� String$;" &";: X=�: Y=�
 �	� � �
 �"� �X,Y);�12;�X,Y);: � ""reply$
!=�("&"+reply$)
!:
!� �Choose(String$,opt$)
! � X,Y,reply$
!*	�:�11
!4� String$;" ?";: X=�: Y=�
!>�
!H �
!R$  � �X,Y);�12;�X,Y);: � ""reply$
!\ � �(reply$)=1
!f reply$=�(�(reply$)�&DF)
!p� �opt$,reply$)
!z=reply$
!�:
!�� �CheckPut(I%)
!�Bcheck%=(check% >>> 13) � ((check% � (2^13-1)) << (32-13)) � I%
!��
!�:
!�� �sum(base%,len%)
!�sum%=0:c%=0
!�� I%=len%-2 � 0 �-1
!�sum%=sum%+base%?I%+c%
!�+� sum%<&100 c%=0 � sum%=sum% � &FF:c%=1
!�� I%
!�	=sum%
!�:
"� �Sum(base%,len%)
"#base%?(len%-1)=�sum(base%,len%)
"�
"$:
".&� �NewMapCheck(B%,C%)=�(NewCheck%)
"8:
"B
� �Asm
"L� opt%=0 � 2 � 2
"V P%=mc%
"` [ OPT opt%
"j.NewCheck%
"t MOV  R0,#0
"~ ADDS R2,R1,R2  \C=0
"�
.loop%
"� LDR  R3,[R2,#-4]!
"� ADCS R0,R0,R3
"� TEQS R2,R1
"� BNE  loop%
"� �  R3,R3,#&FF
"� SUB  R0,R0,R3
"� �  R0,R0,R0,LSR #16
"� �  R0,R0,R0,LSR #8
"� �  R0,R0,#&FF
"� MOVS PC,R14
"� ]
#
� opt%
#
�
#:
#� �DisableEscape
#(+ș "XOS_Byte",200,1,0 � R0,OldEscState%
#25ș "XOS_Byte",247,%10101010,0 � R0,OldBreakState%
#<�
#F:
#P� �RestoreEscape
#Z$ș "XOS_Byte",200,OldEscState%,0
#d&ș "XOS_Byte",247,OldBreakState%,0
#n�
#x:
#�� �MoanOp(b%, C%, D%, E%)
#�Pș AdfsSwi%, 0, b% � AltDefectBit% � (DiscRec%<<6), C% � Drive%<< 29, D%, E%
#��
#�:
#�� �Op(b%, C%, D%, E%)
#�vș AdfsSwi% � (1<<17), 0, b% � AltDefectBit% � (DiscRec%<<6), C% � Drive%<< 29, D%, E% � Result%, R1%, ErrDiscAdd%
#�� Result% �
#� � Result% � (1 << 31) �
#�(  � "Error &";~Result% � &3FFFFFFF:�
#� �
#�-  � ((!Result%) � &FFFFFF)=AdfsDiscErr% �
#�   Result%=Result%?3
#�  �
$!   � "Error &";~!Result%;" ";
$   I%=4
$   ȕ Result%?I%
$"    � Result%?I%
$,    I%=I%+1
$6   �
$@   �
$J  �
$T �
$^�
$h�
$r�
$|:
$�y� Manufacturer, Sectors per track, heads, cylinders, low current cylinder, precompensation cylinder, parking cylinder
$�J� 20Mb Miniscribe 8425,                    32, 4, 615, &3FF,  128, 663
$�J� 53Mb Rodime RO3065,                      32, 7, 872, &3FF,  650, 871
$�[� OTHER,                                   32, 4, 612, &3FF,  128, 611:REM MUST BE LAST
$�K�  20Mb Western Digital WD362/Tandon TM362, 32, 4, 615, &3FF, &3FF, 663
$�K�  20Mb NEC,                                32, 4, 612, &3FF,  256, 672
$�K�  20Mb Olivetti,                           32, 4, 612, &3FF,  128, 670
$�[� For slow stepping drives you will need to use the alternate lines in PROCInitHardDesc
�
00000000  0d 00 0a 0c f4 20 3e 48  46 4f 52 4d 0d 00 14 26  |..... >HFORM...&|
00000010  76 65 72 73 69 6f 6e 24  3d 22 31 2e 37 38 22 3a  |version$="1.78":|
00000020  20 64 61 74 65 24 3d 22  31 38 2d 4a 61 6e 2d 39  | date$="18-Jan-9|
00000030  30 22 0d 00 1e 24 f4 20  46 6f 72 6d 61 74 74 65  |0"...$. Formatte|
00000040  72 20 66 6f 72 20 53 54  35 30 36 20 68 61 72 64  |r for ST506 hard|
00000050  20 64 69 73 63 73 0d 00  28 2e f4 20 66 6f 72 20  | discs..(.. for |
00000060  53 43 53 49 20 68 61 72  64 20 64 69 73 63 73 2c  |SCSI hard discs,|
00000070  20 73 65 65 20 53 43 53  49 20 75 73 65 72 20 67  | see SCSI user g|
00000080  75 69 64 65 0d 00 32 07  eb 20 30 0d 00 3c 09 f2  |uide..2.. 0..<..|
00000090  49 6e 69 74 0d 00 46 0d  f2 47 65 74 53 68 61 70  |Init..F..GetShap|
000000a0  65 0d 00 50 12 f2 44 69  73 61 62 6c 65 45 73 63  |e..P..DisableEsc|
000000b0  61 70 65 0d 00 5a 0b f2  46 6f 72 6d 61 74 0d 00  |ape..Z..Format..|
000000c0  64 0b f2 56 65 72 69 66  79 0d 00 6e 0e f2 53 74  |d..Verify..n..St|
000000d0  72 75 63 74 75 72 65 0d  00 78 12 f2 52 65 73 74  |ructure..x..Rest|
000000e0  6f 72 65 45 73 63 61 70  65 0d 00 82 12 2a 52 4d  |oreEscape....*RM|
000000f0  52 45 49 4e 49 54 20 41  44 46 53 0d 00 8c 1d ff  |REINIT ADFS.....|
00000100  28 22 2d 41 44 46 53 2d  25 46 52 45 45 20 22 2b  |("-ADFS-%FREE "+|
00000110  c3 44 72 69 76 65 25 29  0d 00 96 21 ff 28 22 2d  |.Drive%)...!.("-|
00000120  41 44 46 53 2d 25 44 49  53 4d 4f 55 4e 54 20 22  |ADFS-%DISMOUNT "|
00000130  2b c3 44 72 69 76 65 25  29 0d 00 a0 05 e0 0d 00  |+.Drive%).......|
00000140  aa 05 3a 0d 00 b4 0b dd  20 f2 49 6e 69 74 0d 00  |..:..... .Init..|
00000150  be 11 4d 61 6b 65 50 61  72 61 6d 73 25 3d 36 0d  |..MakeParams%=6.|
00000160  00 c8 14 56 65 72 69 66  79 52 65 74 72 69 65 73  |...VerifyRetries|
00000170  25 3d 31 0d 00 d2 14 44  65 66 65 63 74 52 65 74  |%=1....DefectRet|
00000180  72 69 65 73 25 3d 35 0d  00 dc 0d 56 65 72 69 66  |ries%=5....Verif|
00000190  79 25 3d 30 0d 00 e6 0b  52 65 61 64 25 3d 31 0d  |y%=0....Read%=1.|
000001a0  00 f0 0c 57 72 69 74 65  25 3d 32 0d 00 fa 11 57  |...Write%=2....W|
000001b0  72 69 74 65 54 72 61 63  6b 25 3d 34 0d 01 04 0e  |riteTrack%=4....|
000001c0  52 65 73 74 6f 72 65 25  3d 36 0d 01 0e 0f 53 70  |Restore%=6....Sp|
000001d0  65 63 69 66 79 25 3d 26  46 0d 01 18 15 41 6c 74  |ecify%=&F....Alt|
000001e0  44 65 66 65 63 74 42 69  74 25 3d 26 31 30 0d 01  |DefectBit%=&10..|
000001f0  22 12 44 69 73 63 53 74  72 75 63 25 3d 26 31 34  |".DiscStruc%=&14|
00000200  0d 01 2c 12 4c 6f 67 32  53 65 63 53 69 7a 65 25  |..,.Log2SecSize%|
00000210  3d 38 0d 01 36 1b 53 65  63 53 69 7a 65 25 3d 32  |=8..6.SecSize%=2|
00000220  5e 4c 6f 67 32 53 65 63  53 69 7a 65 25 0d 01 40  |^Log2SecSize%..@|
00000230  10 4f 6c 64 4d 61 70 41  64 64 25 3d 30 0d 01 4a  |.OldMapAdd%=0..J|
00000240  14 4f 6c 64 4d 61 70 53  69 7a 65 25 3d 26 32 30  |.OldMapSize%=&20|
00000250  30 0d 01 54 11 44 69 72  53 69 7a 65 25 3d 26 38  |0..T.DirSize%=&8|
00000260  30 30 0d 01 5e 11 42 6f  6f 74 41 64 64 25 3d 26  |00..^.BootAdd%=&|
00000270  43 30 30 0d 01 68 12 42  6f 6f 74 53 69 7a 65 25  |C00..h.BootSize%|
00000280  3d 26 32 30 30 0d 01 72  25 4d 61 78 44 65 66 65  |=&200..r%MaxDefe|
00000290  63 74 73 25 3d 28 42 6f  6f 74 53 69 7a 65 25 2d  |cts%=(BootSize%-|
000002a0  36 34 2d 26 43 2d 34 29  81 34 0d 01 7c 16 45 6e  |64-&C-4).4..|.En|
000002b0  64 44 65 66 65 63 74 25  3d 31 20 3c 3c 20 32 39  |dDefect%=1 << 29|
000002c0  0d 01 86 10 4f 6c 64 4c  57 4d 25 3d 26 45 30 30  |....OldLWM%=&E00|
000002d0  0d 01 90 0f 46 72 65 65  4c 69 6e 6b 25 3d 31 0d  |....FreeLink%=1.|
000002e0  01 9a 11 43 72 6f 73 73  43 68 65 63 6b 25 3d 33  |...CrossCheck%=3|
000002f0  0d 01 a4 13 41 64 66 73  53 77 69 25 3d 26 34 30  |....AdfsSwi%=&40|
00000300  32 34 30 0d 01 ae 17 41  64 66 73 44 69 73 63 45  |240....AdfsDiscE|
00000310  72 72 25 3d 26 31 30 38  43 37 0d 01 b8 14 4d 61  |rr%=&108C7....Ma|
00000320  78 56 65 72 69 66 79 42  61 64 25 3d 31 36 0d 01  |xVerifyBad%=16..|
00000330  c2 0f 50 61 74 74 65 72  6e 73 25 3d 38 0d 01 cc  |..Patterns%=8...|
00000340  7a de 20 42 75 66 25 20  26 38 30 30 30 2c 20 44  |z. Buf% &8000, D|
00000350  69 73 63 52 65 63 25 20  36 34 2b 42 6f 6f 74 53  |iscRec% 64+BootS|
00000360  69 7a 65 25 2c 20 44 65  66 65 63 74 25 20 42 6f  |ize%, Defect% Bo|
00000370  6f 74 53 69 7a 65 25 2c  20 44 69 72 4d 61 72 6b  |otSize%, DirMark|
00000380  25 20 35 2c 20 42 61 64  25 28 4d 61 78 56 65 72  |% 5, Bad%(MaxVer|
00000390  69 66 79 42 61 64 25 29  2c 6d 63 25 20 31 30 30  |ifyBad%),mc% 100|
000003a0  2c 20 50 61 74 74 65 72  6e 25 28 50 61 74 74 65  |, Pattern%(Patte|
000003b0  72 6e 73 25 2d 31 29 0d  01 d6 15 42 6f 6f 74 25  |rns%-1)....Boot%|
000003c0  3d 44 69 73 63 52 65 63  25 2b 36 34 0d 01 e0 1f  |=DiscRec%+64....|
000003d0  42 6f 6f 74 52 65 63 25  3d 42 6f 6f 74 25 2b 42  |BootRec%=Boot%+B|
000003e0  6f 6f 74 53 69 7a 65 25  2d 36 34 0d 01 ea 17 50  |ootSize%-64....P|
000003f0  61 74 74 65 72 6e 25 28  32 29 3d 26 46 46 46 46  |attern%(2)=&FFFF|
00000400  46 46 0d 01 f4 17 50 61  74 74 65 72 6e 25 28 33  |FF....Pattern%(3|
00000410  29 3d 26 36 44 42 36 44  42 0d 01 fe 11 50 61 74  |)=&6DB6DB....Pat|
00000420  74 65 72 6e 25 28 34 29  3d 30 0d 02 08 17 50 61  |tern%(4)=0....Pa|
00000430  74 74 65 72 6e 25 28 35  29 3d 26 32 43 42 32 43  |ttern%(5)=&2CB2C|
00000440  42 0d 02 12 17 50 61 74  74 65 72 6e 25 28 36 29  |B....Pattern%(6)|
00000450  3d 26 35 41 35 41 35 41  0d 02 1c 17 50 61 74 74  |=&5A5A5A....Patt|
00000460  65 72 6e 25 28 37 29 3d  26 34 44 33 34 44 33 0d  |ern%(7)=&4D34D3.|
00000470  02 26 44 f1 20 27 27 22  48 20 41 20 52 20 44 20  |.&D. ''"H A R D |
00000480  20 20 44 20 49 20 53 20  43 20 20 20 46 20 4f 20  |  D I S C   F O |
00000490  52 20 4d 20 41 20 54 20  54 20 45 20 52 20 20 20  |R M A T T E R   |
000004a0  28 56 20 22 3b 76 65 72  73 69 6f 6e 24 3b 22 29  |(V ";version$;")|
000004b0  22 27 27 0d 02 30 05 f5  0d 02 3a 08 20 ef 31 31  |"''..0....:. .11|
000004c0  0d 02 44 33 20 44 72 69  76 65 25 3d a4 41 73 6b  |..D3 Drive%=.Ask|
000004d0  28 22 46 6f 72 6d 61 74  20 77 68 69 63 68 20 64  |("Format which d|
000004e0  72 69 76 65 20 28 34 20  6f 72 20 35 29 22 2c 34  |rive (4 or 5)",4|
000004f0  2c 34 29 0d 02 4e 19 fd  20 44 72 69 76 65 25 3d  |,4)..N.. Drive%=|
00000500  34 20 84 20 44 72 69 76  65 25 3d 35 0d 02 58 1f  |4 . Drive%=5..X.|
00000510  c8 99 22 41 44 46 53 5f  44 72 69 76 65 73 22 20  |.."ADFS_Drives" |
00000520  b8 20 2c 2c 48 44 69 73  63 73 25 0d 02 62 1a e7  |. ,,HDiscs%..b..|
00000530  20 28 44 72 69 76 65 25  2d 33 29 3e 48 44 69 73  | (Drive%-3)>HDis|
00000540  63 73 25 20 8c 0d 02 6c  3d 20 f1 22 54 68 69 73  |cs% ...l= ."This|
00000550  20 6d 61 63 68 69 6e 65  20 69 73 20 63 6f 6e 66  | machine is conf|
00000560  69 67 75 72 65 64 20 61  73 20 27 48 61 72 64 44  |igured as 'HardD|
00000570  69 73 63 73 20 22 3b 48  44 69 73 63 73 25 3b 22  |iscs ";HDiscs%;"|
00000580  27 22 0d 02 76 37 20 f1  22 70 6c 65 61 73 65 20  |'"..v7 ."please |
00000590  63 68 65 63 6b 2f 61 6c  74 65 72 20 74 68 65 20  |check/alter the |
000005a0  63 6f 6e 66 69 67 75 72  61 74 69 6f 6e 20 61 6e  |configuration an|
000005b0  64 20 72 65 2d 72 75 6e  22 0d 02 80 15 20 f1 22  |d re-run".... ."|
000005c0  74 68 69 73 20 70 72 6f  67 72 61 6d 2e 22 0d 02  |this program."..|
000005d0  8a 06 20 e0 0d 02 94 05  cd 0d 02 9e 4d 53 65 63  |.. .........MSec|
000005e0  73 50 65 72 54 72 6b 25  3d 33 32 3a 48 65 61 64  |sPerTrk%=32:Head|
000005f0  73 25 3d 31 3a 43 79 6c  73 25 3d 31 3a 4c 6f 77  |s%=1:Cyls%=1:Low|
00000600  43 75 72 72 65 6e 74 43  79 6c 25 3d 31 3a 50 72  |CurrentCyl%=1:Pr|
00000610  65 43 6f 6d 70 43 79 6c  25 3d 31 3a 50 61 72 6b  |eCompCyl%=1:Park|
00000620  43 79 6c 25 3d 31 0d 02  a8 22 52 6f 6f 74 44 69  |Cyl%=1..."RootDi|
00000630  72 41 64 64 25 3d 26 34  30 30 3a 4c 6f 67 32 41  |rAdd%=&400:Log2A|
00000640  6c 6c 6f 63 25 3d 31 30  0d 02 b2 1e 49 6e 64 52  |lloc%=10....IndR|
00000650  6f 6f 74 44 69 72 41 64  64 25 3d 52 6f 6f 74 44  |ootDirAdd%=RootD|
00000660  69 72 41 64 64 25 0d 02  bc 2f 44 69 73 63 53 69  |irAdd%.../DiscSi|
00000670  7a 65 25 3d 53 65 63 53  69 7a 65 25 2a 53 65 63  |ze%=SecSize%*Sec|
00000680  73 50 65 72 54 72 6b 25  2a 48 65 61 64 73 25 2a  |sPerTrk%*Heads%*|
00000690  43 79 6c 73 25 0d 02 c6  10 ee 20 85 20 ea 20 e5  |Cyls%..... . . .|
000006a0  20 8d 64 5a 42 0d 02 d0  21 ff 28 22 2d 41 44 46  | .dZB...!.("-ADF|
000006b0  53 2d 25 44 49 53 4d 4f  55 4e 54 20 22 2b c3 44  |S-%DISMOUNT "+.D|
000006c0  72 69 76 65 25 29 0d 02  da 09 ee 20 85 20 87 0d  |rive%)..... . ..|
000006d0  02 e4 08 f2 41 73 6d 0d  02 ee 05 e1 0d 02 f8 05  |....Asm.........|
000006e0  3a 0d 03 02 0f dd 20 f2  47 65 74 53 68 61 70 65  |:..... .GetShape|
000006f0  0d 03 0c 14 f2 49 6e 69  74 42 6f 6f 74 44 65 66  |.....InitBootDef|
00000700  65 63 74 73 0d 03 16 10  f2 49 6e 69 74 44 69 73  |ects.....InitDis|
00000710  63 52 65 63 0d 03 20 1b  f2 4d 6f 61 6e 4f 70 28  |cRec.. ..MoanOp(|
00000720  52 65 73 74 6f 72 65 25  2c 30 2c 30 2c 30 29 0d  |Restore%,0,0,0).|
00000730  03 2a 27 f2 4f 70 28 52  65 61 64 25 2c 42 6f 6f  |.*'.Op(Read%,Boo|
00000740  74 41 64 64 25 2c 42 6f  6f 74 25 2c 42 6f 6f 74  |tAdd%,Boot%,Boot|
00000750  53 69 7a 65 25 29 0d 03  34 23 e7 20 52 65 73 75  |Size%)..4#. Resu|
00000760  6c 74 25 3c 3e 30 20 84  20 ac 20 a4 47 6f 6f 64  |lt%<>0 . . .Good|
00000770  44 65 66 65 63 74 73 20  8c 0d 03 3e 47 20 f1 22  |Defects ...>G ."|
00000780  54 68 65 20 64 72 69 76  65 20 68 61 73 20 61 6e  |The drive has an|
00000790  20 69 6e 76 61 6c 69 64  20 64 65 66 65 63 74 20  | invalid defect |
000007a0  6d 61 70 20 6f 72 20 68  61 73 20 6e 65 76 65 72  |map or has never|
000007b0  20 62 65 65 6e 20 66 6f  72 6d 61 74 74 65 64 22  | been formatted"|
000007c0  0d 03 48 0b 20 e5 20 8d  44 7a 43 0d 03 52 05 cd  |..H. . .DzC..R..|
000007d0  0d 03 5c 0d f2 4f 6c 64  53 68 61 70 65 0d 03 66  |..\..OldShape..f|
000007e0  29 f2 4f 70 28 56 65 72  69 66 79 25 2c 30 2c 30  |).Op(Verify%,0,0|
000007f0  2c 53 65 63 53 69 7a 65  25 2a 53 65 63 73 50 65  |,SecSize%*SecsPe|
00000800  72 54 72 6b 25 29 0d 03  70 19 e7 20 a4 43 6f 6e  |rTrk%)..p.. .Con|
00000810  66 69 72 6d 4d 61 6b 65  20 e5 20 8d 74 6c 43 0d  |firmMake . .tlC.|
00000820  03 7a 0c f2 41 73 6b 4d  61 6b 65 0d 03 84 18 e3  |.z..AskMake.....|
00000830  20 49 25 3d 30 20 b8 20  42 6f 6f 74 53 69 7a 65  | I%=0 . BootSize|
00000840  25 2d 34 0d 03 8e 0f 20  42 6f 6f 74 25 21 49 25  |%-4.... Boot%!I%|
00000850  3d 30 0d 03 98 08 ed 20  49 25 0d 03 a2 14 f2 49  |=0..... I%.....I|
00000860  6e 69 74 42 6f 6f 74 44  65 66 65 63 74 73 0d 03  |nitBootDefects..|
00000870  ac 1a 46 6f 72 6d 61 74  74 65 64 25 3d 28 52 65  |..Formatted%=(Re|
00000880  73 75 6c 74 25 3d 30 29  0d 03 b6 0d f2 41 73 6b  |sult%=0).....Ask|
00000890  53 68 61 70 65 0d 03 c0  5a 53 6f 61 6b 46 6c 61  |Shape...ZSoakFla|
000008a0  67 25 3d a4 43 68 6f 6f  73 65 28 22 44 6f 20 79  |g%=.Choose("Do y|
000008b0  6f 75 20 77 61 6e 74 20  74 6f 20 73 6f 61 6b 20  |ou want to soak |
000008c0  74 65 73 74 20 74 68 65  20 68 61 72 64 20 64 69  |test the hard di|
000008d0  73 63 20 66 6f 72 20 64  65 66 65 63 74 73 20 28  |sc for defects (|
000008e0  59 2f 4e 29 22 2c 22 59  4e 22 29 3d 22 59 22 0d  |Y/N)","YN")="Y".|
000008f0  03 ca 56 e7 20 a4 43 68  6f 6f 73 65 28 22 41 72  |..V. .Choose("Ar|
00000900  65 20 79 6f 75 20 63 65  72 74 61 69 6e 20 79 6f  |e you certain yo|
00000910  75 20 77 61 6e 74 20 74  6f 20 66 6f 72 6d 61 74  |u want to format|
00000920  20 64 72 69 76 65 20 22  2b c3 44 72 69 76 65 25  | drive "+.Drive%|
00000930  2b 22 20 28 59 2f 4e 29  22 2c 22 59 4e 22 29 3d  |+" (Y/N)","YN")=|
00000940  22 4e 22 20 e0 0d 03 d4  1b f2 4d 6f 61 6e 4f 70  |"N" ......MoanOp|
00000950  28 53 70 65 63 69 66 79  25 2c 30 2c 30 2c 30 29  |(Specify%,0,0,0)|
00000960  0d 03 de 05 e1 0d 03 e8  05 3a 0d 03 f2 0f dd 20  |.........:..... |
00000970  f2 4f 6c 64 53 68 61 70  65 0d 03 fc 1a 53 65 63  |.OldShape....Sec|
00000980  73 50 65 72 54 72 6b 25  3d 42 6f 6f 74 52 65 63  |sPerTrk%=BootRec|
00000990  25 3f 31 0d 04 06 15 48  65 61 64 73 25 3d 42 6f  |%?1....Heads%=Bo|
000009a0  6f 74 52 65 63 25 3f 32  0d 04 10 19 4c 6f 67 32  |otRec%?2....Log2|
000009b0  41 6c 6c 6f 63 25 3d 42  6f 6f 74 52 65 63 25 3f  |Alloc%=BootRec%?|
000009c0  35 0d 04 1a 1a 44 69 73  63 53 69 7a 65 25 3d 42  |5....DiscSize%=B|
000009d0  6f 6f 74 52 65 63 25 21  26 31 30 0d 04 24 33 43  |ootRec%!&10..$3C|
000009e0  79 6c 73 25 3d 44 69 73  63 53 69 7a 65 25 20 81  |yls%=DiscSize% .|
000009f0  20 28 53 65 63 53 69 7a  65 25 2a 53 65 63 73 50  | (SecSize%*SecsP|
00000a00  65 72 54 72 6b 25 2a 48  65 61 64 73 25 29 0d 04  |erTrk%*Heads%)..|
00000a10  2e 27 4c 6f 77 43 75 72  72 65 6e 74 43 79 6c 25  |.'LowCurrentCyl%|
00000a20  3d 28 42 6f 6f 74 52 65  63 25 21 2d 38 29 20 80  |=(BootRec%!-8) .|
00000a30  20 26 33 46 46 0d 04 38  24 50 72 65 43 6f 6d 70  | &3FF..8$PreComp|
00000a40  43 79 6c 25 3d 28 42 6f  6f 74 52 65 63 25 21 2d  |Cyl%=(BootRec%!-|
00000a50  36 29 20 80 20 26 33 46  46 0d 04 42 38 50 61 72  |6) . &3FF..B8Par|
00000a60  6b 43 79 6c 25 3d 28 42  6f 6f 74 52 65 63 25 21  |kCyl%=(BootRec%!|
00000a70  2d 34 29 81 28 53 65 63  53 69 7a 65 25 2a 53 65  |-4).(SecSize%*Se|
00000a80  63 73 50 65 72 54 72 6b  25 2a 48 65 61 64 73 25  |csPerTrk%*Heads%|
00000a90  29 0d 04 4c 10 f2 49 6e  69 74 44 69 73 63 52 65  |)..L..InitDiscRe|
00000aa0  63 0d 04 56 05 e1 0d 04  60 05 3a 0d 04 6a 0e dd  |c..V....`.:..j..|
00000ab0  20 f2 41 73 6b 4d 61 6b  65 0d 04 74 05 f7 0d 04  | .AskMake..t....|
00000ac0  7e 0c 4d 61 6b 65 73 25  3d 30 0d 04 88 05 f5 0d  |~.Makes%=0......|
00000ad0  04 92 0c 20 f3 20 4d 61  6b 65 24 0d 04 9c 0e 20  |... . Make$.... |
00000ae0  4d 61 6b 65 73 25 2b 3d  31 0d 04 a6 19 20 f1 20  |Makes%+=1.... . |
00000af0  3b 4d 61 6b 65 73 25 3b  22 2e 20 22 3b 4d 61 6b  |;Makes%;". ";Mak|
00000b00  65 24 0d 04 b0 19 20 e3  20 49 25 3d 31 20 b8 20  |e$.... . I%=1 . |
00000b10  4d 61 6b 65 50 61 72 61  6d 73 25 0d 04 ba 0a 20  |MakeParams%.... |
00000b20  20 f3 20 41 24 0d 04 c4  09 20 ed 20 49 25 0d 04  | . A$.... . I%..|
00000b30  ce 13 fd 20 4d 61 6b 65  24 3d 22 4f 54 48 45 52  |... Make$="OTHER|
00000b40  22 0d 04 d8 38 4d 61 6b  65 25 3d a4 49 6e 70 75  |"...8Make%=.Inpu|
00000b50  74 44 65 63 28 22 57 68  69 63 68 20 6d 61 6b 65  |tDec("Which make|
00000b60  20 6f 66 20 68 61 72 64  20 64 69 73 63 20 22 2c  | of hard disc ",|
00000b70  31 2c 4d 61 6b 65 73 25  29 0d 04 e2 05 f7 0d 04  |1,Makes%).......|
00000b80  ec 20 49 25 3d 28 4d 61  6b 65 25 2d 31 29 2a 28  |. I%=(Make%-1)*(|
00000b90  4d 61 6b 65 50 61 72 61  6d 73 25 2b 31 29 0d 04  |MakeParams%+1)..|
00000ba0  f6 0b c8 95 20 49 25 3e  30 0d 05 00 09 20 f3 20  |.... I%>0.... . |
00000bb0  41 24 0d 05 0a 0a 20 49  25 2d 3d 31 0d 05 14 05  |A$.... I%-=1....|
00000bc0  ce 0d 05 1e 4e f3 20 4d  61 6b 65 24 2c 20 53 65  |....N. Make$, Se|
00000bd0  63 73 50 65 72 54 72 6b  25 2c 20 48 65 61 64 73  |csPerTrk%, Heads|
00000be0  25 2c 20 43 79 6c 73 25  2c 20 4c 6f 77 43 75 72  |%, Cyls%, LowCur|
00000bf0  72 65 6e 74 43 79 6c 25  2c 20 50 72 65 43 6f 6d  |rentCyl%, PreCom|
00000c00  70 43 79 6c 25 2c 20 50  61 72 6b 43 79 6c 25 0d  |pCyl%, ParkCyl%.|
00000c10  05 28 15 f1 20 4d 61 6b  65 24 3b 22 20 63 68 6f  |.(.. Make$;" cho|
00000c20  73 65 6e 22 0d 05 32 05  e1 0d 05 3c 05 3a 0d 05  |sen"..2....<.:..|
00000c30  46 12 dd 20 a4 43 6f 6e  66 69 72 6d 4d 61 6b 65  |F.. .ConfirmMake|
00000c40  0d 05 50 05 f7 0d 05 5a  29 f3 20 4d 61 6b 65 24  |..P....Z). Make$|
00000c50  2c 20 50 31 25 2c 20 50  32 25 2c 20 50 33 25 2c  |, P1%, P2%, P3%,|
00000c60  20 50 34 25 2c 20 50 35  25 2c 20 50 36 25 0d 05  | P4%, P5%, P6%..|
00000c70  64 15 e7 20 4d 61 6b 65  24 3d 22 4f 54 48 45 52  |d.. Make$="OTHER|
00000c80  22 20 8c 0d 05 6e 49 20  f1 20 22 54 68 65 20 73  |" ...nI . "The s|
00000c90  68 61 70 65 20 77 72 69  74 74 65 6e 20 6f 6e 20  |hape written on |
00000ca0  74 68 65 20 64 69 73 63  20 64 6f 65 73 20 6e 6f  |the disc does no|
00000cb0  74 20 6d 61 74 63 68 20  61 6e 79 20 6f 66 20 74  |t match any of t|
00000cc0  68 65 20 73 74 61 6e 64  61 72 64 22 0d 05 78 2c  |he standard"..x,|
00000cd0  20 f1 20 22 64 72 69 76  65 20 73 68 61 70 65 73  | . "drive shapes|
00000ce0  20 6b 6e 6f 77 6e 20 62  79 20 74 68 69 73 20 70  | known by this p|
00000cf0  72 6f 67 72 61 6d 2e 22  0d 05 82 40 20 3d a4 43  |rogram."...@ =.C|
00000d00  68 6f 6f 73 65 28 22 44  6f 20 79 6f 75 20 77 69  |hoose("Do you wi|
00000d10  73 68 20 74 6f 20 72 65  74 61 69 6e 20 74 68 69  |sh to retain thi|
00000d20  73 20 73 68 61 70 65 20  28 59 2f 4e 29 22 2c 22  |s shape (Y/N)","|
00000d30  59 4e 22 29 3d 22 59 22  0d 05 8c 05 cd 0d 05 96  |YN")="Y"........|
00000d40  71 e7 20 50 31 25 3c 3e  53 65 63 73 50 65 72 54  |q. P1%<>SecsPerT|
00000d50  72 6b 25 20 84 20 50 32  25 3c 3e 48 65 61 64 73  |rk% . P2%<>Heads|
00000d60  25 20 84 20 50 33 25 3c  3e 43 79 6c 73 25 20 84  |% . P3%<>Cyls% .|
00000d70  20 50 34 25 3c 3e 4c 6f  77 43 75 72 72 65 6e 74  | P4%<>LowCurrent|
00000d80  43 79 6c 25 20 84 20 50  35 25 3c 3e 50 72 65 43  |Cyl% . P5%<>PreC|
00000d90  6f 6d 70 43 79 6c 25 20  84 20 50 36 25 3c 3e 50  |ompCyl% . P6%<>P|
00000da0  61 72 6b 43 79 6c 25 20  e5 20 8d 44 5a 45 0d 05  |arkCyl% . .DZE..|
00000db0  a0 47 f1 20 22 54 68 65  20 73 68 61 70 65 20 77  |.G. "The shape w|
00000dc0  72 69 74 74 65 6e 20 6f  6e 20 74 68 65 20 64 69  |ritten on the di|
00000dd0  73 63 20 6d 61 74 63 68  65 73 20 74 68 61 74 20  |sc matches that |
00000de0  6f 66 20 61 20 22 3b 4d  61 6b 65 24 3b 22 20 64  |of a ";Make$;" d|
00000df0  69 73 63 2e 22 0d 05 aa  3f 3d a4 43 68 6f 6f 73  |isc."...?=.Choos|
00000e00  65 28 22 44 6f 20 79 6f  75 20 77 69 73 68 20 74  |e("Do you wish t|
00000e10  6f 20 72 65 74 61 69 6e  20 74 68 69 73 20 73 68  |o retain this sh|
00000e20  61 70 65 20 28 59 2f 4e  29 22 2c 22 59 4e 22 29  |ape (Y/N)","YN")|
00000e30  3d 22 59 22 0d 05 b4 05  3a 0d 05 be 0f dd 20 f2  |="Y"....:..... .|
00000e40  41 73 6b 53 68 61 70 65  0d 05 c8 39 ee 20 85 20  |AskShape...9. . |
00000e50  ea 3a ee 20 85 20 87 3a  e7 20 9f 3d 26 31 45 36  |.:. . .:. .=&1E6|
00000e60  20 4e 65 77 4d 61 70 25  3d a3 3a e5 20 8d 54 58  | NewMap%=.:. .TX|
00000e70  46 20 8b 20 f6 3a f1 3b  22 20 40 20 22 3b 9e 3a  |F . .:.;" @ ";.:|
00000e80  e0 0d 05 d2 1c c8 99 20  22 58 46 69 6c 65 43 6f  |....... "XFileCo|
00000e90  72 65 5f 43 72 65 61 74  65 22 2c 20 30 0d 05 dc  |re_Create", 0...|
00000ea0  05 f1 0d 05 e6 05 f5 0d  05 f0 08 20 ef 31 31 0d  |........... .11.|
00000eb0  05 fa 3e 20 63 68 61 72  25 3d 97 28 a4 53 74 72  |..> char%=.(.Str|
00000ec0  41 73 6b 28 22 4f 6c 64  20 6f 72 20 4e 65 77 20  |Ask("Old or New |
00000ed0  6d 61 70 20 66 6f 72 6d  61 74 20 28 4f 2f 4e 29  |map format (O/N)|
00000ee0  22 2c 22 4e 22 29 29 20  80 20 26 44 46 0d 06 04  |","N")) . &DF...|
00000ef0  1d fd 20 63 68 61 72 25  3d 97 22 4f 22 20 84 20  |.. char%=."O" . |
00000f00  63 68 61 72 25 3d 97 22  4e 22 0d 06 0e 18 4e 65  |char%=."N"....Ne|
00000f10  77 4d 61 70 25 3d 28 63  68 61 72 25 3d 97 22 4e  |wMap%=(char%=."N|
00000f20  22 29 0d 06 18 37 53 65  63 73 50 65 72 54 72 6b  |")...7SecsPerTrk|
00000f30  25 3d a4 41 73 6b 28 22  53 65 63 74 6f 72 73 20  |%=.Ask("Sectors |
00000f40  70 65 72 20 74 72 61 63  6b 22 2c 53 65 63 73 50  |per track",SecsP|
00000f50  65 72 54 72 6b 25 2c 31  29 0d 06 22 1a 44 69 73  |erTrk%,1)..".Dis|
00000f60  63 52 65 63 25 3f 31 3d  53 65 63 73 50 65 72 54  |cRec%?1=SecsPerT|
00000f70  72 6b 25 0d 06 2c 21 48  65 61 64 73 25 3d a4 41  |rk%..,!Heads%=.A|
00000f80  73 6b 28 22 48 65 61 64  73 22 2c 48 65 61 64 73  |sk("Heads",Heads|
00000f90  25 2c 31 29 0d 06 36 9a  e7 20 48 65 61 64 73 25  |%,1)..6.. Heads%|
00000fa0  3e 38 20 f1 27 22 57 41  52 4e 49 4e 47 20 2d 20  |>8 .'"WARNING - |
00000fb0  73 69 6e 63 65 20 74 68  65 20 64 72 69 76 65 20  |since the drive |
00000fc0  68 61 73 20 6d 6f 72 65  20 74 68 61 6e 20 38 20  |has more than 8 |
00000fd0  68 65 61 64 73 2c 20 74  68 65 20 63 6f 6d 70 75  |heads, the compu|
00000fe0  74 65 72 27 73 22 27 22  20 20 20 20 20 20 20 20  |ter's"'"        |
00000ff0  20 20 27 6c 6f 77 20 77  72 69 74 65 20 63 75 72  |  'low write cur|
00001000  72 65 6e 74 2f 68 65 61  64 20 73 65 6c 65 63 74  |rent/head select|
00001010  20 33 27 20 6c 69 6e 6b  73 20 6d 61 79 20 6e 65  | 3' links may ne|
00001020  65 64 20 63 68 61 6e 67  69 6e 67 2e 22 27 0d 06  |ed changing."'..|
00001030  40 15 44 69 73 63 52 65  63 25 3f 32 3d 48 65 61  |@.DiscRec%?2=Hea|
00001040  64 73 25 0d 06 4a 23 43  79 6c 73 25 3d a4 41 73  |ds%..J#Cyls%=.As|
00001050  6b 28 22 43 79 6c 69 6e  64 65 72 73 22 2c 43 79  |k("Cylinders",Cy|
00001060  6c 73 25 2c 31 29 0d 06  54 2f 44 69 73 63 53 69  |ls%,1)..T/DiscSi|
00001070  7a 65 25 3d 53 65 63 53  69 7a 65 25 2a 53 65 63  |ze%=SecSize%*Sec|
00001080  73 50 65 72 54 72 6b 25  2a 48 65 61 64 73 25 2a  |sPerTrk%*Heads%*|
00001090  43 79 6c 73 25 0d 06 5e  1a 44 69 73 63 52 65 63  |Cyls%..^.DiscRec|
000010a0  25 21 26 31 30 3d 44 69  73 63 53 69 7a 65 25 0d  |%!&10=DiscSize%.|
000010b0  06 68 40 4c 6f 77 43 75  72 72 65 6e 74 43 79 6c  |.h@LowCurrentCyl|
000010c0  25 3d a4 41 73 6b 28 22  4c 6f 77 20 63 75 72 72  |%=.Ask("Low curr|
000010d0  65 6e 74 20 63 79 6c 69  6e 64 65 72 22 2c 4c 6f  |ent cylinder",Lo|
000010e0  77 43 75 72 72 65 6e 74  43 79 6c 25 2c 30 29 0d  |wCurrentCyl%,0).|
000010f0  06 72 3e 50 72 65 43 6f  6d 70 43 79 6c 25 3d a4  |.r>PreCompCyl%=.|
00001100  41 73 6b 28 22 50 72 65  63 6f 6d 70 65 6e 73 61  |Ask("Precompensa|
00001110  74 69 6f 6e 20 63 79 6c  69 6e 64 65 72 22 2c 50  |tion cylinder",P|
00001120  72 65 43 6f 6d 70 43 79  6c 25 2c 30 29 0d 06 7c  |reCompCyl%,0)..||
00001130  30 50 61 72 6b 43 79 6c  25 3d a4 41 73 6b 28 22  |0ParkCyl%=.Ask("|
00001140  50 61 72 6b 69 6e 67 20  63 79 6c 69 6e 64 65 72  |Parking cylinder|
00001150  22 2c 50 61 72 6b 43 79  6c 25 2c 30 29 0d 06 86  |",ParkCyl%,0)...|
00001160  1c e3 20 49 25 3d 30 20  b8 20 42 6f 6f 74 53 69  |.. I%=0 . BootSi|
00001170  7a 65 25 2d 34 20 88 20  34 0d 06 90 18 20 44 65  |ze%-4 . 4.... De|
00001180  66 65 63 74 25 21 49 25  3d 42 6f 6f 74 25 21 49  |fect%!I%=Boot%!I|
00001190  25 0d 06 9a 08 ed 20 49  25 0d 06 a4 16 42 6f 6f  |%..... I%....Boo|
000011a0  74 25 21 30 3d 45 6e 64  44 65 66 65 63 74 25 0d  |t%!0=EndDefect%.|
000011b0  06 ae 05 f5 0d 06 b8 0b  20 70 74 72 25 3d 30 0d  |........ ptr%=0.|
000011c0  06 c2 30 20 f1 20 27 22  43 75 72 72 65 6e 74 20  |..0 . '"Current |
000011d0  44 65 66 65 63 74 73 20  28 43 79 6c 69 6e 64 65  |Defects (Cylinde|
000011e0  72 2c 48 65 61 64 2c 53  65 63 74 6f 72 29 22 0d  |r,Head,Sector)".|
000011f0  06 cc 1f 20 c8 95 20 44  65 66 65 63 74 25 21 70  |... .. Defect%!p|
00001200  74 72 25 3c 45 6e 64 44  65 66 65 63 74 25 0d 06  |tr%<EndDefect%..|
00001210  d6 1a 20 20 64 65 66 65  63 74 25 3d 44 65 66 65  |..  defect%=Defe|
00001220  63 74 25 21 70 74 72 25  0d 06 e0 20 20 20 64 65  |ct%!ptr%...   de|
00001230  66 65 63 74 25 3d 64 65  66 65 63 74 25 20 81 20  |fect%=defect% . |
00001240  53 65 63 53 69 7a 65 25  0d 06 ea 23 20 20 73 65  |SecSize%...#  se|
00001250  63 74 6f 72 25 3d 64 65  66 65 63 74 25 20 83 20  |ctor%=defect% . |
00001260  53 65 63 73 50 65 72 54  72 6b 25 0d 06 f4 23 20  |SecsPerTrk%...# |
00001270  20 64 65 66 65 63 74 25  3d 64 65 66 65 63 74 25  | defect%=defect%|
00001280  20 81 20 53 65 63 73 50  65 72 54 72 6b 25 0d 06  | . SecsPerTrk%..|
00001290  fe 50 20 20 f1 20 8a 28  28 70 74 72 25 81 34 29  |.P  . .((ptr%.4)|
000012a0  83 36 29 2a 31 33 29 3b  22 28 22 3b 64 65 66 65  |.6)*13);"(";defe|
000012b0  63 74 25 81 48 65 61 64  73 25 3b 22 2c 22 3b 64  |ct%.Heads%;",";d|
000012c0  65 66 65 63 74 25 83 48  65 61 64 73 25 3b 22 2c  |efect%.Heads%;",|
000012d0  22 3b 73 65 63 74 6f 72  25 3b 22 29 22 3b 0d 07  |";sector%;")";..|
000012e0  08 11 20 20 70 74 72 25  3d 70 74 72 25 2b 34 0d  |..  ptr%=ptr%+4.|
000012f0  07 12 06 20 ce 0d 07 1c  14 20 44 65 66 65 63 74  |... ..... Defect|
00001300  73 25 3d 70 74 72 25 81  34 0d 07 26 06 20 f1 0d  |s%=ptr%.4..&. ..|
00001310  07 30 1b 20 f1 20 22 41  3a 20 6e 6f 20 6d 6f 72  |.0. . "A: no mor|
00001320  65 20 63 68 61 6e 67 65  73 22 0d 07 3a 35 20 f1  |e changes"..:5 .|
00001330  20 22 42 3a 20 61 64 64  20 64 65 66 65 63 74 20  | "B: add defect |
00001340  62 79 20 63 79 6c 69 6e  64 65 72 2c 20 68 65 61  |by cylinder, hea|
00001350  64 2c 20 62 79 74 65 2f  73 65 63 74 6f 72 22 0d  |d, byte/sector".|
00001360  07 44 10 20 e7 20 4e 65  77 4d 61 70 25 20 8c 0d  |.D. . NewMap% ..|
00001370  07 4e 27 20 20 f1 20 22  43 3a 20 61 64 64 20 64  |.N'  . "C: add d|
00001380  65 66 65 63 74 20 62 79  20 64 69 73 63 20 61 64  |efect by disc ad|
00001390  64 72 65 73 73 22 0d 07  58 06 20 cc 0d 07 62 3f  |dress"..X. ...b?|
000013a0  20 20 f1 20 22 43 3a 20  61 64 64 20 64 65 66 65  |  . "C: add defe|
000013b0  63 74 20 62 79 20 4c 4f  47 49 43 41 4c 20 64 69  |ct by LOGICAL di|
000013c0  73 63 20 61 64 64 72 65  73 73 20 28 65 67 20 64  |sc address (eg d|
000013d0  69 73 63 20 65 72 72 6f  72 29 22 0d 07 6c 06 20  |isc error)"..l. |
000013e0  cd 0d 07 76 19 20 f1 20  22 44 3a 20 72 65 6d 6f  |...v. . "D: remo|
000013f0  76 65 20 64 65 66 65 63  74 22 0d 07 80 26 20 6f  |ve defect"...& o|
00001400  70 74 24 3d a4 43 68 6f  6f 73 65 28 22 41 2c 42  |pt$=.Choose("A,B|
00001410  2c 43 20 6f 72 20 44 22  2c 22 41 42 43 44 22 29  |,C or D","ABCD")|
00001420  0d 07 8a 0e 20 c8 8e 20  6f 70 74 24 20 ca 0d 07  |.... .. opt$ ...|
00001430  94 10 20 20 c9 20 22 42  22 2c 22 44 22 3a 0d 07  |..  . "B","D":..|
00001440  9e 2b 20 20 20 63 79 6c  25 3d a4 49 6e 70 75 74  |.+   cyl%=.Input|
00001450  44 65 63 28 22 43 79 6c  69 6e 64 65 72 22 2c 30  |Dec("Cylinder",0|
00001460  2c 43 79 6c 73 25 2d 31  29 0d 07 a8 29 20 20 20  |,Cyls%-1)...)   |
00001470  68 65 61 64 25 3d a4 49  6e 70 75 74 44 65 63 28  |head%=.InputDec(|
00001480  22 48 65 61 64 22 2c 30  2c 48 65 61 64 73 25 2d  |"Head",0,Heads%-|
00001490  31 29 0d 07 b2 5b 20 20  20 73 65 63 74 6f 72 25  |1)...[   sector%|
000014a0  3d a4 49 6e 70 75 74 44  65 63 32 28 22 42 79 74  |=.InputDec2("Byt|
000014b0  65 73 20 66 72 6f 6d 20  69 6e 64 65 78 20 4d 46  |es from index MF|
000014c0  4d 22 2c 22 20 6f 72 20  2d 76 65 20 66 6f 72 20  |M"," or -ve for |
000014d0  73 65 63 74 6f 72 22 2c  31 2d 53 65 63 73 50 65  |sector",1-SecsPe|
000014e0  72 54 72 6b 25 2c 26 31  30 30 30 30 29 0d 07 bc  |rTrk%,&10000)...|
000014f0  15 20 20 20 e7 20 73 65  63 74 6f 72 25 3e 3d 30  |.   . sector%>=0|
00001500  20 8c 0d 07 c6 1d 20 20  20 20 73 65 63 74 6f 72  | .....    sector|
00001510  25 3d 73 65 63 74 6f 72  25 20 81 20 33 32 30 0d  |%=sector% . 320.|
00001520  07 d0 08 20 20 20 cc 0d  07 da 18 20 20 20 20 73  |...   .....    s|
00001530  65 63 74 6f 72 25 3d 2d  73 65 63 74 6f 72 25 0d  |ector%=-sector%.|
00001540  07 e4 08 20 20 20 cd 0d  07 ee 41 20 20 20 64 65  |...   ....A   de|
00001550  66 65 63 74 25 3d 28 28  63 79 6c 25 2a 48 65 61  |fect%=((cyl%*Hea|
00001560  64 73 25 2b 68 65 61 64  25 29 2a 53 65 63 73 50  |ds%+head%)*SecsP|
00001570  65 72 54 72 6b 25 2b 73  65 63 74 6f 72 25 29 2a  |erTrk%+sector%)*|
00001580  53 65 63 53 69 7a 65 25  0d 07 f8 13 20 20 20 e7  |SecSize%....   .|
00001590  20 6f 70 74 24 3d 22 42  22 20 8c 0d 08 02 1f 20  | opt$="B" ..... |
000015a0  20 20 20 f2 41 64 64 50  68 79 73 44 65 66 65 63  |   .AddPhysDefec|
000015b0  74 28 64 65 66 65 63 74  25 29 0d 08 0c 08 20 20  |t(defect%)....  |
000015c0  20 cc 0d 08 16 22 20 20  20 20 f2 52 65 6d 6f 76  | ...."    .Remov|
000015d0  65 50 68 79 73 44 65 66  65 63 74 28 64 65 66 65  |ePhysDefect(defe|
000015e0  63 74 25 29 0d 08 20 08  20 20 20 cd 0d 08 2a 0c  |ct%).. .   ...*.|
000015f0  20 20 c9 20 22 43 22 3a  0d 08 34 12 20 20 20 e7  |  . "C":..4.   .|
00001600  20 4e 65 77 4d 61 70 25  20 8c 0d 08 3e 4e 20 20  | NewMap% ...>N  |
00001610  20 20 f2 41 64 64 50 68  79 73 44 65 66 65 63 74  |  .AddPhysDefect|
00001620  28 28 a4 49 6e 70 75 74  48 65 78 28 22 44 69 73  |((.InputHex("Dis|
00001630  63 20 61 64 64 72 65 73  73 20 69 6e 20 62 79 74  |c address in byt|
00001640  65 73 22 29 81 53 65 63  53 69 7a 65 25 29 2a 53  |es").SecSize%)*S|
00001650  65 63 53 69 7a 65 25 29  0d 08 48 08 20 20 20 cc  |ecSize%)..H.   .|
00001660  0d 08 52 bd 20 20 20 20  f1 20 22 49 66 20 41 44  |..R.    . "If AD|
00001670  46 53 20 67 69 76 65 73  20 61 6e 20 65 72 72 6f  |FS gives an erro|
00001680  72 20 73 75 63 68 20 61  73 20 27 44 69 73 63 20  |r such as 'Disc |
00001690  65 72 72 6f 72 20 31 33  20 61 74 20 3a 34 2f 30  |error 13 at :4/0|
000016a0  30 30 31 32 41 30 30 27  20 74 68 65 6e 20 30 30  |0012A00' then 00|
000016b0  30 31 32 41 30 30 20 69  73 20 61 20 6c 6f 67 69  |012A00 is a logi|
000016c0  63 61 6c 20 64 69 73 63  20 61 64 64 72 65 73 73  |cal disc address|
000016d0  2e 20 54 68 65 20 6c 6f  67 69 63 61 6c 20 74 6f  |. The logical to|
000016e0  20 70 68 79 73 69 63 61  6c 20 64 69 73 63 20 61  | physical disc a|
000016f0  64 64 72 65 73 73 20 6d  61 70 70 69 6e 67 20 64  |ddress mapping d|
00001700  65 70 65 6e 64 73 20 6f  6e 20 74 68 65 20 64 65  |epends on the de|
00001710  66 65 63 74 20 6c 69 73  74 2e 20 22 3b 0d 08 5c  |fect list. ";..\|
00001720  a6 20 20 20 20 f1 20 22  20 57 68 65 6e 20 74 68  |.    . " When th|
00001730  65 73 65 20 64 65 66 65  63 74 73 20 61 72 65 20  |ese defects are |
00001740  61 64 64 65 64 20 74 6f  20 74 68 65 20 64 65 66  |added to the def|
00001750  65 63 74 20 6c 69 73 74  2c 20 69 74 20 69 73 20  |ect list, it is |
00001760  20 20 20 20 69 6d 70 6f  72 74 61 6e 74 20 74 68  |    important th|
00001770  61 74 20 74 68 65 79 20  61 72 65 20 61 64 64 65  |at they are adde|
00001780  64 20 69 6e 20 44 45 53  43 45 4e 44 49 4e 47 20  |d in DESCENDING |
00001790  6f 72 64 65 72 20 42 45  46 4f 52 45 20 74 68 65  |order BEFORE the|
000017a0  20 6c 69 73 74 20 69 73  20 63 68 61 6e 67 65 64  | list is changed|
000017b0  20 69 6e 20 61 6e 79 20  6f 74 68 65 72 20 77 61  | in any other wa|
000017c0  79 21 22 0d 08 66 4e 20  20 20 20 64 65 66 65 63  |y!"..fN    defec|
000017d0  74 25 3d 28 a4 49 6e 70  75 74 48 65 78 28 22 4c  |t%=(.InputHex("L|
000017e0  6f 67 69 63 61 6c 20 64  69 73 63 20 61 64 64 72  |ogical disc addr|
000017f0  65 73 73 20 69 6e 20 62  79 74 65 73 22 29 81 53  |ess in bytes").S|
00001800  65 63 53 69 7a 65 25 29  2a 53 65 63 53 69 7a 65  |ecSize%)*SecSize|
00001810  25 0d 08 70 2b 20 20 20  20 f2 41 64 64 50 68 79  |%..p+    .AddPhy|
00001820  73 44 65 66 65 63 74 28  a4 4c 6f 67 54 6f 50 68  |sDefect(.LogToPh|
00001830  79 73 28 64 65 66 65 63  74 25 29 29 0d 08 7a 08  |ys(defect%))..z.|
00001840  20 20 20 cd 0d 08 84 06  20 cb 0d 08 8e 0e fd 20  |   ..... ...... |
00001850  6f 70 74 24 3d 22 41 22  0d 08 98 1d e3 20 49 25  |opt$="A"..... I%|
00001860  3d 30 20 b8 20 44 69 73  63 53 74 72 75 63 25 2d  |=0 . DiscStruc%-|
00001870  34 20 88 20 34 0d 08 a2  1c 20 42 6f 6f 74 52 65  |4 . 4.... BootRe|
00001880  63 25 21 49 25 3d 44 69  73 63 52 65 63 25 21 49  |c%!I%=DiscRec%!I|
00001890  25 0d 08 ac 08 ed 20 49  25 0d 08 b6 11 f2 49 6e  |%..... I%.....In|
000018a0  69 74 48 61 72 64 44 65  73 63 0d 08 c0 05 e1 0d  |itHardDesc......|
000018b0  08 ca 05 3a 0d 08 d4 0d  dd 20 f2 46 6f 72 6d 61  |...:..... .Forma|
000018c0  74 0d 08 de 07 d1 3d 30  0d 08 e8 16 ea 20 49 25  |t.....=0..... I%|
000018d0  2c 4a 25 2c 63 79 6c 25  2c 68 65 61 64 25 0d 08  |,J%,cyl%,head%..|
000018e0  f2 1b f2 4d 6f 61 6e 4f  70 28 53 70 65 63 69 66  |...MoanOp(Specif|
000018f0  79 25 2c 30 2c 30 2c 30  29 0d 08 fc 1b f2 4d 6f  |y%,0,0,0).....Mo|
00001900  61 6e 4f 70 28 52 65 73  74 6f 72 65 25 2c 30 2c  |anOp(Restore%,0,|
00001910  30 2c 30 29 0d 09 06 12  f1 20 22 46 6f 72 6d 61  |0,0)..... "Forma|
00001920  74 74 69 6e 67 22 0d 09  10 2a e3 20 49 25 3d 30  |tting"...*. I%=0|
00001930  20 b8 20 35 31 32 2d 34  20 88 20 34 3a 42 75 66  | . 512-4 . 4:Buf|
00001940  25 21 49 25 3d 26 30 37  37 46 30 33 46 46 3a ed  |%!I%=&077F03FF:.|
00001950  0d 09 1a 16 e3 20 63 79  6c 25 3d 30 20 b8 20 43  |..... cyl%=0 . C|
00001960  79 6c 73 25 2d 31 0d 09  24 0f 20 ef 31 33 3a f1  |yls%-1..$. .13:.|
00001970  63 79 6c 25 3b 0d 09 2e  19 20 e3 20 68 65 61 64  |cyl%;.... . head|
00001980  25 3d 30 20 b8 20 48 65  61 64 73 25 2d 31 0d 09  |%=0 . Heads%-1..|
00001990  38 2c 20 20 e7 20 63 79  6c 25 3d 30 20 e7 20 68  |8,  . cyl%=0 . h|
000019a0  65 61 64 25 3d 30 20 e7  20 46 6f 72 6d 61 74 74  |ead%=0 . Formatt|
000019b0  65 64 25 20 e5 20 8d 44  6a 49 0d 09 42 1b 20 20  |ed% . .DjI..B.  |
000019c0  4a 25 3d 63 79 6c 25 20  84 20 28 68 65 61 64 25  |J%=cyl% . (head%|
000019d0  3c 3c 32 34 29 0d 09 4c  3c 20 20 e3 20 49 25 3d  |<<24)..L<  . I%=|
000019e0  30 20 b8 20 28 53 65 63  73 50 65 72 54 72 6b 25  |0 . (SecsPerTrk%|
000019f0  2d 31 29 2a 34 20 88 20  34 3a 42 75 66 25 21 49  |-1)*4 . 4:Buf%!I|
00001a00  25 3d 4a 25 20 84 20 28  49 25 3c 3c 31 34 29 3a  |%=J% . (I%<<14):|
00001a10  ed 0d 09 56 48 20 20 f2  4f 70 28 57 72 69 74 65  |...VH  .Op(Write|
00001a20  54 72 61 63 6b 25 2c 28  63 79 6c 25 2a 48 65 61  |Track%,(cyl%*Hea|
00001a30  64 73 25 2b 68 65 61 64  25 29 2a 53 65 63 73 50  |ds%+head%)*SecsP|
00001a40  65 72 54 72 6b 25 2a 53  65 63 53 69 7a 65 25 2c  |erTrk%*SecSize%,|
00001a50  42 75 66 25 2c 35 31 32  29 0d 09 60 30 20 20 e7  |Buf%,512)..`0  .|
00001a60  20 52 65 73 75 6c 74 25  20 f1 20 3b 22 20 66 6f  | Result% . ;" fo|
00001a70  72 6d 61 74 20 65 72 72  6f 72 20 6f 6e 20 74 68  |rmat error on th|
00001a80  69 73 20 74 72 61 63 6b  22 0d 09 6a 06 20 ed 0d  |is track"..j. ..|
00001a90  09 74 05 ed 0d 09 7e 05  f1 0d 09 88 05 e1 0d 09  |.t....~.........|
00001aa0  92 05 3a 0d 09 9c 0d dd  20 f2 56 65 72 69 66 79  |..:..... .Verify|
00001ab0  0d 09 a6 64 e7 20 53 6f  61 6b 46 6c 61 67 25 20  |...d. SoakFlag% |
00001ac0  f1 20 27 22 50 52 45 53  53 49 4e 47 20 54 48 45  |. '"PRESSING THE|
00001ad0  20 53 50 41 43 45 20 42  41 52 20 57 49 4c 4c 20  | SPACE BAR WILL |
00001ae0  43 41 55 53 45 20 54 48  45 20 53 4f 41 4b 20 54  |CAUSE THE SOAK T|
00001af0  45 53 54 20 54 4f 20 45  4e 44 20 41 54 20 54 48  |EST TO END AT TH|
00001b00  45 20 45 4e 44 20 4f 46  20 54 48 41 54 20 43 59  |E END OF THAT CY|
00001b10  43 4c 45 22 0d 09 b0 22  ea 20 61 64 64 25 2c 70  |CLE"...". add%,p|
00001b20  74 72 25 2c 73 65 63 74  6f 72 25 2c 68 65 61 64  |tr%,sector%,head|
00001b30  25 2c 63 79 6c 25 0d 09  ba 1d 43 79 63 6c 65 25  |%,cyl%....Cycle%|
00001b40  3d 31 3a 45 72 72 6f 72  43 79 63 6c 65 25 3d 2d  |=1:ErrorCycle%=-|
00001b50  31 30 30 0d 09 c4 28 43  79 6c 53 69 7a 65 25 3d  |100...(CylSize%=|
00001b60  53 65 63 53 69 7a 65 25  2a 53 65 63 73 50 65 72  |SecSize%*SecsPer|
00001b70  54 72 6b 25 2a 48 65 61  64 73 25 0d 09 ce 21 73  |Trk%*Heads%...!s|
00001b80  75 73 70 65 63 74 73 25  3d 30 3a 4d 61 78 53 75  |uspects%=0:MaxSu|
00001b90  73 70 65 63 74 73 25 3d  31 30 30 30 0d 09 d8 47  |spects%=1000...G|
00001ba0  de 20 43 79 6c 42 75 66  25 20 43 79 6c 53 69 7a  |. CylBuf% CylSiz|
00001bb0  65 25 2b 34 2c 20 53 75  73 41 64 64 25 28 4d 61  |e%+4, SusAdd%(Ma|
00001bc0  78 53 75 73 70 65 63 74  73 25 29 2c 20 53 75 73  |xSuspects%), Sus|
00001bd0  43 6f 75 6e 74 25 20 4d  61 78 53 75 73 70 65 63  |Count% MaxSuspec|
00001be0  74 73 25 0d 09 e2 05 f5  0d 09 ec 11 20 e7 20 43  |ts%......... . C|
00001bf0  79 63 6c 65 25 3e 31 20  8c 0d 09 f6 1b 20 20 49  |ycle%>1 .....  I|
00001c00  25 3d 43 79 63 6c 65 25  20 83 20 50 61 74 74 65  |%=Cycle% . Patte|
00001c10  72 6e 73 25 0d 0a 00 0e  20 20 e7 20 49 25 3e 31  |rns%....  . I%>1|
00001c20  20 8c 0d 0a 0a 16 20 20  20 4a 25 3d 50 61 74 74  | .....   J%=Patt|
00001c30  65 72 6e 25 28 49 25 29  0d 0a 14 23 20 20 20 4a  |ern%(I%)...#   J|
00001c40  25 3d 28 4a 25 3e 3e 3e  31 29 20 84 20 28 28 4a  |%=(J%>>>1) . ((J|
00001c50  25 20 80 20 31 29 3c 3c  32 33 29 0d 0a 1e 16 20  |% . 1)<<23).... |
00001c60  20 20 50 61 74 74 65 72  6e 25 28 49 25 29 3d 4a  |  Pattern%(I%)=J|
00001c70  25 0d 0a 28 07 20 20 cc  0d 0a 32 17 20 20 20 4a  |%..(.  ...2.   J|
00001c80  25 3d b3 28 26 31 30 30  30 30 30 30 29 2d 31 0d  |%=.(&1000000)-1.|
00001c90  0a 3c 07 20 20 cd 0d 0a  46 2f 20 20 e7 20 ac 20  |.<.  ...F/  . . |
00001ca0  53 6f 61 6b 46 6c 61 67  25 20 8c 20 f1 20 22 57  |SoakFlag% . . "W|
00001cb0  72 69 74 69 6e 67 20 70  61 74 74 65 72 6e 20 26  |riting pattern &|
00001cc0  22 3b 7e 4a 25 0d 0a 50  32 20 20 e3 20 49 25 3d  |";~J%..P2  . I%=|
00001cd0  43 79 6c 42 75 66 25 20  b8 20 43 79 6c 42 75 66  |CylBuf% . CylBuf|
00001ce0  25 2b 43 79 6c 53 69 7a  65 25 20 88 20 33 3a 21  |%+CylSize% . 3:!|
00001cf0  49 25 3d 4a 25 3a ed 0d  0a 5a 0c 20 20 70 74 72  |I%=J%:...Z.  ptr|
00001d00  25 3d 30 0d 0a 64 35 20  20 e7 20 46 6f 72 6d 61  |%=0..d5  . Forma|
00001d10  74 74 65 64 25 20 61 64  64 25 3d 53 65 63 53 69  |tted% add%=SecSi|
00001d20  7a 65 25 2a 53 65 63 73  50 65 72 54 72 6b 25 20  |ze%*SecsPerTrk% |
00001d30  8b 20 61 64 64 25 3d 30  0d 0a 6e 07 20 20 f5 0d  |. add%=0..n.  ..|
00001d40  0a 78 32 20 20 20 43 79  6c 45 6e 64 25 3d 61 64  |.x2   CylEnd%=ad|
00001d50  64 25 20 2d 20 28 61 64  64 25 20 83 20 43 79 6c  |d% - (add% . Cyl|
00001d60  53 69 7a 65 25 29 20 2b  20 43 79 6c 53 69 7a 65  |Size%) + CylSize|
00001d70  25 0d 0a 82 1b 20 20 20  64 65 66 65 63 74 25 3d  |%....   defect%=|
00001d80  44 65 66 65 63 74 25 21  70 74 72 25 0d 0a 8c 1a  |Defect%!ptr%....|
00001d90  20 20 20 e7 20 64 65 66  65 63 74 25 3e 43 79 6c  |   . defect%>Cyl|
00001da0  45 6e 64 25 20 8c 0d 0a  96 1c 20 20 20 20 6c 65  |End% .....    le|
00001db0  6e 67 74 68 25 3d 43 79  6c 45 6e 64 25 2d 61 64  |ngth%=CylEnd%-ad|
00001dc0  64 25 0d 0a a0 08 20 20  20 cc 0d 0a aa 1c 20 20  |d%....   .....  |
00001dd0  20 20 6c 65 6e 67 74 68  25 3d 64 65 66 65 63 74  |  length%=defect|
00001de0  25 2d 61 64 64 25 0d 0a  b4 08 20 20 20 cd 0d 0a  |%-add%....   ...|
00001df0  be 21 20 20 20 f2 4f 70  28 57 72 69 74 65 25 2c  |.!   .Op(Write%,|
00001e00  61 64 64 25 2c 30 2c 6c  65 6e 67 74 68 25 29 0d  |add%,0,length%).|
00001e10  0a c8 12 20 20 20 e7 20  52 65 73 75 6c 74 25 20  |...   . Result% |
00001e20  8c 0d 0a d2 2f 20 20 20  20 61 64 64 25 3d 28 45  |..../    add%=(E|
00001e30  72 72 44 69 73 63 41 64  64 25 20 80 20 26 31 46  |rrDiscAdd% . &1F|
00001e40  46 46 46 46 30 30 29 2b  53 65 63 53 69 7a 65 25  |FFFF00)+SecSize%|
00001e50  0d 0a dc 08 20 20 20 cc  0d 0a e6 15 20 20 20 20  |....   .....    |
00001e60  61 64 64 25 2b 3d 6c 65  6e 67 74 68 25 0d 0a f0  |add%+=length%...|
00001e70  08 20 20 20 cd 0d 0a fa  2e 20 20 20 e7 20 61 64  |.   .....   . ad|
00001e80  64 25 3d 64 65 66 65 63  74 25 20 8c 20 61 64 64  |d%=defect% . add|
00001e90  25 2b 3d 53 65 63 53 69  7a 65 25 3a 70 74 72 25  |%+=SecSize%:ptr%|
00001ea0  2b 3d 34 0d 0b 04 17 20  20 fd 20 61 64 64 25 3e  |+=4....  . add%>|
00001eb0  3d 44 69 73 63 53 69 7a  65 25 0d 0b 0e 06 20 cd  |=DiscSize%.... .|
00001ec0  0d 0b 18 22 20 e7 20 ac  20 53 6f 61 6b 46 6c 61  |..." . . SoakFla|
00001ed0  67 25 20 8c 20 f1 20 22  56 65 72 69 66 79 69 6e  |g% . . "Verifyin|
00001ee0  67 22 0d 0b 22 12 20 61  64 64 25 3d 30 3a 70 74  |g"..". add%=0:pt|
00001ef0  72 25 3d 30 0d 0b 2c 1c  20 f2 4d 6f 61 6e 4f 70  |r%=0..,. .MoanOp|
00001f00  28 52 65 73 74 6f 72 65  25 2c 30 2c 30 2c 30 29  |(Restore%,0,0,0)|
00001f10  0d 0b 36 06 20 f5 0d 0b  40 1a 20 20 c8 95 20 44  |..6. ...@.  .. D|
00001f20  65 66 65 63 74 25 21 70  74 72 25 3c 61 64 64 25  |efect%!ptr%<add%|
00001f30  0d 0b 4a 0e 20 20 20 70  74 72 25 2b 3d 34 0d 0b  |..J.   ptr%+=4..|
00001f40  54 07 20 20 ce 0d 0b 5e  1a 20 20 64 65 66 65 63  |T.  ...^.  defec|
00001f50  74 25 3d 44 65 66 65 63  74 25 21 70 74 72 25 0d  |t%=Defect%!ptr%.|
00001f60  0b 68 1b 20 20 e7 20 64  65 66 65 63 74 25 3e 44  |.h.  . defect%>D|
00001f70  69 73 63 53 69 7a 65 25  20 8c 0d 0b 72 1d 20 20  |iscSize% ...r.  |
00001f80  20 6c 65 6e 67 74 68 25  3d 44 69 73 63 53 69 7a  | length%=DiscSiz|
00001f90  65 25 2d 61 64 64 25 0d  0b 7c 07 20 20 cc 0d 0b  |e%-add%..|.  ...|
00001fa0  86 1b 20 20 20 6c 65 6e  67 74 68 25 3d 64 65 66  |..   length%=def|
00001fb0  65 63 74 25 2d 61 64 64  25 0d 0b 90 07 20 20 cd  |ect%-add%....  .|
00001fc0  0d 0b 9a 21 20 20 f2 4f  70 28 56 65 72 69 66 79  |...!  .Op(Verify|
00001fd0  25 2c 61 64 64 25 2c 30  2c 6c 65 6e 67 74 68 25  |%,add%,0,length%|
00001fe0  29 0d 0b a4 11 20 20 e7  20 52 65 73 75 6c 74 25  |)....  . Result%|
00001ff0  20 8c 0d 0b ae 23 20 20  20 61 64 64 25 3d 45 72  | ....#   add%=Er|
00002000  72 44 69 73 63 41 64 64  25 20 80 20 26 31 46 46  |rDiscAdd% . &1FF|
00002010  46 46 46 30 30 0d 0b b8  0d 20 20 20 54 72 79 25  |FFF00....   Try%|
00002020  3d 30 0d 0b c2 08 20 20  20 f5 0d 0b cc 0f 20 20  |=0....   .....  |
00002030  20 20 54 72 79 25 2b 3d  31 0d 0b d6 1f 20 20 20  |  Try%+=1....   |
00002040  20 f2 4d 6f 61 6e 4f 70  28 52 65 73 74 6f 72 65  | .MoanOp(Restore|
00002050  25 2c 30 2c 30 2c 30 29  0d 0b e0 20 20 20 20 20  |%,0,0,0)...     |
00002060  f2 4f 70 28 56 65 72 69  66 79 25 2c 61 64 64 25  |.Op(Verify%,add%|
00002070  2c 30 2c 26 31 30 30 29  0d 0b ea 1b 20 20 20 fd  |,0,&100)....   .|
00002080  20 52 65 73 75 6c 74 25  3d 30 20 84 20 54 72 79  | Result%=0 . Try|
00002090  25 3d 35 0d 0b f4 18 20  20 20 e7 20 52 65 73 75  |%=5....   . Resu|
000020a0  6c 74 25 20 54 72 79 25  2b 3d 31 0d 0b fe 1e 20  |lt% Try%+=1.... |
000020b0  20 20 73 65 63 74 6f 72  25 3d 61 64 64 25 20 81  |  sector%=add% .|
000020c0  20 53 65 63 53 69 7a 65  25 0d 0c 08 22 20 20 20  | SecSize%..."   |
000020d0  68 65 61 64 25 3d 73 65  63 74 6f 72 25 20 81 20  |head%=sector% . |
000020e0  53 65 63 73 50 65 72 54  72 6b 25 0d 0c 12 24 20  |SecsPerTrk%...$ |
000020f0  20 20 73 65 63 74 6f 72  25 3d 73 65 63 74 6f 72  |  sector%=sector|
00002100  25 20 83 20 53 65 63 73  50 65 72 54 72 6b 25 0d  |% . SecsPerTrk%.|
00002110  0c 1c 1a 20 20 20 63 79  6c 25 3d 68 65 61 64 25  |...   cyl%=head%|
00002120  20 81 20 48 65 61 64 73  25 0d 0c 26 1b 20 20 20  | . Heads%..&.   |
00002130  68 65 61 64 25 3d 68 65  61 64 25 20 83 20 48 65  |head%=head% . He|
00002140  61 64 73 25 0d 0c 30 3b  20 20 20 f1 20 22 43 79  |ads%..0;   . "Cy|
00002150  6c 3d 22 3b 63 79 6c 25  3b 22 20 48 65 61 64 3d  |l=";cyl%;" Head=|
00002160  22 3b 68 65 61 64 25 3b  22 20 53 65 63 74 6f 72  |";head%;" Sector|
00002170  3d 22 3b 73 65 63 74 6f  72 25 3b 22 20 22 3b 0d  |=";sector%;" ";.|
00002180  0c 3a 0d 20 20 20 73 75  73 25 3d 30 0d 0c 44 38  |.:.   sus%=0..D8|
00002190  20 20 20 c8 95 20 73 75  73 25 3c 73 75 73 70 65  |   .. sus%<suspe|
000021a0  63 74 73 25 20 80 20 53  75 73 41 64 64 25 28 73  |cts% . SusAdd%(s|
000021b0  75 73 25 29 3c 3e 61 64  64 25 3a 73 75 73 25 2b  |us%)<>add%:sus%+|
000021c0  3d 31 3a ce 0d 0c 4e 19  20 20 20 e7 20 73 75 73  |=1:...N.   . sus|
000021d0  25 3d 73 75 73 70 65 63  74 73 25 20 8c 0d 0c 58  |%=suspects% ...X|
000021e0  22 20 20 20 20 e7 20 73  75 73 70 65 63 74 73 25  |"    . suspects%|
000021f0  3d 4d 61 78 53 75 73 70  65 63 74 73 25 20 8c 0d  |=MaxSuspects% ..|
00002200  0c 62 1f 20 20 20 20 20  73 75 73 25 3d b3 28 4d  |.b.     sus%=.(M|
00002210  61 78 53 75 73 70 65 63  74 73 25 29 2d 31 0d 0c  |axSuspects%)-1..|
00002220  6c 09 20 20 20 20 cc 0d  0c 76 15 20 20 20 20 20  |l.    ...v.     |
00002230  73 75 73 70 65 63 74 73  25 2b 3d 31 0d 0c 80 09  |suspects%+=1....|
00002240  20 20 20 20 cd 0d 0c 8a  1a 20 20 20 20 53 75 73  |    .....    Sus|
00002250  41 64 64 25 28 73 75 73  25 29 3d 61 64 64 25 0d  |Add%(sus%)=add%.|
00002260  0c 94 18 20 20 20 20 53  75 73 43 6f 75 6e 74 25  |...    SusCount%|
00002270  3f 73 75 73 25 3d 30 0d  0c 9e 08 20 20 20 cd 0d  |?sus%=0....   ..|
00002280  0c a8 1a 20 20 20 73 63  6f 72 65 25 3d 32 5e 28  |...   score%=2^(|
00002290  54 72 79 25 2d 31 29 2d  31 0d 0c b2 24 20 20 20  |Try%-1)-1...$   |
000022a0  e7 20 ac 20 53 6f 61 6b  46 6c 61 67 25 20 73 63  |. . SoakFlag% sc|
000022b0  6f 72 65 25 3d 73 63 6f  72 65 25 2a 34 0d 0c bc  |ore%=score%*4...|
000022c0  1d 20 20 20 53 75 73 43  6f 75 6e 74 25 3f 73 75  |.   SusCount%?su|
000022d0  73 25 2b 3d 73 63 6f 72  65 25 0d 0c c6 1c 20 20  |s%+=score%....  |
000022e0  20 e7 20 53 75 73 43 6f  75 6e 74 25 3f 73 75 73  | . SusCount%?sus|
000022f0  25 3e 33 30 20 8c 0d 0c  d0 14 20 20 20 20 f1 20  |%>30 .....    . |
00002300  22 64 65 66 65 63 74 20  22 3b 0d 0c da 15 20 20  |"defect ";....  |
00002310  20 20 e7 20 53 6f 61 6b  46 6c 61 67 25 20 8c 0d  |  . SoakFlag% ..|
00002320  0c e4 12 20 20 20 20 20  ff 28 22 54 49 4d 45 22  |...     .("TIME"|
00002330  29 0d 0c ee 09 20 20 20  20 cc 0d 0c f8 0a 20 20  |)....    .....  |
00002340  20 20 20 f1 0d 0d 02 09  20 20 20 20 cd 0d 0d 0c  |   .....    ....|
00002350  1c 20 20 20 20 f2 41 64  64 50 68 79 73 44 65 66  |.    .AddPhysDef|
00002360  65 63 74 28 61 64 64 25  29 0d 0d 16 1a 20 20 20  |ect(add%)....   |
00002370  20 45 72 72 6f 72 43 79  63 6c 65 25 3d 43 79 63  | ErrorCycle%=Cyc|
00002380  6c 65 25 0d 0d 20 08 20  20 20 cc 0d 0d 2a 15 20  |le%.. .   ...*. |
00002390  20 20 20 e7 20 53 6f 61  6b 46 6c 61 67 25 20 8c  |   . SoakFlag% .|
000023a0  0d 0d 34 27 20 20 20 20  20 d1 3d 30 3a f5 20 fd  |..4'     .=0:. .|
000023b0  20 91 3e 35 30 30 3a ef  20 31 33 3a f1 89 28 33  | .>500:. 13:..(3|
000023c0  39 29 3b 3a ef 31 33 0d  0d 3e 09 20 20 20 20 cc  |9);:.13..>.    .|
000023d0  0d 0d 48 22 20 20 20 20  20 f1 20 3b 54 72 79 25  |..H"     . ;Try%|
000023e0  3b 22 20 72 65 74 72 69  65 73 20 6e 65 65 64 65  |;" retries neede|
000023f0  64 22 0d 0d 52 09 20 20  20 20 cd 0d 0d 5c 08 20  |d"..R.    ...\. |
00002400  20 20 cd 0d 0d 66 19 20  20 20 61 64 64 25 3d 61  |  ...f.   add%=a|
00002410  64 64 25 2b 53 65 63 53  69 7a 65 25 0d 0d 70 07  |dd%+SecSize%..p.|
00002420  20 20 cc 0d 0d 7a 21 20  20 20 61 64 64 25 3d 61  |  ...z!   add%=a|
00002430  64 64 25 2b 6c 65 6e 67  74 68 25 2b 53 65 63 53  |dd%+length%+SecS|
00002440  69 7a 65 25 0d 0d 84 07  20 20 cd 0d 0d 8e 16 20  |ize%....  ..... |
00002450  20 e7 20 61 64 64 25 3e  64 65 66 65 63 74 25 20  | . add%>defect% |
00002460  8c 0d 0d 98 0e 20 20 20  70 74 72 25 2b 3d 34 0d  |.....   ptr%+=4.|
00002470  0d a2 07 20 20 cd 0d 0d  ac 16 20 fd 20 61 64 64  |...  ..... . add|
00002480  25 3e 3d 44 69 73 63 53  69 7a 65 25 0d 0d b6 12  |%>=DiscSize%....|
00002490  20 e7 20 53 6f 61 6b 46  6c 61 67 25 20 8c 0d 0d  | . SoakFlag% ...|
000024a0  c0 07 20 20 f5 0d 0d ca  10 20 20 20 4b 65 79 25  |..  .....   Key%|
000024b0  3d a6 28 30 29 0d 0d d4  19 20 20 fd 20 4b 65 79  |=.(0)....  . Key|
000024c0  25 3d 2d 31 20 84 20 4b  65 79 25 3d 33 32 0d 0d  |%=-1 . Key%=32..|
000024d0  de 15 20 20 64 6f 6e 65  25 3d 28 4b 65 79 25 3d  |..  done%=(Key%=|
000024e0  33 32 29 0d 0d e8 06 20  cc 0d 0d f2 20 20 20 64  |32).... ....   d|
000024f0  6f 6e 65 25 3d 43 79 63  6c 65 25 3e 45 72 72 6f  |one%=Cycle%>Erro|
00002500  72 43 79 63 6c 65 25 2b  32 0d 0d fc 06 20 cd 0d  |rCycle%+2.... ..|
00002510  0e 06 0e 20 43 79 63 6c  65 25 2b 3d 31 0d 0e 10  |... Cycle%+=1...|
00002520  0b fd 20 64 6f 6e 65 25  0d 0e 1a 05 e1 0d 0e 24  |.. done%.......$|
00002530  05 3a 0d 0e 2e 10 dd 20  f2 53 74 72 75 63 74 75  |.:..... .Structu|
00002540  72 65 0d 0e 38 0f e7 20  4e 65 77 4d 61 70 25 20  |re..8.. NewMap% |
00002550  8c 0d 0e 42 12 20 f2 4e  65 77 53 74 72 75 63 74  |...B. .NewStruct|
00002560  75 72 65 0d 0e 4c 05 cc  0d 0e 56 12 20 f2 4f 6c  |ure..L....V. .Ol|
00002570  64 53 74 72 75 63 74 75  72 65 0d 0e 60 05 cd 0d  |dStructure..`...|
00002580  0e 6a 05 e1 0d 0e 74 05  3a 0d 0e 7e 13 dd 20 f2  |.j....t.:..~.. .|
00002590  4f 6c 64 53 74 72 75 63  74 75 72 65 0d 0e 88 14  |OldStructure....|
000025a0  f2 57 72 69 74 65 44 65  66 65 63 74 4c 69 73 74  |.WriteDefectList|
000025b0  0d 0e 92 12 f2 57 72 69  74 65 4f 6c 64 46 73 4d  |.....WriteOldFsM|
000025c0  61 70 0d 0e 9c 11 f2 57  72 69 74 65 52 6f 6f 74  |ap.....WriteRoot|
000025d0  44 69 72 0d 0e a6 05 e1  0d 0e b0 05 3a 0d 0e ba  |Dir.........:...|
000025e0  13 dd 20 f2 4e 65 77 53  74 72 75 63 74 75 72 65  |.. .NewStructure|
000025f0  0d 0e c4 13 5a 6f 6e 65  30 42 69 74 73 25 3d 36  |....Zone0Bits%=6|
00002600  30 2a 38 0d 0e ce 18 5a  6f 6e 65 42 69 74 73 25  |0*8....ZoneBits%|
00002610  3d 53 65 63 53 69 7a 65  25 2a 38 0d 0e d8 28 4c  |=SecSize%*8...(L|
00002620  6f 67 32 41 6c 6c 6f 63  25 3d 39 3a 20 f4 20 72  |og2Alloc%=9: . r|
00002630  65 71 75 65 73 74 65 64  20 62 79 20 54 43 73 20  |equested by TCs |
00002640  45 43 52 0d 0e e2 32 e7  20 4c 6f 67 32 41 6c 6c  |ECR...2. Log2All|
00002650  6f 63 25 3c 38 20 84 20  4c 6f 67 32 41 6c 6c 6f  |oc%<8 . Log2Allo|
00002660  63 25 3e 31 32 20 8c 20  4c 6f 67 32 41 6c 6c 6f  |c%>12 . Log2Allo|
00002670  63 25 3d 31 30 0d 0e ec  1d f5 3a 20 f4 20 61 6c  |c%=10.....: . al|
00002680  6c 6f 63 61 74 69 6f 6e  20 73 69 7a 65 20 6c 6f  |location size lo|
00002690  6f 70 0d 0e f6 3f 20 41  6c 6c 6f 63 25 3d a4 41  |op...? Alloc%=.A|
000026a0  73 6b 28 22 4c 61 72 67  65 20 66 69 6c 65 20 61  |sk("Large file a|
000026b0  6c 6c 6f 63 61 74 69 6f  6e 20 75 6e 69 74 22 2c  |llocation unit",|
000026c0  32 5e 4c 6f 67 32 41 6c  6c 6f 63 25 2c 32 35 36  |2^Log2Alloc%,256|
000026d0  29 0d 0f 00 0b 20 4c 6f  67 25 3d 37 0d 0f 0a 06  |).... Log%=7....|
000026e0  20 f5 0d 0f 14 0d 20 20  4c 6f 67 25 2b 3d 31 0d  | .....  Log%+=1.|
000026f0  0f 1e 1e 20 fd 20 41 6c  6c 6f 63 25 3d 32 5e 4c  |... . Alloc%=2^L|
00002700  6f 67 25 20 84 20 4c 6f  67 25 3d 31 33 0d 0f 28  |og% . Log%=13..(|
00002710  2c 20 e7 20 4c 6f 67 25  3d 31 33 20 fd 20 a3 3a  |, . Log%=13 . .:|
00002720  f4 20 72 65 73 74 61 72  74 20 61 6c 6c 6f 63 20  |. restart alloc |
00002730  73 69 7a 65 20 6c 6f 6f  70 0d 0f 32 14 20 4c 6f  |size loop..2. Lo|
00002740  67 32 41 6c 6c 6f 63 25  3d 4c 6f 67 25 0d 0f 3c  |g2Alloc%=Log%..<|
00002750  20 20 4d 61 70 42 69 74  73 25 3d 44 69 73 63 53  |  MapBits%=DiscS|
00002760  69 7a 65 25 20 81 20 41  6c 6c 6f 63 25 0d 0f 46  |ize% . Alloc%..F|
00002770  21 20 52 6f 75 6e 64 53  69 7a 65 25 3d 4d 61 70  |! RoundSize%=Map|
00002780  42 69 74 73 25 20 2a 20  41 6c 6c 6f 63 25 0d 0f  |Bits% * Alloc%..|
00002790  50 34 20 42 65 73 74 5a  6f 6e 65 73 25 3d 31 20  |P4 BestZones%=1 |
000027a0  3c 3c 20 33 30 20 20 20  20 20 20 3a f4 20 69 6e  |<< 30      :. in|
000027b0  69 74 20 74 6f 20 72 6f  67 75 65 20 76 61 6c 75  |it to rogue valu|
000027c0  65 73 0d 0f 5a 18 20 42  65 73 74 43 79 6c 4f 66  |es..Z. BestCylOf|
000027d0  66 25 3d 31 20 3c 3c 20  33 30 0d 0f 64 18 20 e3  |f%=1 << 30..d. .|
000027e0  20 44 75 6d 6d 79 53 70  61 72 65 25 3d 31 20 b8  | DummySpare%=1 .|
000027f0  20 31 0d 0f 6e 32 20 e3  20 53 70 61 72 65 42 69  | 1..n2 . SpareBi|
00002800  74 73 25 20 3d 20 34 2a  38 20 b8 20 5a 6f 6e 65  |ts% = 4*8 . Zone|
00002810  42 69 74 73 25 2d 5a 6f  6e 65 30 42 69 74 73 25  |Bits%-Zone0Bits%|
00002820  2d 38 2a 38 0d 0f 78 10  20 20 f2 43 61 6c 63 5a  |-8*8..x.  .CalcZ|
00002830  6f 6e 65 73 0d 0f 82 12  20 20 4c 69 6e 6b 42 69  |ones....  LinkBi|
00002840  74 73 25 3d 31 30 0d 0f  8c 14 20 20 f5 20 4c 69  |ts%=10....  . Li|
00002850  6e 6b 42 69 74 73 25 2b  3d 31 0d 0f 96 0f 20 20  |nkBits%+=1....  |
00002860  20 f2 43 61 6c 63 49 64  73 0d 0f a0 19 20 20 fd  | .CalcIds....  .|
00002870  20 49 64 73 25 3c 3d 32  5e 4c 69 6e 6b 42 69 74  | Ids%<=2^LinkBit|
00002880  73 25 0d 0f aa 41 20 20  e7 20 53 70 61 72 65 42  |s%...A  . SpareB|
00002890  69 74 73 25 2d 34 2a 38  3e 30 20 80 20 53 70 61  |its%-4*8>0 . Spa|
000028a0  72 65 42 69 74 73 25 2d  34 2a 38 3c 3d 4c 69 6e  |reBits%-4*8<=Lin|
000028b0  6b 42 69 74 73 25 20 ed  20 53 70 61 72 65 42 69  |kBits% . SpareBi|
000028c0  74 73 25 0d 0f b4 35 20  20 e7 20 4f 64 64 42 69  |ts%...5  . OddBi|
000028d0  74 73 25 3e 30 20 80 20  4f 64 64 42 69 74 73 25  |ts%>0 . OddBits%|
000028e0  3c 3d 4c 69 6e 6b 42 69  74 73 25 20 ed 20 53 70  |<=LinkBits% . Sp|
000028f0  61 72 65 42 69 74 73 25  0d 0f be 23 20 20 e7 20  |areBits%...#  . |
00002900  4c 69 6e 6b 42 69 74 73  25 3e 31 35 20 84 20 5a  |LinkBits%>15 . Z|
00002910  6f 6e 65 73 25 3e 31 32  37 20 8c 0d 0f c8 24 20  |ones%>127 ....$ |
00002920  20 20 f1 20 22 41 6c 6c  6f 63 61 74 69 6f 6e 20  |  . "Allocation |
00002930  75 6e 69 74 20 74 6f 6f  20 73 6d 61 6c 6c 22 0d  |unit too small".|
00002940  0f d2 14 20 20 20 4c 6f  67 32 41 6c 6c 6f 63 25  |...   Log2Alloc%|
00002950  2b 3d 31 0d 0f dc 14 20  20 20 ed 20 44 75 6d 6d  |+=1....   . Dumm|
00002960  79 53 70 61 72 65 25 0d  0f e6 26 20 20 20 fd 20  |ySpare%...&   . |
00002970  a3 20 20 3a f4 20 72 65  73 74 61 72 74 20 61 6c  |.  :. restart al|
00002980  6c 6f 63 20 73 69 7a 65  20 6c 6f 6f 70 0d 0f f0  |loc size loop...|
00002990  07 20 20 cd 0d 0f fa 1e  20 20 e7 20 5a 6f 6e 65  |.  .....  . Zone|
000029a0  73 25 20 3c 3d 20 42 65  73 74 5a 6f 6e 65 73 25  |s% <= BestZones%|
000029b0  20 8c 0d 10 04 2a 20 20  20 43 72 75 63 69 61 6c  | ....*   Crucial|
000029c0  25 3d 5a 6f 6e 65 73 25  2a 53 65 63 53 69 7a 65  |%=Zones%*SecSize|
000029d0  25 2a 32 2b 44 69 72 53  69 7a 65 25 0d 10 0e 2f  |%*2+DirSize%.../|
000029e0  20 20 20 e7 20 4d 61 70  5a 6f 6e 65 25 3d 30 20  |   . MapZone%=0 |
000029f0  43 72 75 63 69 61 6c 25  3d 42 6f 6f 74 41 64 64  |Crucial%=BootAdd|
00002a00  25 2b 42 6f 6f 74 53 69  7a 65 25 0d 10 18 44 20  |%+BootSize%...D |
00002a10  20 20 e7 20 43 72 75 63  69 61 6c 25 3c 41 6c 6c  |  . Crucial%<All|
00002a20  6f 63 25 2a 28 4c 69 6e  6b 42 69 74 73 25 2b 31  |oc%*(LinkBits%+1|
00002a30  29 20 43 72 75 63 69 61  6c 25 3d 41 6c 6c 6f 63  |) Crucial%=Alloc|
00002a40  25 2a 28 4c 69 6e 6b 42  69 74 73 25 2b 31 29 0d  |%*(LinkBits%+1).|
00002a50  10 22 23 20 20 20 43 72  75 63 69 61 6c 45 6e 64  |."#   CrucialEnd|
00002a60  25 3d 4d 61 70 41 64 64  25 2b 43 72 75 63 69 61  |%=MapAdd%+Crucia|
00002a70  6c 25 0d 10 2c 16 20 20  20 44 65 66 50 74 72 25  |l%..,.   DefPtr%|
00002a80  3d 44 65 66 65 63 74 25  0d 10 36 08 20 20 20 f5  |=Defect%..6.   .|
00002a90  0d 10 40 18 20 20 20 20  64 65 66 65 63 74 25 3d  |..@.    defect%=|
00002aa0  21 44 65 66 50 74 72 25  0d 10 4a 12 20 20 20 20  |!DefPtr%..J.    |
00002ab0  44 65 66 50 74 72 25 2b  3d 34 0d 10 54 47 20 20  |DefPtr%+=4..TG  |
00002ac0  20 fd 20 64 65 66 65 63  74 25 3e 3d 45 6e 64 44  | . defect%>=EndD|
00002ad0  65 66 65 63 74 25 20 84  20 28 64 65 66 65 63 74  |efect% . (defect|
00002ae0  25 3e 3d 4d 61 70 41 64  64 25 20 80 20 64 65 66  |%>=MapAdd% . def|
00002af0  65 63 74 25 3c 43 72 75  63 69 61 6c 45 6e 64 25  |ect%<CrucialEnd%|
00002b00  29 0d 10 5e 36 20 20 20  43 79 6c 4f 66 66 25 3d  |)..^6   CylOff%=|
00002b10  4d 61 70 41 64 64 25 20  83 20 28 53 65 63 53 69  |MapAdd% . (SecSi|
00002b20  7a 65 25 2a 53 65 63 73  50 65 72 54 72 6b 25 2a  |ze%*SecsPerTrk%*|
00002b30  48 65 61 64 73 25 29 0d  10 68 34 20 20 20 e7 20  |Heads%)..h4   . |
00002b40  64 65 66 65 63 74 25 3e  3d 45 6e 64 44 65 66 65  |defect%>=EndDefe|
00002b50  63 74 25 20 80 20 43 79  6c 4f 66 66 25 3c 42 65  |ct% . CylOff%<Be|
00002b60  73 74 43 79 6c 4f 66 66  25 20 8c 0d 10 72 1b 20  |stCylOff% ...r. |
00002b70  20 20 20 42 65 73 74 43  79 6c 4f 66 66 25 3d 43  |   BestCylOff%=C|
00002b80  79 6c 4f 66 66 25 0d 10  7c 1f 20 20 20 20 42 65  |ylOff%..|.    Be|
00002b90  73 74 4c 69 6e 6b 42 69  74 73 25 3d 4c 69 6e 6b  |stLinkBits%=Link|
00002ba0  42 69 74 73 25 0d 10 86  1d 20 20 20 20 42 65 73  |Bits%....    Bes|
00002bb0  74 53 70 61 72 65 25 3d  53 70 61 72 65 42 69 74  |tSpare%=SpareBit|
00002bc0  73 25 0d 10 90 19 20 20  20 20 42 65 73 74 5a 6f  |s%....    BestZo|
00002bd0  6e 65 73 25 3d 5a 6f 6e  65 73 25 0d 10 9a 08 20  |nes%=Zones%.... |
00002be0  20 20 cd 0d 10 a4 21 20  20 20 e7 20 42 65 73 74  |  ....!   . Best|
00002bf0  43 79 6c 4f 66 66 25 20  ed 20 53 70 61 72 65 42  |CylOff% . SpareB|
00002c00  69 74 73 25 0d 10 ae 14  20 20 20 ed 20 44 75 6d  |its%....   . Dum|
00002c10  6d 79 53 70 61 72 65 25  0d 10 b8 07 20 20 cc 0d  |mySpare%....  ..|
00002c20  10 c2 14 20 20 20 ed 20  44 75 6d 6d 79 53 70 61  |...   . DummySpa|
00002c30  72 65 25 0d 10 cc 07 20  20 cd 0d 10 d6 41 e7 20  |re%....  ....A. |
00002c40  42 65 73 74 5a 6f 6e 65  73 25 3d 28 31 3c 3c 33  |BestZones%=(1<<3|
00002c50  30 29 20 8c 20 f1 20 22  43 61 6e 27 74 20 75 73  |0) . . "Can't us|
00002c60  65 20 74 68 69 73 20 61  6c 6c 6f 63 61 74 69 6f  |e this allocatio|
00002c70  6e 20 73 69 7a 65 22 3a  fd 20 a3 0d 10 e0 07 fd  |n size":. ......|
00002c80  20 b9 0d 10 ea 1b 4c 69  6e 6b 42 69 74 73 25 3d  | .....LinkBits%=|
00002c90  42 65 73 74 4c 69 6e 6b  42 69 74 73 25 0d 10 f4  |BestLinkBits%...|
00002ca0  19 53 70 61 72 65 42 69  74 73 25 3d 42 65 73 74  |.SpareBits%=Best|
00002cb0  53 70 61 72 65 25 0d 10  fe 0e f2 43 61 6c 63 5a  |Spare%.....CalcZ|
00002cc0  6f 6e 65 73 0d 11 08 0c  f2 43 61 6c 63 49 64 73  |ones.....CalcIds|
00002cd0  0d 11 12 27 43 72 75 63  69 61 6c 25 3d 5a 6f 6e  |...'Crucial%=Zon|
00002ce0  65 73 25 2a 53 65 63 53  69 7a 65 25 2a 32 2b 44  |es%*SecSize%*2+D|
00002cf0  69 72 53 69 7a 65 25 0d  11 1c 2c e7 20 4d 61 70  |irSize%...,. Map|
00002d00  5a 6f 6e 65 25 3d 30 20  43 72 75 63 69 61 6c 25  |Zone%=0 Crucial%|
00002d10  3d 42 6f 6f 74 41 64 64  25 2b 42 6f 6f 74 53 69  |=BootAdd%+BootSi|
00002d20  7a 65 25 0d 11 26 41 e7  20 43 72 75 63 69 61 6c  |ze%..&A. Crucial|
00002d30  25 3c 41 6c 6c 6f 63 25  2a 28 4c 69 6e 6b 42 69  |%<Alloc%*(LinkBi|
00002d40  74 73 25 2b 31 29 20 43  72 75 63 69 61 6c 25 3d  |ts%+1) Crucial%=|
00002d50  41 6c 6c 6f 63 25 2a 28  4c 69 6e 6b 42 69 74 73  |Alloc%*(LinkBits|
00002d60  25 2b 31 29 0d 11 30 3d  e7 20 43 72 75 63 69 61  |%+1)..0=. Crucia|
00002d70  6c 25 20 83 20 41 6c 6c  6f 63 25 3c 3e 30 20 43  |l% . Alloc%<>0 C|
00002d80  72 75 63 69 61 6c 25 2b  3d 41 6c 6c 6f 63 25 2d  |rucial%+=Alloc%-|
00002d90  43 72 75 63 69 61 6c 25  20 83 20 41 6c 6c 6f 63  |Crucial% . Alloc|
00002da0  25 0d 11 3a 12 e7 20 4d  61 70 5a 6f 6e 65 25 3d  |%..:.. MapZone%=|
00002db0  30 20 8c 0d 11 44 23 20  52 6f 6f 74 44 69 72 41  |0 ...D# RootDirA|
00002dc0  64 64 25 3d 42 6f 6f 74  41 64 64 25 2b 42 6f 6f  |dd%=BootAdd%+Boo|
00002dd0  74 53 69 7a 65 25 0d 11  4e 3e 20 49 6e 64 52 6f  |tSize%..N> IndRo|
00002de0  6f 74 44 69 72 41 64 64  25 3d 26 32 30 30 20 2b  |otDirAdd%=&200 +|
00002df0  20 28 42 6f 6f 74 41 64  64 25 2b 42 6f 6f 74 53  | (BootAdd%+BootS|
00002e00  69 7a 65 25 29 20 81 20  53 65 63 53 69 7a 65 25  |ize%) . SecSize%|
00002e10  20 2b 20 31 0d 11 58 05  cc 0d 11 62 22 20 52 6f  | + 1..X....b" Ro|
00002e20  6f 74 44 69 72 41 64 64  25 3d 4d 61 70 41 64 64  |otDirAdd%=MapAdd|
00002e30  25 2b 4d 61 70 4c 65 6e  25 2a 32 0d 11 6c 23 20  |%+MapLen%*2..l# |
00002e40  49 6e 64 52 6f 6f 74 44  69 72 41 64 64 25 3d 26  |IndRootDirAdd%=&|
00002e50  32 30 30 2b 5a 6f 6e 65  73 25 2a 32 2b 31 0d 11  |200+Zones%*2+1..|
00002e60  76 05 cd 0d 11 80 18 44  69 73 63 52 65 63 25 3f  |v......DiscRec%?|
00002e70  34 3d 4c 69 6e 6b 42 69  74 73 25 0d 11 8a 19 44  |4=LinkBits%....D|
00002e80  69 73 63 52 65 63 25 3f  35 3d 4c 6f 67 32 41 6c  |iscRec%?5=Log2Al|
00002e90  6c 6f 63 25 0d 11 94 15  44 69 73 63 52 65 63 25  |loc%....DiscRec%|
00002ea0  3f 39 3d 5a 6f 6e 65 73  25 0d 11 9e 20 44 69 73  |?9=Zones%... Dis|
00002eb0  63 52 65 63 25 3f 26 41  3d 53 70 61 72 65 42 69  |cRec%?&A=SpareBi|
00002ec0  74 73 25 20 83 20 32 35  36 0d 11 a8 20 44 69 73  |ts% . 256... Dis|
00002ed0  63 52 65 63 25 3f 26 42  3d 53 70 61 72 65 42 69  |cRec%?&B=SpareBi|
00002ee0  74 73 25 20 81 20 32 35  36 0d 11 b2 1e 44 69 73  |ts% . 256....Dis|
00002ef0  63 52 65 63 25 21 26 43  3d 49 6e 64 52 6f 6f 74  |cRec%!&C=IndRoot|
00002f00  44 69 72 41 64 64 25 0d  11 bc 19 42 6f 6f 74 52  |DirAdd%....BootR|
00002f10  65 63 25 21 34 3d 44 69  73 63 52 65 63 25 21 34  |ec%!4=DiscRec%!4|
00002f20  0d 11 c6 19 42 6f 6f 74  52 65 63 25 21 38 3d 44  |....BootRec%!8=D|
00002f30  69 73 63 52 65 63 25 21  38 0d 11 d0 1b 42 6f 6f  |iscRec%!8....Boo|
00002f40  74 52 65 63 25 21 26 43  3d 44 69 73 63 52 65 63  |tRec%!&C=DiscRec|
00002f50  25 21 26 43 0d 11 da 22  e3 20 49 25 3d 30 20 b8  |%!&C...". I%=0 .|
00002f60  20 5a 6f 6e 65 73 25 2a  53 65 63 53 69 7a 65 25  | Zones%*SecSize%|
00002f70  2d 34 20 88 20 34 0d 11  e4 0e 20 42 75 66 25 21  |-4 . 4.... Buf%!|
00002f80  49 25 3d 30 0d 11 ee 08  ed 20 49 25 0d 11 f8 15  |I%=0..... I%....|
00002f90  e3 20 49 25 3d 30 20 b8  20 36 30 2d 34 20 88 20  |. I%=0 . 60-4 . |
00002fa0  34 0d 12 02 1c 20 42 75  66 25 21 28 49 25 2b 34  |4.... Buf%!(I%+4|
00002fb0  29 3d 44 69 73 63 52 65  63 25 21 49 25 0d 12 0c  |)=DiscRec%!I%...|
00002fc0  08 ed 20 49 25 0d 12 16  14 f2 57 72 69 74 65 44  |.. I%.....WriteD|
00002fd0  65 66 65 63 74 4c 69 73  74 0d 12 20 14 f1 20 22  |efectList.. .. "|
00002fe0  43 72 65 61 74 69 6e 67  20 4d 61 70 22 0d 12 2a  |Creating Map"..*|
00002ff0  0a 70 74 72 25 3d 30 0d  12 34 12 44 65 66 65 63  |.ptr%=0..4.Defec|
00003000  74 53 74 61 72 74 25 3d  30 0d 12 3e 25 44 69 73  |tStart%=0..>%Dis|
00003010  63 45 6e 64 42 69 74 25  3d a4 44 69 73 63 54 6f  |cEndBit%=.DiscTo|
00003020  4d 61 70 28 44 69 73 63  53 69 7a 65 25 29 0d 12  |Map(DiscSize%)..|
00003030  48 13 5a 6f 6e 65 53 74  61 72 74 25 3d 42 75 66  |H.ZoneStart%=Buf|
00003040  25 0d 12 52 13 5a 6f 6e  65 53 74 61 72 74 42 69  |%..R.ZoneStartBi|
00003050  74 25 3d 30 0d 12 5c 18  e3 20 7a 6f 6e 65 25 3d  |t%=0..\.. zone%=|
00003060  30 20 b8 20 5a 6f 6e 65  73 25 2d 31 0d 12 66 24  |0 . Zones%-1..f$|
00003070  20 21 5a 6f 6e 65 53 74  61 72 74 25 3d 31 3c 3c  | !ZoneStart%=1<<|
00003080  28 31 35 2b 46 72 65 65  4c 69 6e 6b 25 2a 38 29  |(15+FreeLink%*8)|
00003090  0d 12 70 28 20 5a 6f 6e  65 45 6e 64 42 69 74 25  |..p( ZoneEndBit%|
000030a0  3d 5a 6f 6e 65 53 74 61  72 74 42 69 74 25 2b 5a  |=ZoneStartBit%+Z|
000030b0  6f 6e 65 42 69 74 73 25  0d 12 7a 2f 20 55 73 65  |oneBits%..z/ Use|
000030c0  64 5a 6f 6e 65 45 6e 64  42 69 74 25 3d 5a 6f 6e  |dZoneEndBit%=Zon|
000030d0  65 45 6e 64 42 69 74 25  2d 53 70 61 72 65 42 69  |eEndBit%-SpareBi|
000030e0  74 73 25 2b 34 2a 38 0d  12 84 24 20 e7 20 55 73  |ts%+4*8...$ . Us|
000030f0  65 64 5a 6f 6e 65 45 6e  64 42 69 74 25 3e 44 69  |edZoneEndBit%>Di|
00003100  73 63 45 6e 64 42 69 74  25 20 8c 0d 12 8e 21 20  |scEndBit% ....! |
00003110  20 55 73 65 64 5a 6f 6e  65 45 6e 64 42 69 74 25  | UsedZoneEndBit%|
00003120  3d 44 69 73 63 45 6e 64  42 69 74 25 0d 12 98 06  |=DiscEndBit%....|
00003130  20 cd 0d 12 a2 27 20 50  72 65 46 72 65 65 25 3d  | ....' PreFree%=|
00003140  5a 6f 6e 65 53 74 61 72  74 42 69 74 25 2b 46 72  |ZoneStartBit%+Fr|
00003150  65 65 4c 69 6e 6b 25 2a  38 0d 12 ac 1f 20 5a 6f  |eeLink%*8.... Zo|
00003160  6e 65 42 69 74 25 3d 5a  6f 6e 65 53 74 61 72 74  |neBit%=ZoneStart|
00003170  42 69 74 25 2b 34 2a 38  0d 12 b6 10 20 e7 20 7a  |Bit%+4*8.... . z|
00003180  6f 6e 65 25 3d 30 20 8c  0d 12 c0 22 20 20 5a 6f  |one%=0 ...."  Zo|
00003190  6e 65 42 69 74 25 3d 5a  6f 6e 65 42 69 74 25 2b  |neBit%=ZoneBit%+|
000031a0  5a 6f 6e 65 30 42 69 74  73 25 0d 12 ca 2b 20 20  |Zone0Bits%...+  |
000031b0  6c 65 6e 67 74 68 25 3d  28 42 6f 6f 74 41 64 64  |length%=(BootAdd|
000031c0  25 2b 42 6f 6f 74 53 69  7a 65 25 29 20 81 20 41  |%+BootSize%) . A|
000031d0  6c 6c 6f 63 25 0d 12 d4  2f 20 20 e7 20 6c 65 6e  |lloc%.../  . len|
000031e0  67 74 68 25 3c 4c 69 6e  6b 42 69 74 73 25 2b 31  |gth%<LinkBits%+1|
000031f0  20 6c 65 6e 67 74 68 25  3d 4c 69 6e 6b 42 69 74  | length%=LinkBit|
00003200  73 25 2b 31 0d 12 de 1c  20 20 f2 57 72 69 74 65  |s%+1....  .Write|
00003210  4c 69 6e 6b 28 5a 6f 6e  65 42 69 74 25 2c 32 29  |Link(ZoneBit%,2)|
00003220  0d 12 e8 24 20 20 f2 57  72 69 74 65 4c 65 6e 67  |...$  .WriteLeng|
00003230  74 68 28 5a 6f 6e 65 42  69 74 25 2c 6c 65 6e 67  |th(ZoneBit%,leng|
00003240  74 68 25 29 0d 12 f2 1f  20 20 5a 6f 6e 65 42 69  |th%)....  ZoneBi|
00003250  74 25 3d 5a 6f 6e 65 42  69 74 25 2b 6c 65 6e 67  |t%=ZoneBit%+leng|
00003260  74 68 25 0d 12 fc 06 20  cc 0d 13 06 18 20 20 e7  |th%.... .....  .|
00003270  20 7a 6f 6e 65 25 3d 4d  61 70 5a 6f 6e 65 25 20  | zone%=MapZone% |
00003280  8c 0d 13 10 20 20 20 20  6c 65 6e 67 74 68 25 3d  |....    length%=|
00003290  43 72 75 63 69 61 6c 25  20 81 20 41 6c 6c 6f 63  |Crucial% . Alloc|
000032a0  25 0d 13 1a 1d 20 20 20  f2 57 72 69 74 65 4c 69  |%....   .WriteLi|
000032b0  6e 6b 28 5a 6f 6e 65 42  69 74 25 2c 32 29 0d 13  |nk(ZoneBit%,2)..|
000032c0  24 25 20 20 20 f2 57 72  69 74 65 4c 65 6e 67 74  |$%   .WriteLengt|
000032d0  68 28 5a 6f 6e 65 42 69  74 25 2c 6c 65 6e 67 74  |h(ZoneBit%,lengt|
000032e0  68 25 29 0d 13 2e 20 20  20 20 5a 6f 6e 65 42 69  |h%)...    ZoneBi|
000032f0  74 25 3d 5a 6f 6e 65 42  69 74 25 2b 6c 65 6e 67  |t%=ZoneBit%+leng|
00003300  74 68 25 0d 13 38 07 20  20 cd 0d 13 42 06 20 cd  |th%..8.  ...B. .|
00003310  0d 13 4c 06 20 f5 0d 13  56 1f 20 20 e7 20 5a 6f  |..L. ...V.  . Zo|
00003320  6e 65 42 69 74 25 3e 44  65 66 65 63 74 53 74 61  |neBit%>DefectSta|
00003330  72 74 25 20 8c 0d 13 60  2c 20 20 20 44 65 66 65  |rt% ...`,   Defe|
00003340  63 74 53 74 61 72 74 25  3d a4 44 69 73 63 54 6f  |ctStart%=.DiscTo|
00003350  4d 61 70 28 44 65 66 65  63 74 25 21 70 74 72 25  |Map(Defect%!ptr%|
00003360  29 0d 13 6a 28 20 20 20  e7 20 44 65 66 65 63 74  |)..j(   . Defect|
00003370  53 74 61 72 74 25 3e 3d  55 73 65 64 5a 6f 6e 65  |Start%>=UsedZone|
00003380  45 6e 64 42 69 74 25 20  8c 0d 13 74 20 20 20 20  |EndBit% ...t    |
00003390  20 44 65 66 65 63 74 53  74 61 72 74 25 3d 5a 6f  | DefectStart%=Zo|
000033a0  6e 65 45 6e 64 42 69 74  25 0d 13 7e 08 20 20 20  |neEndBit%..~.   |
000033b0  cc 0d 13 88 21 20 20 20  20 44 65 66 65 63 74 45  |....!    DefectE|
000033c0  6e 64 25 3d 44 65 66 65  63 74 53 74 61 72 74 25  |nd%=DefectStart%|
000033d0  2b 31 0d 13 92 0f 20 20  20 20 70 74 72 25 2b 3d  |+1....    ptr%+=|
000033e0  34 0d 13 9c 09 20 20 20  20 f5 0d 13 a6 11 20 20  |4....    .....  |
000033f0  20 20 20 64 6f 6e 65 31  25 3d b9 0d 13 b0 0a 20  |   done1%=..... |
00003400  20 20 20 20 f5 0d 13 ba  12 20 20 20 20 20 20 64  |    .....      d|
00003410  6f 6e 65 32 25 3d b9 0d  13 c4 2e 20 20 20 20 20  |one2%=.....     |
00003420  20 4e 65 78 74 44 65 66  65 63 74 25 3d a4 44 69  | NextDefect%=.Di|
00003430  73 63 54 6f 4d 61 70 28  44 65 66 65 63 74 25 21  |scToMap(Defect%!|
00003440  70 74 72 25 29 0d 13 ce  29 20 20 20 20 20 20 e7  |ptr%)...)      .|
00003450  20 4e 65 78 74 44 65 66  65 63 74 25 3c 55 73 65  | NextDefect%<Use|
00003460  64 5a 6f 6e 65 45 6e 64  42 69 74 25 20 8c 0d 13  |dZoneEndBit% ...|
00003470  d8 34 20 20 20 20 20 20  20 e7 20 4e 65 78 74 44  |.4       . NextD|
00003480  65 66 65 63 74 25 3e 5a  6f 6e 65 45 6e 64 42 69  |efect%>ZoneEndBi|
00003490  74 25 2d 28 4c 69 6e 6b  42 69 74 73 25 2b 31 29  |t%-(LinkBits%+1)|
000034a0  20 8c 0d 13 e2 2e 20 20  20 20 20 20 20 20 4e 65  | .....        Ne|
000034b0  78 74 44 65 66 25 3d 5a  6f 6e 65 45 6e 64 42 69  |xtDef%=ZoneEndBi|
000034c0  74 25 2d 28 4c 69 6e 6b  42 69 74 73 25 2b 31 29  |t%-(LinkBits%+1)|
000034d0  0d 13 ec 0c 20 20 20 20  20 20 20 cc 0d 13 f6 20  |....       .... |
000034e0  20 20 20 20 20 20 20 20  4e 65 78 74 44 65 66 25  |        NextDef%|
000034f0  3d 4e 65 78 74 44 65 66  65 63 74 25 0d 14 00 0c  |=NextDefect%....|
00003500  20 20 20 20 20 20 20 cd  0d 14 0a 2e 20 20 20 20  |       .....    |
00003510  20 20 20 e7 20 4e 65 78  74 44 65 66 25 2d 44 65  |   . NextDef%-De|
00003520  66 65 63 74 45 6e 64 25  3c 4c 69 6e 6b 42 69 74  |fectEnd%<LinkBit|
00003530  73 25 2b 31 20 8c 0d 14  14 28 20 20 20 20 20 20  |s%+1 ....(      |
00003540  20 20 e7 20 4e 65 78 74  44 65 66 65 63 74 25 2b  |  . NextDefect%+|
00003550  31 3e 44 65 66 65 63 74  45 6e 64 25 20 8c 0d 14  |1>DefectEnd% ...|
00003560  1e 25 20 20 20 20 20 20  20 20 20 44 65 66 65 63  |.%         Defec|
00003570  74 45 6e 64 25 3d 4e 65  78 74 44 65 66 65 63 74  |tEnd%=NextDefect|
00003580  25 2b 31 0d 14 28 0d 20  20 20 20 20 20 20 20 cd  |%+1..(.        .|
00003590  0d 14 32 13 20 20 20 20  20 20 20 20 70 74 72 25  |..2.        ptr%|
000035a0  2b 3d 34 0d 14 3c 14 20  20 20 20 20 20 20 20 64  |+=4..<.        d|
000035b0  6f 6e 65 32 25 3d a3 0d  14 46 0c 20 20 20 20 20  |one2%=...F.     |
000035c0  20 20 cd 0d 14 50 0b 20  20 20 20 20 20 cd 0d 14  |  ...P.      ...|
000035d0  5a 11 20 20 20 20 20 fd  20 64 6f 6e 65 32 25 0d  |Z.     . done2%.|
000035e0  14 64 30 20 20 20 20 20  e7 20 44 65 66 65 63 74  |.d0     . Defect|
000035f0  45 6e 64 25 2d 44 65 66  65 63 74 53 74 61 72 74  |End%-DefectStart|
00003600  25 3c 4c 69 6e 6b 42 69  74 73 25 2b 31 20 8c 0d  |%<LinkBits%+1 ..|
00003610  14 6e 2d 20 20 20 20 20  20 44 65 66 65 63 74 45  |.n-      DefectE|
00003620  6e 64 25 3d 44 65 66 65  63 74 53 74 61 72 74 25  |nd%=DefectStart%|
00003630  2b 4c 69 6e 6b 42 69 74  73 25 2b 31 0d 14 78 24  |+LinkBits%+1..x$|
00003640  20 20 20 20 20 20 e7 20  44 65 66 65 63 74 45 6e  |      . DefectEn|
00003650  64 25 3e 5a 6f 6e 65 45  6e 64 42 69 74 25 20 8c  |d%>ZoneEndBit% .|
00003660  0d 14 82 21 20 20 20 20  20 20 20 44 65 66 65 63  |...!       Defec|
00003670  74 45 6e 64 25 3d 5a 6f  6e 65 45 6e 64 42 69 74  |tEnd%=ZoneEndBit|
00003680  25 0d 14 8c 0b 20 20 20  20 20 20 cd 0d 14 96 12  |%....      .....|
00003690  20 20 20 20 20 20 64 6f  6e 65 31 25 3d a3 0d 14  |      done1%=...|
000036a0  a0 0a 20 20 20 20 20 cd  0d 14 aa 4b 20 20 20 20  |..     ....K    |
000036b0  20 e7 20 44 65 66 65 63  74 45 6e 64 25 3e 5a 6f  | . DefectEnd%>Zo|
000036c0  6e 65 45 6e 64 42 69 74  25 2d 28 4c 69 6e 6b 42  |neEndBit%-(LinkB|
000036d0  69 74 73 25 2b 31 29 20  80 20 44 65 66 65 63 74  |its%+1) . Defect|
000036e0  45 6e 64 25 3c 3e 5a 6f  6e 65 45 6e 64 42 69 74  |End%<>ZoneEndBit|
000036f0  25 20 8c 0d 14 b4 20 20  20 20 20 20 20 44 65 66  |% ....       Def|
00003700  65 63 74 45 6e 64 25 3d  5a 6f 6e 65 45 6e 64 42  |ectEnd%=ZoneEndB|
00003710  69 74 25 0d 14 be 12 20  20 20 20 20 20 64 6f 6e  |it%....      don|
00003720  65 31 25 3d a3 0d 14 c8  0a 20 20 20 20 20 cd 0d  |e1%=.....     ..|
00003730  14 d2 30 20 20 20 20 20  e7 20 44 65 66 65 63 74  |..0     . Defect|
00003740  45 6e 64 25 2d 44 65 66  65 63 74 53 74 61 72 74  |End%-DefectStart|
00003750  25 3c 4c 69 6e 6b 42 69  74 73 25 2b 31 20 8c 0d  |%<LinkBits%+1 ..|
00003760  14 dc 2f 20 20 20 20 20  20 44 65 66 65 63 74 53  |../      DefectS|
00003770  74 61 72 74 25 3d 44 65  66 65 63 74 45 6e 64 25  |tart%=DefectEnd%|
00003780  2d 28 4c 69 6e 6b 42 69  74 73 25 2b 31 29 0d 14  |-(LinkBits%+1)..|
00003790  e6 0a 20 20 20 20 20 cd  0d 14 f0 10 20 20 20 20  |..     .....    |
000037a0  fd 20 64 6f 6e 65 31 25  0d 14 fa 08 20 20 20 cd  |. done1%....   .|
000037b0  0d 15 04 07 20 20 cd 0d  15 0e 33 20 20 e7 20 5a  |....  ....3  . Z|
000037c0  6f 6e 65 42 69 74 25 3e  44 65 66 65 63 74 53 74  |oneBit%>DefectSt|
000037d0  61 72 74 25 20 f1 20 22  50 52 4f 47 52 41 4d 20  |art% . "PROGRAM |
000037e0  45 52 52 4f 52 20 31 22  3a e0 0d 15 18 42 20 20  |ERROR 1":....B  |
000037f0  e7 20 44 65 66 65 63 74  53 74 61 72 74 25 2d 5a  |. DefectStart%-Z|
00003800  6f 6e 65 42 69 74 25 20  3c 3d 20 4c 69 6e 6b 42  |oneBit% <= LinkB|
00003810  69 74 73 25 20 8c 20 44  65 66 65 63 74 53 74 61  |its% . DefectSta|
00003820  72 74 25 3d 5a 6f 6e 65  42 69 74 25 0d 15 22 1f  |rt%=ZoneBit%..".|
00003830  20 20 e7 20 44 65 66 65  63 74 53 74 61 72 74 25  |  . DefectStart%|
00003840  3e 5a 6f 6e 65 42 69 74  25 20 8c 0d 15 2c 2d 20  |>ZoneBit% ...,- |
00003850  20 20 f2 57 72 69 74 65  4c 69 6e 6b 28 50 72 65  |  .WriteLink(Pre|
00003860  46 72 65 65 25 2c 5a 6f  6e 65 42 69 74 25 2d 50  |Free%,ZoneBit%-P|
00003870  72 65 46 72 65 65 25 29  0d 15 36 28 20 20 20 e7  |reFree%)..6(   .|
00003880  20 44 65 66 65 63 74 53  74 61 72 74 25 3e 3d 55  | DefectStart%>=U|
00003890  73 65 64 5a 6f 6e 65 45  6e 64 42 69 74 25 20 8c  |sedZoneEndBit% .|
000038a0  0d 15 40 37 20 20 20 20  f2 57 72 69 74 65 4c 65  |..@7    .WriteLe|
000038b0  6e 67 74 68 28 5a 6f 6e  65 42 69 74 25 2c 55 73  |ngth(ZoneBit%,Us|
000038c0  65 64 5a 6f 6e 65 45 6e  64 42 69 74 25 2d 5a 6f  |edZoneEndBit%-Zo|
000038d0  6e 65 42 69 74 25 29 0d  15 4a 27 20 20 20 20 e7  |neBit%)..J'    .|
000038e0  20 5a 6f 6e 65 45 6e 64  42 69 74 25 3e 55 73 65  | ZoneEndBit%>Use|
000038f0  64 5a 6f 6e 65 45 6e 64  42 69 74 25 20 8c 0d 15  |dZoneEndBit% ...|
00003900  54 26 20 20 20 20 20 f2  57 72 69 74 65 4c 69 6e  |T&     .WriteLin|
00003910  6b 28 55 73 65 64 5a 6f  6e 65 45 6e 64 42 69 74  |k(UsedZoneEndBit|
00003920  25 2c 31 29 0d 15 5e 42  20 20 20 20 20 f2 57 72  |%,1)..^B     .Wr|
00003930  69 74 65 4c 65 6e 67 74  68 28 55 73 65 64 5a 6f  |iteLength(UsedZo|
00003940  6e 65 45 6e 64 42 69 74  25 2c 5a 6f 6e 65 45 6e  |neEndBit%,ZoneEn|
00003950  64 42 69 74 25 2d 55 73  65 64 5a 6f 6e 65 45 6e  |dBit%-UsedZoneEn|
00003960  64 42 69 74 25 29 0d 15  68 09 20 20 20 20 cd 0d  |dBit%)..h.    ..|
00003970  15 72 08 20 20 20 cc 0d  15 7c 34 20 20 20 20 f2  |.r.   ...|4    .|
00003980  57 72 69 74 65 4c 65 6e  67 74 68 28 5a 6f 6e 65  |WriteLength(Zone|
00003990  42 69 74 25 2c 44 65 66  65 63 74 53 74 61 72 74  |Bit%,DefectStart|
000039a0  25 2d 5a 6f 6e 65 42 69  74 25 29 0d 15 86 08 20  |%-ZoneBit%).... |
000039b0  20 20 cd 0d 15 90 17 20  20 50 72 65 46 72 65 65  |  .....  PreFree|
000039c0  25 3d 5a 6f 6e 65 42 69  74 25 0d 15 9a 07 20 20  |%=ZoneBit%....  |
000039d0  cd 0d 15 a4 22 20 20 e7  20 44 65 66 65 63 74 53  |...."  . DefectS|
000039e0  74 61 72 74 25 3c 5a 6f  6e 65 45 6e 64 42 69 74  |tart%<ZoneEndBit|
000039f0  25 20 8c 0d 15 ae 33 20  20 20 e7 20 44 65 66 65  |% ....3   . Defe|
00003a00  63 74 45 6e 64 25 3e 55  73 65 64 5a 6f 6e 65 45  |ctEnd%>UsedZoneE|
00003a10  6e 64 42 69 74 25 2d 28  4c 69 6e 6b 42 69 74 73  |ndBit%-(LinkBits|
00003a20  25 2b 31 29 20 8c 0d 15  b8 1e 20 20 20 20 44 65  |%+1) .....    De|
00003a30  66 65 63 74 45 6e 64 25  3d 5a 6f 6e 65 45 6e 64  |fectEnd%=ZoneEnd|
00003a40  42 69 74 25 0d 15 c2 08  20 20 20 cd 0d 15 cc 21  |Bit%....   ....!|
00003a50  20 20 20 f2 57 72 69 74  65 4c 69 6e 6b 28 44 65  |   .WriteLink(De|
00003a60  66 65 63 74 53 74 61 72  74 25 2c 31 29 0d 15 d6  |fectStart%,1)...|
00003a70  39 20 20 20 f2 57 72 69  74 65 4c 65 6e 67 74 68  |9   .WriteLength|
00003a80  28 44 65 66 65 63 74 53  74 61 72 74 25 2c 44 65  |(DefectStart%,De|
00003a90  66 65 63 74 45 6e 64 25  2d 44 65 66 65 63 74 53  |fectEnd%-DefectS|
00003aa0  74 61 72 74 25 29 0d 15  e0 1a 20 20 20 5a 6f 6e  |tart%)....   Zon|
00003ab0  65 42 69 74 25 3d 44 65  66 65 63 74 45 6e 64 25  |eBit%=DefectEnd%|
00003ac0  0d 15 ea 07 20 20 cc 0d  15 f4 1b 20 20 20 5a 6f  |....  .....   Zo|
00003ad0  6e 65 42 69 74 25 3d 5a  6f 6e 65 45 6e 64 42 69  |neBit%=ZoneEndBi|
00003ae0  74 25 0d 15 fe 07 20 20  cd 0d 16 08 1b 20 fd 20  |t%....  ..... . |
00003af0  5a 6f 6e 65 42 69 74 25  3d 5a 6f 6e 65 45 6e 64  |ZoneBit%=ZoneEnd|
00003b00  42 69 74 25 0d 16 12 1b  20 f2 57 72 69 74 65 4c  |Bit%.... .WriteL|
00003b10  69 6e 6b 28 50 72 65 46  72 65 65 25 2c 30 29 0d  |ink(PreFree%,0).|
00003b20  16 1c 10 20 e7 20 7a 6f  6e 65 25 3d 30 20 8c 0d  |... . zone%=0 ..|
00003b30  16 26 20 20 20 5a 6f 6e  65 53 74 61 72 74 25 3f  |.&   ZoneStart%?|
00003b40  43 72 6f 73 73 43 68 65  63 6b 25 3d 26 46 46 0d  |CrossCheck%=&FF.|
00003b50  16 30 06 20 cc 0d 16 3a  1e 20 20 5a 6f 6e 65 53  |.0. ...:.  ZoneS|
00003b60  74 61 72 74 25 3f 43 72  6f 73 73 43 68 65 63 6b  |tart%?CrossCheck|
00003b70  25 3d 30 0d 16 44 06 20  cd 0d 16 4e 32 20 3f 5a  |%=0..D. ...N2 ?Z|
00003b80  6f 6e 65 53 74 61 72 74  25 3d a4 4e 65 77 4d 61  |oneStart%=.NewMa|
00003b90  70 43 68 65 63 6b 28 5a  6f 6e 65 53 74 61 72 74  |pCheck(ZoneStart|
00003ba0  25 2c 53 65 63 53 69 7a  65 25 29 0d 16 58 23 20  |%,SecSize%)..X# |
00003bb0  5a 6f 6e 65 53 74 61 72  74 25 3d 5a 6f 6e 65 53  |ZoneStart%=ZoneS|
00003bc0  74 61 72 74 25 2b 53 65  63 53 69 7a 65 25 0d 16  |tart%+SecSize%..|
00003bd0  62 1e 20 5a 6f 6e 65 53  74 61 72 74 42 69 74 25  |b. ZoneStartBit%|
00003be0  3d 5a 6f 6e 65 45 6e 64  42 69 74 25 0d 16 6c 0b  |=ZoneEndBit%..l.|
00003bf0  ed 20 7a 6f 6e 65 25 0d  16 76 13 f1 20 22 57 72  |. zone%..v.. "Wr|
00003c00  69 74 69 6e 67 20 6d 61  70 22 0d 16 80 28 f2 4d  |iting map"...(.M|
00003c10  6f 61 6e 4f 70 28 57 72  69 74 65 25 2c 4d 61 70  |oanOp(Write%,Map|
00003c20  41 64 64 25 2c 42 75 66  25 2c 4d 61 70 4c 65 6e  |Add%,Buf%,MapLen|
00003c30  25 29 0d 16 8a 30 f2 4d  6f 61 6e 4f 70 28 57 72  |%)...0.MoanOp(Wr|
00003c40  69 74 65 25 2c 4d 61 70  41 64 64 25 2b 4d 61 70  |ite%,MapAdd%+Map|
00003c50  4c 65 6e 25 2c 42 75 66  25 2c 4d 61 70 4c 65 6e  |Len%,Buf%,MapLen|
00003c60  25 29 0d 16 94 11 f2 57  72 69 74 65 52 6f 6f 74  |%).....WriteRoot|
00003c70  44 69 72 0d 16 9e 05 e1  0d 16 a8 05 3a 0d 16 b2  |Dir.........:...|
00003c80  10 dd 20 f2 43 61 6c 63  5a 6f 6e 65 73 0d 16 bc  |.. .CalcZones...|
00003c90  23 55 73 65 64 42 69 74  73 25 3d 53 65 63 53 69  |#UsedBits%=SecSi|
00003ca0  7a 65 25 2a 38 2d 53 70  61 72 65 42 69 74 73 25  |ze%*8-SpareBits%|
00003cb0  0d 16 c6 31 57 68 6f 6c  65 5a 6f 6e 65 73 25 3d  |...1WholeZones%=|
00003cc0  28 4d 61 70 42 69 74 73  25 2b 5a 6f 6e 65 30 42  |(MapBits%+Zone0B|
00003cd0  69 74 73 25 29 20 81 20  55 73 65 64 42 69 74 73  |its%) . UsedBits|
00003ce0  25 0d 16 d0 2e 4f 64 64  42 69 74 73 25 3d 28 4d  |%....OddBits%=(M|
00003cf0  61 70 42 69 74 73 25 2b  5a 6f 6e 65 30 42 69 74  |apBits%+Zone0Bit|
00003d00  73 25 29 20 83 20 55 73  65 64 42 69 74 73 25 0d  |s%) . UsedBits%.|
00003d10  16 da 38 e7 20 4f 64 64  42 69 74 73 25 20 5a 6f  |..8. OddBits% Zo|
00003d20  6e 65 73 25 3d 57 68 6f  6c 65 5a 6f 6e 65 73 25  |nes%=WholeZones%|
00003d30  2b 31 20 8b 20 5a 6f 6e  65 73 25 3d 57 68 6f 6c  |+1 . Zones%=Whol|
00003d40  65 5a 6f 6e 65 73 25 0d  16 e4 17 4d 61 70 5a 6f  |eZones%....MapZo|
00003d50  6e 65 25 3d 5a 6f 6e 65  73 25 20 81 20 32 0d 16  |ne%=Zones% . 2..|
00003d60  ee 12 e7 20 4d 61 70 5a  6f 6e 65 25 3d 30 20 8c  |... MapZone%=0 .|
00003d70  0d 16 f8 0e 20 4d 61 70  41 64 64 25 3d 30 0d 17  |.... MapAdd%=0..|
00003d80  02 05 cc 0d 17 0c 33 20  4d 61 70 41 64 64 25 3d  |......3 MapAdd%=|
00003d90  28 55 73 65 64 42 69 74  73 25 2a 4d 61 70 5a 6f  |(UsedBits%*MapZo|
00003da0  6e 65 25 2d 5a 6f 6e 65  30 42 69 74 73 25 29 2a  |ne%-Zone0Bits%)*|
00003db0  41 6c 6c 6f 63 25 0d 17  16 05 cd 0d 17 20 1b 4d  |Alloc%....... .M|
00003dc0  61 70 4c 65 6e 25 3d 5a  6f 6e 65 73 25 2a 53 65  |apLen%=Zones%*Se|
00003dd0  63 53 69 7a 65 25 0d 17  2a 05 e1 0d 17 34 05 3a  |cSize%..*....4.:|
00003de0  0d 17 3e 0e dd 20 f2 43  61 6c 63 49 64 73 0d 17  |..>.. .CalcIds..|
00003df0  48 29 49 64 73 50 65 72  5a 6f 6e 65 25 3d 55 73  |H)IdsPerZone%=Us|
00003e00  65 64 42 69 74 73 25 20  81 20 28 4c 69 6e 6b 42  |edBits% . (LinkB|
00003e10  69 74 73 25 2b 31 29 0d  17 52 3d 49 64 73 25 3d  |its%+1)..R=Ids%=|
00003e20  49 64 73 50 65 72 5a 6f  6e 65 25 20 2a 20 57 68  |IdsPerZone% * Wh|
00003e30  6f 6c 65 5a 6f 6e 65 73  25 20 2b 20 4f 64 64 42  |oleZones% + OddB|
00003e40  69 74 73 25 20 81 20 28  4c 69 6e 6b 42 69 74 73  |its% . (LinkBits|
00003e50  25 2b 31 29 0d 17 5c 05  e1 0d 17 66 05 3a 0d 17  |%+1)..\....f.:..|
00003e60  70 1a dd 20 a4 44 69 73  63 54 6f 4d 61 70 28 64  |p.. .DiscToMap(d|
00003e70  69 73 63 61 64 64 25 29  0d 17 7a 10 ea 20 62 69  |iscadd%)..z.. bi|
00003e80  74 25 2c 7a 6f 6e 65 25  0d 17 84 27 62 69 74 25  |t%,zone%...'bit%|
00003e90  3d 28 64 69 73 63 61 64  64 25 20 81 20 41 6c 6c  |=(discadd% . All|
00003ea0  6f 63 25 29 2b 5a 6f 6e  65 30 42 69 74 73 25 0d  |oc%)+Zone0Bits%.|
00003eb0  17 8e 1a 7a 6f 6e 65 25  3d 62 69 74 25 20 81 20  |...zone%=bit% . |
00003ec0  55 73 65 64 42 69 74 73  25 0d 17 98 2f 62 69 74  |UsedBits%.../bit|
00003ed0  25 3d 62 69 74 25 2b 28  62 69 74 25 20 81 20 55  |%=bit%+(bit% . U|
00003ee0  73 65 64 42 69 74 73 25  29 2a 53 70 61 72 65 42  |sedBits%)*SpareB|
00003ef0  69 74 73 25 2b 34 2a 38  0d 17 a2 0a 3d 20 62 69  |its%+4*8....= bi|
00003f00  74 25 0d 17 ac 05 3a 0d  17 b6 1c dd 20 f2 57 72  |t%....:..... .Wr|
00003f10  69 74 65 4c 69 6e 6b 28  6f 66 66 25 2c 6c 69 6e  |iteLink(off%,lin|
00003f20  6b 25 29 0d 17 c0 2e e7  20 6c 69 6e 6b 25 3e 3d  |k%)..... link%>=|
00003f30  32 5e 4c 69 6e 6b 42 69  74 73 25 20 f1 20 22 50  |2^LinkBits% . "P|
00003f40  52 4f 47 52 41 4d 20 45  52 52 4f 52 20 32 22 3a  |ROGRAM ERROR 2":|
00003f50  e0 0d 17 ca 15 ea 20 62  69 74 25 2c 61 64 64 25  |...... bit%,add%|
00003f60  2c 6d 61 73 6b 25 0d 17  d4 11 62 69 74 25 3d 6f  |,mask%....bit%=o|
00003f70  66 66 25 20 83 20 38 0d  17 de 16 61 64 64 25 3d  |ff% . 8....add%=|
00003f80  42 75 66 25 2b 6f 66 66  25 20 81 20 38 0d 17 e8  |Buf%+off% . 8...|
00003f90  17 6d 61 73 6b 25 3d 32  5e 4c 69 6e 6b 42 69 74  |.mask%=2^LinkBit|
00003fa0  73 25 2d 31 0d 17 f2 31  21 61 64 64 25 3d 28 21  |s%-1...1!add%=(!|
00003fb0  61 64 64 25 20 80 20 ac  20 28 6d 61 73 6b 25 3c  |add% . . (mask%<|
00003fc0  3c 62 69 74 25 29 29 20  84 20 6c 69 6e 6b 25 3c  |<bit%)) . link%<|
00003fd0  3c 62 69 74 25 0d 17 fc  05 e1 0d 18 06 05 3a 0d  |<bit%.........:.|
00003fe0  18 10 1d dd 20 f2 57 72  69 74 65 4c 65 6e 67 74  |.... .WriteLengt|
00003ff0  68 28 6f 66 66 25 2c 6c  65 6e 25 29 0d 18 1a 2b  |h(off%,len%)...+|
00004000  e7 20 6c 65 6e 25 3c 3d  4c 69 6e 6b 42 69 74 73  |. len%<=LinkBits|
00004010  25 20 f1 20 22 50 52 4f  47 52 41 4d 20 45 52 52  |% . "PROGRAM ERR|
00004020  4f 52 20 33 22 3a e0 0d  18 24 14 6f 66 66 25 3d  |OR 3":...$.off%=|
00004030  6f 66 66 25 2b 6c 65 6e  25 2d 31 0d 18 2e 1d 42  |off%+len%-1....B|
00004040  75 66 25 3f 28 6f 66 66  25 81 38 29 2b 3d 32 5e  |uf%?(off%.8)+=2^|
00004050  28 6f 66 66 25 83 38 29  0d 18 38 05 e1 0d 18 42  |(off%.8)..8....B|
00004060  05 3a 0d 18 4c 16 dd 20  f2 57 72 69 74 65 44 65  |.:..L.. .WriteDe|
00004070  66 65 63 74 4c 69 73 74  0d 18 56 1b f1 20 22 57  |fectList..V.. "W|
00004080  72 69 74 69 6e 67 20 64  65 66 65 63 74 20 6c 69  |riting defect li|
00004090  73 74 22 0d 18 60 0a 70  74 72 25 3d 30 0d 18 6a  |st"..`.ptr%=0..j|
000040a0  0c 63 68 65 63 6b 25 3d  30 0d 18 74 1e c8 95 20  |.check%=0..t... |
000040b0  44 65 66 65 63 74 25 21  70 74 72 25 3c 45 6e 64  |Defect%!ptr%<End|
000040c0  44 65 66 65 63 74 25 0d  18 7e 1c 20 42 6f 6f 74  |Defect%..~. Boot|
000040d0  25 21 70 74 72 25 3d 44  65 66 65 63 74 25 21 70  |%!ptr%=Defect%!p|
000040e0  74 72 25 0d 18 88 1a 20  f2 43 68 65 63 6b 50 75  |tr%.... .CheckPu|
000040f0  74 28 42 6f 6f 74 25 21  70 74 72 25 29 0d 18 92  |t(Boot%!ptr%)...|
00004100  10 20 70 74 72 25 3d 70  74 72 25 2b 34 0d 18 9c  |. ptr%=ptr%+4...|
00004110  05 ce 0d 18 a6 21 63 68  65 63 6b 25 3d 63 68 65  |.....!check%=che|
00004120  63 6b 25 20 82 20 28 63  68 65 63 6b 25 3e 3e 3e  |ck% . (check%>>>|
00004130  31 36 29 0d 18 b0 27 63  68 65 63 6b 25 3d 28 63  |16)...'check%=(c|
00004140  68 65 63 6b 25 20 82 20  28 63 68 65 63 6b 25 3e  |heck% . (check%>|
00004150  3e 3e 38 29 29 80 20 26  46 46 0d 18 ba 22 42 6f  |>>8)). &FF..."Bo|
00004160  6f 74 25 21 70 74 72 25  3d 45 6e 64 44 65 66 65  |ot%!ptr%=EndDefe|
00004170  63 74 25 20 84 20 63 68  65 63 6b 25 0d 18 c4 19  |ct% . check%....|
00004180  f2 53 75 6d 28 42 6f 6f  74 25 2c 42 6f 6f 74 53  |.Sum(Boot%,BootS|
00004190  69 7a 65 25 29 0d 18 ce  2c f2 4d 6f 61 6e 4f 70  |ize%)...,.MoanOp|
000041a0  28 57 72 69 74 65 25 2c  42 6f 6f 74 41 64 64 25  |(Write%,BootAdd%|
000041b0  2c 42 6f 6f 74 25 2c 42  6f 6f 74 53 69 7a 65 25  |,Boot%,BootSize%|
000041c0  29 0d 18 d8 05 e1 0d 18  e2 05 3a 0d 18 ec 14 dd  |).........:.....|
000041d0  20 f2 57 72 69 74 65 4f  6c 64 46 73 4d 61 70 0d  | .WriteOldFsMap.|
000041e0  18 f6 1e f1 20 22 57 72  69 74 69 6e 67 20 66 72  |.... "Writing fr|
000041f0  65 65 20 73 70 61 63 65  20 6d 61 70 22 0d 19 00  |ee space map"...|
00004200  0b ea 20 73 25 2c 49 25  0d 19 0a 16 73 25 3d 4f  |.. s%,I%....s%=O|
00004210  6c 64 4d 61 70 53 69 7a  65 25 20 81 20 32 0d 19  |ldMapSize% . 2..|
00004220  14 2a e3 20 49 25 3d 30  20 b8 20 4f 6c 64 4d 61  |.*. I%=0 . OldMa|
00004230  70 53 69 7a 65 25 2d 34  20 88 20 34 3a 42 75 66  |pSize%-4 . 4:Buf|
00004240  25 21 49 25 3d 30 3a ed  0d 19 1e 18 21 42 75 66  |%!I%=0:.....!Buf|
00004250  25 3d 4f 6c 64 4c 57 4d  25 20 81 20 26 31 30 30  |%=OldLWM% . &100|
00004260  0d 19 28 38 42 75 66 25  21 73 25 3d 28 44 69 73  |..(8Buf%!s%=(Dis|
00004270  63 53 69 7a 65 25 2d 4f  6c 64 4c 57 4d 25 2d 44  |cSize%-OldLWM%-D|
00004280  65 66 65 63 74 73 25 2a  53 65 63 53 69 7a 65 25  |efects%*SecSize%|
00004290  29 20 81 20 26 31 30 30  0d 19 32 21 21 28 42 75  |) . &100..2!!(Bu|
000042a0  66 25 2b 73 25 2d 34 29  3d 44 69 73 63 53 69 7a  |f%+s%-4)=DiscSiz|
000042b0  65 25 20 81 20 26 31 30  30 0d 19 3c 25 21 28 42  |e% . &100..<%!(B|
000042c0  75 66 25 2b 4f 6c 64 4d  61 70 53 69 7a 65 25 2d  |uf%+OldMapSize%-|
000042d0  35 29 3d b3 28 26 31 30  30 30 30 29 2d 31 0d 19  |5)=.(&10000)-1..|
000042e0  46 1b 21 28 42 75 66 25  2b 4f 6c 64 4d 61 70 53  |F.!(Buf%+OldMapS|
000042f0  69 7a 65 25 2d 32 29 3d  33 0d 19 50 11 f2 53 75  |ize%-2)=3..P..Su|
00004300  6d 28 42 75 66 25 2c 73  25 29 0d 19 5a 14 f2 53  |m(Buf%,s%)..Z..S|
00004310  75 6d 28 42 75 66 25 2b  73 25 2c 73 25 29 0d 19  |um(Buf%+s%,s%)..|
00004320  64 2f f2 4d 6f 61 6e 4f  70 28 57 72 69 74 65 25  |d/.MoanOp(Write%|
00004330  2c 4f 6c 64 4d 61 70 41  64 64 25 2c 42 75 66 25  |,OldMapAdd%,Buf%|
00004340  2c 4f 6c 64 4d 61 70 53  69 7a 65 25 29 0d 19 6e  |,OldMapSize%)..n|
00004350  05 e1 0d 19 78 05 3a 0d  19 82 13 dd 20 f2 57 72  |....x.:..... .Wr|
00004360  69 74 65 52 6f 6f 74 44  69 72 0d 19 8c 1e f1 20  |iteRootDir..... |
00004370  22 57 72 69 74 69 6e 67  20 72 6f 6f 74 20 64 69  |"Writing root di|
00004380  72 65 63 74 6f 72 79 22  0d 19 96 09 ea 20 42 46  |rectory"..... BF|
00004390  25 0d 19 a0 27 e3 20 49  25 3d 30 20 b8 20 44 69  |%...'. I%=0 . Di|
000043a0  72 53 69 7a 65 25 2d 34  20 88 20 34 3a 42 75 66  |rSize%-4 . 4:Buf|
000043b0  25 21 49 25 3d 30 3a ed  0d 19 aa 0f e7 20 4e 65  |%!I%=0:...... Ne|
000043c0  77 4d 61 70 25 20 8c 0d  19 b4 15 20 24 44 69 72  |wMap% ..... $Dir|
000043d0  4d 61 72 6b 25 3d 22 48  75 67 6f 22 0d 19 be 05  |Mark%="Hugo"....|
000043e0  cc 0d 19 c8 15 20 24 44  69 72 4d 61 72 6b 25 3d  |..... $DirMark%=|
000043f0  22 48 75 67 6f 22 0d 19  d2 05 cd 0d 19 dc 14 42  |"Hugo".........B|
00004400  75 66 25 21 31 3d 21 44  69 72 4d 61 72 6b 25 0d  |uf%!1=!DirMark%.|
00004410  19 e6 15 42 46 25 3d 42  75 66 25 2b 44 69 72 53  |...BF%=Buf%+DirS|
00004420  69 7a 65 25 0d 19 f0 0f  e7 20 4e 65 77 4d 61 70  |ize%..... NewMap|
00004430  25 20 8c 0d 19 fa 1b 20  42 46 25 21 2d 33 38 3d  |% ..... BF%!-38=|
00004440  49 6e 64 52 6f 6f 74 44  69 72 41 64 64 25 0d 1a  |IndRootDirAdd%..|
00004450  04 05 cc 0d 1a 0e 22 20  42 46 25 21 2d 33 38 3d  |......" BF%!-38=|
00004460  49 6e 64 52 6f 6f 74 44  69 72 41 64 64 25 20 81  |IndRootDirAdd% .|
00004470  20 26 31 30 30 0d 1a 18  05 cd 0d 1a 22 10 42 46  | &100.......".BF|
00004480  25 3f 2d 33 35 3d 97 22  24 22 0d 1a 2c 10 42 46  |%?-35=."$"..,.BF|
00004490  25 3f 2d 31 36 3d 97 22  24 22 0d 1a 36 14 42 46  |%?-16=."$"..6.BF|
000044a0  25 21 2d 35 3d 21 44 69  72 4d 61 72 6b 25 0d 1a  |%!-5=!DirMark%..|
000044b0  40 0c 63 68 65 63 6b 25  3d 30 0d 1a 4a 14 f2 43  |@.check%=0..J..C|
000044c0  68 65 63 6b 50 75 74 28  21 42 75 66 25 29 0d 1a  |heckPut(!Buf%)..|
000044d0  54 15 f2 43 68 65 63 6b  50 75 74 28 42 75 66 25  |T..CheckPut(Buf%|
000044e0  3f 34 29 0d 1a 5e 0d 49  25 3d 42 46 25 2d 34 30  |?4)..^.I%=BF%-40|
000044f0  0d 1a 68 0b c8 95 20 49  25 80 33 0d 1a 72 13 20  |..h... I%.3..r. |
00004500  f2 43 68 65 63 6b 50 75  74 28 3f 49 25 29 0d 1a  |.CheckPut(?I%)..|
00004510  7c 0c 20 49 25 3d 49 25  2b 31 0d 1a 86 05 ce 0d  ||. I%=I%+1......|
00004520  1a 90 0f c8 95 20 49 25  3c 42 46 25 2d 34 0d 1a  |..... I%<BF%-4..|
00004530  9a 13 20 f2 43 68 65 63  6b 50 75 74 28 21 49 25  |.. .CheckPut(!I%|
00004540  29 0d 1a a4 0c 20 49 25  3d 49 25 2b 34 0d 1a ae  |).... I%=I%+4...|
00004550  05 ce 0d 1a b8 21 63 68  65 63 6b 25 3d 63 68 65  |.....!check%=che|
00004560  63 6b 25 20 82 20 28 63  68 65 63 6b 25 3e 3e 3e  |ck% . (check%>>>|
00004570  31 36 29 0d 1a c2 27 63  68 65 63 6b 25 3d 28 63  |16)...'check%=(c|
00004580  68 65 63 6b 25 20 82 20  28 63 68 65 63 6b 25 3e  |heck% . (check%>|
00004590  3e 3e 38 29 29 80 20 26  46 46 0d 1a cc 11 42 46  |>>8)). &FF....BF|
000045a0  25 3f 2d 31 3d 63 68 65  63 6b 25 0d 1a d6 2d f2  |%?-1=check%...-.|
000045b0  4d 6f 61 6e 4f 70 28 57  72 69 74 65 25 2c 52 6f  |MoanOp(Write%,Ro|
000045c0  6f 74 44 69 72 41 64 64  25 2c 42 75 66 25 2c 44  |otDirAdd%,Buf%,D|
000045d0  69 72 53 69 7a 65 25 29  0d 1a e0 05 e1 0d 1a ea  |irSize%)........|
000045e0  05 3a 0d 1a f4 16 dd 20  a4 4c 6f 67 54 6f 50 68  |.:..... .LogToPh|
000045f0  79 73 28 61 64 64 25 29  0d 1a fe 0a ea 20 70 74  |ys(add%)..... pt|
00004600  72 25 0d 1b 08 0a 70 74  72 25 3d 30 0d 1b 12 19  |r%....ptr%=0....|
00004610  c8 95 20 61 64 64 25 3e  3d 44 65 66 65 63 74 25  |.. add%>=Defect%|
00004620  21 70 74 72 25 0d 1b 1c  10 20 70 74 72 25 3d 70  |!ptr%.... ptr%=p|
00004630  74 72 25 2b 34 0d 1b 26  17 20 61 64 64 25 3d 61  |tr%+4..&. add%=a|
00004640  64 64 25 2b 53 65 63 53  69 7a 65 25 0d 1b 30 05  |dd%+SecSize%..0.|
00004650  ce 0d 1b 3a 09 3d 61 64  64 25 0d 1b 44 05 3a 0d  |...:.=add%..D.:.|
00004660  1b 4e 1a dd 20 f2 41 64  64 50 68 79 73 44 65 66  |.N.. .AddPhysDef|
00004670  65 63 74 28 61 64 64 25  29 0d 1b 58 18 ea 20 70  |ect(add%)..X.. p|
00004680  74 72 25 2c 70 74 72 32  25 2c 64 65 66 65 63 74  |tr%,ptr2%,defect|
00004690  25 0d 1b 62 1c e7 20 44  65 66 65 63 74 73 25 3c  |%..b.. Defects%<|
000046a0  4d 61 78 44 65 66 65 63  74 73 25 20 8c 0d 1b 6c  |MaxDefects% ...l|
000046b0  19 20 c8 95 20 44 65 66  65 63 74 25 21 70 74 72  |. .. Defect%!ptr|
000046c0  25 3c 61 64 64 25 0d 1b  76 11 20 20 70 74 72 25  |%<add%..v.  ptr%|
000046d0  3d 70 74 72 25 2b 34 0d  1b 80 06 20 ce 0d 1b 8a  |=ptr%+4.... ....|
000046e0  19 20 64 65 66 65 63 74  25 3d 44 65 66 65 63 74  |. defect%=Defect|
000046f0  25 21 70 74 72 25 0d 1b  94 15 20 e7 20 64 65 66  |%!ptr%.... . def|
00004700  65 63 74 25 3d 61 64 64  25 20 8c 0d 1b 9e 27 20  |ect%=add% ....' |
00004710  20 f1 20 22 44 65 66 65  63 74 20 61 6c 72 65 61  | . "Defect alrea|
00004720  64 79 20 69 6e 20 64 65  66 65 63 74 20 6c 69 73  |dy in defect lis|
00004730  74 22 0d 1b a8 06 20 cc  0d 1b b2 16 20 20 70 74  |t".... .....  pt|
00004740  72 32 25 3d 44 65 66 65  63 74 73 25 2a 34 0d 1b  |r2%=Defects%*4..|
00004750  bc 14 20 20 c8 95 20 70  74 72 32 25 3e 3d 70 74  |..  .. ptr2%>=pt|
00004760  72 25 0d 1b c6 26 20 20  20 44 65 66 65 63 74 25  |r%...&   Defect%|
00004770  21 28 70 74 72 32 25 2b  34 29 3d 44 65 66 65 63  |!(ptr2%+4)=Defec|
00004780  74 25 21 70 74 72 32 25  0d 1b d0 14 20 20 20 70  |t%!ptr2%....   p|
00004790  74 72 32 25 3d 70 74 72  32 25 2d 34 0d 1b da 07  |tr2%=ptr2%-4....|
000047a0  20 20 ce 0d 1b e4 17 20  20 44 65 66 65 63 74 25  |  .....  Defect%|
000047b0  21 70 74 72 25 3d 61 64  64 25 0d 1b ee 19 20 20  |!ptr%=add%....  |
000047c0  44 65 66 65 63 74 73 25  3d 44 65 66 65 63 74 73  |Defects%=Defects|
000047d0  25 2b 31 0d 1b f8 06 20  cd 0d 1c 02 05 cc 0d 1c  |%+1.... ........|
000047e0  0c 19 20 f1 20 22 44 65  66 65 63 74 20 6c 69 73  |.. . "Defect lis|
000047f0  74 20 66 75 6c 6c 22 0d  1c 16 05 cd 0d 1c 20 05  |t full"....... .|
00004800  e1 0d 1c 2a 05 3a 0d 1c  34 1d dd 20 f2 52 65 6d  |...*.:..4.. .Rem|
00004810  6f 76 65 50 68 79 73 44  65 66 65 63 74 28 61 64  |ovePhysDefect(ad|
00004820  64 25 29 0d 1c 3e 18 ea  20 70 74 72 25 2c 70 74  |d%)..>.. ptr%,pt|
00004830  72 32 25 2c 64 65 66 65  63 74 25 0d 1c 48 18 c8  |r2%,defect%..H..|
00004840  95 20 44 65 66 65 63 74  25 21 70 74 72 25 3c 61  |. Defect%!ptr%<a|
00004850  64 64 25 0d 1c 52 10 20  70 74 72 25 3d 70 74 72  |dd%..R. ptr%=ptr|
00004860  25 2b 34 0d 1c 5c 05 ce  0d 1c 66 18 64 65 66 65  |%+4..\....f.defe|
00004870  63 74 25 3d 44 65 66 65  63 74 25 21 70 74 72 25  |ct%=Defect%!ptr%|
00004880  0d 1c 70 14 e7 20 64 65  66 65 63 74 25 3d 61 64  |..p.. defect%=ad|
00004890  64 25 20 8c 0d 1c 7a 17  20 c8 95 20 70 74 72 25  |d% ...z. .. ptr%|
000048a0  3c 44 65 66 65 63 74 73  25 2a 34 0d 1c 84 23 20  |<Defects%*4...# |
000048b0  20 44 65 66 65 63 74 25  21 70 74 72 25 3d 44 65  | Defect%!ptr%=De|
000048c0  66 65 63 74 25 21 28 70  74 72 25 2b 34 29 0d 1c  |fect%!(ptr%+4)..|
000048d0  8e 11 20 20 70 74 72 25  3d 70 74 72 25 2b 34 0d  |..  ptr%=ptr%+4.|
000048e0  1c 98 06 20 ce 0d 1c a2  18 20 44 65 66 65 63 74  |... ..... Defect|
000048f0  73 25 3d 44 65 66 65 63  74 73 25 2d 31 0d 1c ac  |s%=Defects%-1...|
00004900  05 cc 0d 1c b6 22 20 f1  20 22 44 65 66 65 63 74  |....." . "Defect|
00004910  20 6e 6f 74 20 69 6e 20  64 65 66 65 63 74 20 6c  | not in defect l|
00004920  69 73 74 22 0d 1c c0 05  cd 0d 1c ca 05 e1 0d 1c  |ist"............|
00004930  d4 05 3a 0d 1c de 12 dd  20 a4 47 6f 6f 64 44 65  |..:..... .GoodDe|
00004940  66 65 63 74 73 0d 1c e8  0b 70 74 72 25 3d 2d 34  |fects....ptr%=-4|
00004950  0d 1c f2 0c 63 68 65 63  6b 25 3d 30 0d 1c fc 0c  |....check%=0....|
00004960  6c 61 73 74 25 3d 2d 31  0d 1d 06 0b 67 6f 6f 64  |last%=-1....good|
00004970  25 3d b9 0d 1d 10 05 f5  0d 1d 1a 10 20 70 74 72  |%=.......... ptr|
00004980  25 3d 70 74 72 25 2b 34  0d 1d 24 17 20 64 65 66  |%=ptr%+4..$. def|
00004990  65 63 74 25 3d 42 6f 6f  74 25 21 70 74 72 25 0d  |ect%=Boot%!ptr%.|
000049a0  1d 2e 1d 20 e7 20 64 65  66 65 63 74 25 3c 3d 6c  |... . defect%<=l|
000049b0  61 73 74 25 20 67 6f 6f  64 25 3d a3 0d 1d 38 12  |ast% good%=...8.|
000049c0  20 6c 61 73 74 25 3d 64  65 66 65 63 74 25 0d 1d  | last%=defect%..|
000049d0  42 2c 20 e7 20 64 65 66  65 63 74 25 3c 45 6e 64  |B, . defect%<End|
000049e0  44 65 66 65 63 74 25 20  f2 43 68 65 63 6b 50 75  |Defect% .CheckPu|
000049f0  74 28 64 65 66 65 63 74  25 29 0d 1d 4c 27 fd 20  |t(defect%)..L'. |
00004a00  28 64 65 66 65 63 74 25  20 3e 3d 20 45 6e 64 44  |(defect% >= EndD|
00004a10  65 66 65 63 74 25 29 20  84 20 ac 20 67 6f 6f 64  |efect%) . . good|
00004a20  25 0d 1d 56 13 44 65 66  65 63 74 73 25 3d 70 74  |%..V.Defects%=pt|
00004a30  72 25 81 34 0d 1d 60 21  63 68 65 63 6b 25 3d 63  |r%.4..`!check%=c|
00004a40  68 65 63 6b 25 20 82 20  28 63 68 65 63 6b 25 3e  |heck% . (check%>|
00004a50  3e 3e 31 36 29 0d 1d 6a  27 63 68 65 63 6b 25 3d  |>>16)..j'check%=|
00004a60  28 63 68 65 63 6b 25 20  82 20 28 63 68 65 63 6b  |(check% . (check|
00004a70  25 3e 3e 3e 38 29 29 80  20 26 46 46 0d 1d 74 54  |%>>>8)). &FF..tT|
00004a80  3d 20 67 6f 6f 64 25 20  80 20 28 28 64 65 66 65  |= good% . ((defe|
00004a90  63 74 25 80 26 46 46 29  20 3d 20 63 68 65 63 6b  |ct%.&FF) = check|
00004aa0  25 29 20 80 20 28 a4 73  75 6d 28 42 6f 6f 74 25  |%) . (.sum(Boot%|
00004ab0  2c 42 6f 6f 74 53 69 7a  65 25 29 3d 42 6f 6f 74  |,BootSize%)=Boot|
00004ac0  25 3f 28 42 6f 6f 74 53  69 7a 65 25 2d 31 29 29  |%?(BootSize%-1))|
00004ad0  0d 1d 7e 05 3a 0d 1d 88  12 dd 20 f2 49 6e 69 74  |..~.:..... .Init|
00004ae0  44 69 73 63 52 65 63 0d  1d 92 15 e3 20 49 25 3d  |DiscRec..... I%=|
00004af0  30 20 b8 20 36 34 2d 34  20 88 20 34 0d 1d 9c 12  |0 . 64-4 . 4....|
00004b00  20 44 69 73 63 52 65 63  25 21 49 25 3d 30 0d 1d  | DiscRec%!I%=0..|
00004b10  a6 08 ed 20 49 25 0d 1d  b0 1a 3f 44 69 73 63 52  |... I%....?DiscR|
00004b20  65 63 25 3d 4c 6f 67 32  53 65 63 53 69 7a 65 25  |ec%=Log2SecSize%|
00004b30  0d 1d ba 1a 44 69 73 63  52 65 63 25 3f 31 3d 53  |....DiscRec%?1=S|
00004b40  65 63 73 50 65 72 54 72  6b 25 0d 1d c4 15 44 69  |ecsPerTrk%....Di|
00004b50  73 63 52 65 63 25 3f 32  3d 48 65 61 64 73 25 0d  |scRec%?2=Heads%.|
00004b60  1d ce 1e 44 69 73 63 52  65 63 25 21 26 43 3d 49  |...DiscRec%!&C=I|
00004b70  6e 64 52 6f 6f 74 44 69  72 41 64 64 25 0d 1d d8  |ndRootDirAdd%...|
00004b80  1a 44 69 73 63 52 65 63  25 21 26 31 30 3d 44 69  |.DiscRec%!&10=Di|
00004b90  73 63 53 69 7a 65 25 0d  1d e2 1c 44 69 73 63 52  |scSize%....DiscR|
00004ba0  65 63 25 21 26 31 34 3d  b3 28 26 31 30 30 30 30  |ec%!&14=.(&10000|
00004bb0  29 2d 31 0d 1d ec 26 24  28 44 69 73 63 52 65 63  |)-1...&$(DiscRec|
00004bc0  25 2b 26 31 36 29 3d 22  48 61 72 64 44 69 73 63  |%+&16)="HardDisc|
00004bd0  22 2b c3 44 72 69 76 65  25 0d 1d f6 17 44 69 73  |"+.Drive%....Dis|
00004be0  63 52 65 63 25 3f 26 32  32 3d 44 72 69 76 65 25  |cRec%?&22=Drive%|
00004bf0  0d 1e 00 05 e1 0d 1e 0a  05 3a 0d 1e 14 16 dd 20  |.........:..... |
00004c00  f2 49 6e 69 74 42 6f 6f  74 44 65 66 65 63 74 73  |.InitBootDefects|
00004c10  0d 1e 1e 15 21 42 6f 6f  74 25 3d 45 6e 64 44 65  |....!Boot%=EndDe|
00004c20  66 65 63 74 25 0d 1e 28  0e 44 65 66 65 63 74 73  |fect%..(.Defects|
00004c30  25 3d 30 0d 1e 32 11 f2  49 6e 69 74 48 61 72 64  |%=0..2..InitHard|
00004c40  44 65 73 63 0d 1e 3c 05  e1 0d 1e 46 05 3a 0d 1e  |Desc..<....F.:..|
00004c50  50 13 dd 20 f2 49 6e 69  74 48 61 72 64 44 65 73  |P.. .InitHardDes|
00004c60  63 0d 1e 5a 2e 42 6f 6f  74 52 65 63 25 21 2d 26  |c..Z.BootRec%!-&|
00004c70  31 30 3d 20 26 30 30 30  30 30 30 30 30 20 20 20  |10= &00000000   |
00004c80  20 20 20 3a f4 20 53 4c  20 78 78 78 78 78 78 0d  |   :. SL xxxxxx.|
00004c90  1e 64 36 42 6f 6f 74 52  65 63 25 21 2d 26 43 20  |.d6BootRec%!-&C |
00004ca0  3d 20 26 30 44 30 43 32  30 30 41 20 20 20 20 20  |= &0D0C200A     |
00004cb0  20 3a f4 20 47 50 4c 32  20 47 50 4c 33 20 53 48  | :. GPL2 GPL3 SH|
00004cc0  20 47 50 4c 31 0d 1e 6e  39 f4 20 42 6f 6f 74 52  | GPL1..n9. BootR|
00004cd0  65 63 25 21 2d 26 31 30  3d 20 26 31 36 30 30 30  |ec%!-&10= &16000|
00004ce0  30 30 30 20 20 73 6c 6f  77 20 73 74 65 70 70 69  |000  slow steppi|
00004cf0  6e 67 20 61 6c 74 65 72  6e 61 74 69 76 65 0d 1e  |ng alternative..|
00004d00  78 39 f4 20 42 6f 6f 74  52 65 63 25 21 2d 26 43  |x9. BootRec%!-&C|
00004d10  20 3d 20 26 30 44 30 43  41 38 30 41 20 20 73 6c  | = &0D0CA80A  sl|
00004d20  6f 77 20 73 74 65 70 70  69 6e 67 20 61 6c 74 65  |ow stepping alte|
00004d30  72 6e 61 74 69 76 65 0d  1e 82 35 42 6f 6f 74 52  |rnative...5BootR|
00004d40  65 63 25 21 2d 38 20 20  3d 20 4c 6f 77 43 75 72  |ec%!-8  = LowCur|
00004d50  72 65 6e 74 43 79 6c 25  20 84 20 28 50 72 65 43  |rentCyl% . (PreC|
00004d60  6f 6d 70 43 79 6c 25 3c  3c 31 36 29 0d 1e 8c 37  |ompCyl%<<16)...7|
00004d70  42 6f 6f 74 52 65 63 25  21 2d 34 20 20 3d 20 53  |BootRec%!-4  = S|
00004d80  65 63 53 69 7a 65 25 2a  53 65 63 73 50 65 72 54  |ecSize%*SecsPerT|
00004d90  72 6b 25 2a 48 65 61 64  73 25 2a 50 61 72 6b 43  |rk%*Heads%*ParkC|
00004da0  79 6c 25 0d 1e 96 05 e1  0d 1e a0 05 3a 0d 1e aa  |yl%.........:...|
00004db0  21 dd 20 a4 41 73 6b 28  53 74 72 69 6e 67 24 2c  |!. .Ask(String$,|
00004dc0  44 65 66 61 75 6c 74 25  2c 6d 69 6e 25 29 0d 1e  |Default%,min%)..|
00004dd0  b4 17 ea 20 58 2c 59 2c  72 65 70 6c 79 24 2c 76  |... X,Y,reply$,v|
00004de0  61 6c 75 65 25 0d 1e be  07 ea 20 85 0d 1e c8 09  |alue%..... .....|
00004df0  f1 3a ef 31 31 0d 1e d2  1d f1 20 53 74 72 69 6e  |.:.11..... Strin|
00004e00  67 24 3b 22 20 3f 22 3b  3a 20 58 3d b1 3a 20 59  |g$;" ?";: X=.: Y|
00004e10  3d bc 0d 1e dc 09 ee 20  85 20 ea 0d 1e e6 05 f5  |=...... . ......|
00004e20  0d 1e f0 1f 20 f1 20 8a  58 2c 59 29 3b 44 65 66  |.... . .X,Y);Def|
00004e30  61 75 6c 74 25 3b 89 33  3b 8a 58 2c 59 29 3b 0d  |ault%;.3;.X,Y);.|
00004e40  1e fa 0d 20 2a 46 58 20  31 35 2c 31 0d 1f 04 0e  |... *FX 15,1....|
00004e50  20 e8 22 22 72 65 70 6c  79 24 0d 1f 0e 12 20 e7  | .""reply$.... .|
00004e60  20 72 65 70 6c 79 24 3d  22 22 20 8c 0d 1f 18 15  | reply$="" .....|
00004e70  20 20 76 61 6c 75 65 25  3d 44 65 66 61 75 6c 74  |  value%=Default|
00004e80  25 0d 1f 22 06 20 cc 0d  1f 2c 16 20 20 76 61 6c  |%..". ...,.  val|
00004e90  75 65 25 3d a0 28 72 65  70 6c 79 24 29 0d 1f 36  |ue%=.(reply$)..6|
00004ea0  06 20 cd 0d 1f 40 12 fd  20 76 61 6c 75 65 25 3e  |. ...@.. value%>|
00004eb0  3d 6d 69 6e 25 0d 1f 4a  15 f1 20 8a 58 2c 59 29  |=min%..J.. .X,Y)|
00004ec0  3b 76 61 6c 75 65 25 3b  89 33 0d 1f 54 0b 3d 76  |;value%;.3..T.=v|
00004ed0  61 6c 75 65 25 0d 1f 5e  05 3a 0d 1f 68 1f dd 20  |alue%..^.:..h.. |
00004ee0  a4 53 74 72 41 73 6b 28  53 74 72 69 6e 67 24 2c  |.StrAsk(String$,|
00004ef0  44 65 66 61 75 6c 74 24  29 0d 1f 72 10 ea 20 58  |Default$)..r.. X|
00004f00  2c 59 2c 72 65 70 6c 79  24 0d 1f 7c 09 f1 3a ef  |,Y,reply$..|..:.|
00004f10  31 31 0d 1f 86 1d f1 20  53 74 72 69 6e 67 24 3b  |11..... String$;|
00004f20  22 20 3f 22 3b 3a 20 58  3d b1 3a 20 59 3d bc 0d  |" ?";: X=.: Y=..|
00004f30  1f 90 2a f1 20 8a 58 2c  59 29 3b 44 65 66 61 75  |..*. .X,Y);Defau|
00004f40  6c 74 24 3b 89 31 32 3b  8a 58 2c 59 29 3b 3a 20  |lt$;.12;.X,Y);: |
00004f50  e8 22 22 72 65 70 6c 79  24 0d 1f 9a 23 e7 20 72  |.""reply$...#. r|
00004f60  65 70 6c 79 24 3d 22 22  20 8c 20 72 65 70 6c 79  |eply$="" . reply|
00004f70  24 20 3d 20 44 65 66 61  75 6c 74 24 0d 1f a4 15  |$ = Default$....|
00004f80  f1 20 8a 58 2c 59 29 3b  72 65 70 6c 79 24 3b 89  |. .X,Y);reply$;.|
00004f90  33 0d 1f ae 0c 3d 20 72  65 70 6c 79 24 0d 1f b8  |3....= reply$...|
00004fa0  05 3a 0d 1f c2 22 dd 20  a4 49 6e 70 75 74 44 65  |.:...". .InputDe|
00004fb0  63 28 53 74 72 69 6e 67  24 2c 6d 69 6e 25 2c 6d  |c(String$,min%,m|
00004fc0  61 78 25 29 0d 1f cc 17  ea 20 58 2c 59 2c 72 65  |ax%)..... X,Y,re|
00004fd0  70 6c 79 24 2c 76 61 6c  75 65 25 0d 1f d6 07 ea  |ply$,value%.....|
00004fe0  20 85 0d 1f e0 09 f1 3a  ef 31 31 0d 1f ea 34 f1  | ......:.11...4.|
00004ff0  20 53 74 72 69 6e 67 24  3b 22 20 28 22 3b 6d 69  | String$;" (";mi|
00005000  6e 25 3b 22 20 74 6f 20  22 3b 6d 61 78 25 3b 22  |n%;" to ";max%;"|
00005010  20 29 20 22 3b 3a 20 58  3d b1 3a 20 59 3d bc 0d  | ) ";: X=.: Y=..|
00005020  1f f4 09 ee 20 85 20 ea  0d 1f fe 05 f5 0d 20 08  |.... . ....... .|
00005030  21 20 f1 20 8a 58 2c 59  29 3b 89 31 32 3b 8a 58  |! . .X,Y);.12;.X|
00005040  2c 59 29 3b 3a 20 e8 20  72 65 70 6c 79 24 0d 20  |,Y);: . reply$. |
00005050  12 15 20 76 61 6c 75 65  25 3d a0 28 72 65 70 6c  |.. value%=.(repl|
00005060  79 24 29 0d 20 1c 21 fd  20 76 61 6c 75 65 25 3e  |y$). .!. value%>|
00005070  3d 6d 69 6e 25 20 80 20  76 61 6c 75 65 25 3c 3d  |=min% . value%<=|
00005080  6d 61 78 25 0d 20 26 0c  3d 20 76 61 6c 75 65 25  |max%. &.= value%|
00005090  0d 20 30 05 3a 0d 20 3a  2d dd 20 a4 49 6e 70 75  |. 0.:. :-. .Inpu|
000050a0  74 44 65 63 32 28 53 74  72 69 6e 67 31 24 2c 53  |tDec2(String1$,S|
000050b0  74 72 69 6e 67 32 24 2c  6d 69 6e 25 2c 6d 61 78  |tring2$,min%,max|
000050c0  25 29 0d 20 44 17 ea 20  58 2c 59 2c 72 65 70 6c  |%). D.. X,Y,repl|
000050d0  79 24 2c 76 61 6c 75 65  25 0d 20 4e 07 ea 20 85  |y$,value%. N.. .|
000050e0  0d 20 58 09 f1 3a ef 31  31 0d 20 62 24 f1 20 53  |. X..:.11. b$. S|
000050f0  74 72 69 6e 67 31 24 3b  22 20 28 31 20 74 6f 20  |tring1$;" (1 to |
00005100  22 3b 6d 61 78 25 3b 22  20 29 2c 22 3b 0d 20 6c  |";max%;" ),";. l|
00005110  2e f1 20 53 74 72 69 6e  67 32 24 3b 22 20 28 30  |.. String2$;" (0|
00005120  20 74 6f 20 22 3b 6d 69  6e 25 3b 22 20 29 20 22  | to ";min%;" ) "|
00005130  3b 3a 20 58 3d b1 3a 20  59 3d bc 0d 20 76 09 ee  |;: X=.: Y=.. v..|
00005140  20 85 20 ea 0d 20 80 05  f5 0d 20 8a 21 20 f1 20  | . .. .... .! . |
00005150  8a 58 2c 59 29 3b 89 31  32 3b 8a 58 2c 59 29 3b  |.X,Y);.12;.X,Y);|
00005160  3a 20 e8 20 72 65 70 6c  79 24 0d 20 94 15 20 76  |: . reply$. .. v|
00005170  61 6c 75 65 25 3d a0 28  72 65 70 6c 79 24 29 0d  |alue%=.(reply$).|
00005180  20 9e 21 fd 20 76 61 6c  75 65 25 3e 3d 6d 69 6e  | .!. value%>=min|
00005190  25 20 80 20 76 61 6c 75  65 25 3c 3d 6d 61 78 25  |% . value%<=max%|
000051a0  0d 20 a8 0c 3d 20 76 61  6c 75 65 25 0d 20 b2 05  |. ..= value%. ..|
000051b0  3a 0d 20 bc 18 dd 20 a4  49 6e 70 75 74 48 65 78  |:. ... .InputHex|
000051c0  28 53 74 72 69 6e 67 24  29 0d 20 c6 17 ea 20 58  |(String$). ... X|
000051d0  2c 59 2c 72 65 70 6c 79  24 2c 76 61 6c 75 65 25  |,Y,reply$,value%|
000051e0  0d 20 d0 07 ea 20 85 0d  20 da 09 f1 3a ef 31 31  |. ... .. ...:.11|
000051f0  0d 20 e4 1d f1 20 53 74  72 69 6e 67 24 3b 22 20  |. ... String$;" |
00005200  26 22 3b 3a 20 58 3d b1  3a 20 59 3d bc 0d 20 ee  |&";: X=.: Y=.. .|
00005210  09 ee 20 85 20 ea 0d 20  f8 22 f1 20 8a 58 2c 59  |.. . .. .". .X,Y|
00005220  29 3b 89 31 32 3b 8a 58  2c 59 29 3b 3a 20 e8 20  |);.12;.X,Y);: . |
00005230  22 22 72 65 70 6c 79 24  0d 21 02 12 3d a0 28 22  |""reply$.!..=.("|
00005240  26 22 2b 72 65 70 6c 79  24 29 0d 21 0c 05 3a 0d  |&"+reply$).!..:.|
00005250  21 16 1b dd 20 a4 43 68  6f 6f 73 65 28 53 74 72  |!... .Choose(Str|
00005260  69 6e 67 24 2c 6f 70 74  24 29 0d 21 20 10 ea 20  |ing$,opt$).! .. |
00005270  58 2c 59 2c 72 65 70 6c  79 24 0d 21 2a 09 f1 3a  |X,Y,reply$.!*..:|
00005280  ef 31 31 0d 21 34 1d f1  20 53 74 72 69 6e 67 24  |.11.!4.. String$|
00005290  3b 22 20 3f 22 3b 3a 20  58 3d b1 3a 20 59 3d bc  |;" ?";: X=.: Y=.|
000052a0  0d 21 3e 05 f5 0d 21 48  06 20 f5 0d 21 52 24 20  |.!>...!H. ..!R$ |
000052b0  20 f1 20 8a 58 2c 59 29  3b 89 31 32 3b 8a 58 2c  | . .X,Y);.12;.X,|
000052c0  59 29 3b 3a 20 e8 20 22  22 72 65 70 6c 79 24 0d  |Y);: . ""reply$.|
000052d0  21 5c 12 20 fd 20 a9 28  72 65 70 6c 79 24 29 3d  |!\. . .(reply$)=|
000052e0  31 0d 21 66 1c 20 72 65  70 6c 79 24 3d bd 28 97  |1.!f. reply$=.(.|
000052f0  28 72 65 70 6c 79 24 29  80 26 44 46 29 0d 21 70  |(reply$).&DF).!p|
00005300  13 fd 20 a7 6f 70 74 24  2c 72 65 70 6c 79 24 29  |.. .opt$,reply$)|
00005310  0d 21 7a 0b 3d 72 65 70  6c 79 24 0d 21 84 05 3a  |.!z.=reply$.!..:|
00005320  0d 21 8e 13 dd 20 f2 43  68 65 63 6b 50 75 74 28  |.!... .CheckPut(|
00005330  49 25 29 0d 21 98 42 63  68 65 63 6b 25 3d 28 63  |I%).!.Bcheck%=(c|
00005340  68 65 63 6b 25 20 3e 3e  3e 20 31 33 29 20 82 20  |heck% >>> 13) . |
00005350  28 28 63 68 65 63 6b 25  20 80 20 28 32 5e 31 33  |((check% . (2^13|
00005360  2d 31 29 29 20 3c 3c 20  28 33 32 2d 31 33 29 29  |-1)) << (32-13))|
00005370  20 82 20 49 25 0d 21 a2  05 e1 0d 21 ac 05 3a 0d  | . I%.!....!..:.|
00005380  21 b6 16 dd 20 a4 73 75  6d 28 62 61 73 65 25 2c  |!... .sum(base%,|
00005390  6c 65 6e 25 29 0d 21 c0  0f 73 75 6d 25 3d 30 3a  |len%).!..sum%=0:|
000053a0  63 25 3d 30 0d 21 ca 17  e3 20 49 25 3d 6c 65 6e  |c%=0.!... I%=len|
000053b0  25 2d 32 20 b8 20 30 20  88 2d 31 0d 21 d4 19 73  |%-2 . 0 .-1.!..s|
000053c0  75 6d 25 3d 73 75 6d 25  2b 62 61 73 65 25 3f 49  |um%=sum%+base%?I|
000053d0  25 2b 63 25 0d 21 de 2b  e7 20 73 75 6d 25 3c 26  |%+c%.!.+. sum%<&|
000053e0  31 30 30 20 63 25 3d 30  20 8b 20 73 75 6d 25 3d  |100 c%=0 . sum%=|
000053f0  73 75 6d 25 20 80 20 26  46 46 3a 63 25 3d 31 0d  |sum% . &FF:c%=1.|
00005400  21 e8 08 ed 20 49 25 0d  21 f2 09 3d 73 75 6d 25  |!... I%.!..=sum%|
00005410  0d 21 fc 05 3a 0d 22 06  16 dd 20 f2 53 75 6d 28  |.!..:."... .Sum(|
00005420  62 61 73 65 25 2c 6c 65  6e 25 29 0d 22 10 23 62  |base%,len%).".#b|
00005430  61 73 65 25 3f 28 6c 65  6e 25 2d 31 29 3d a4 73  |ase%?(len%-1)=.s|
00005440  75 6d 28 62 61 73 65 25  2c 6c 65 6e 25 29 0d 22  |um(base%,len%)."|
00005450  1a 05 e1 0d 22 24 05 3a  0d 22 2e 26 dd 20 a4 4e  |...."$.:.".&. .N|
00005460  65 77 4d 61 70 43 68 65  63 6b 28 42 25 2c 43 25  |ewMapCheck(B%,C%|
00005470  29 3d ba 28 4e 65 77 43  68 65 63 6b 25 29 0d 22  |)=.(NewCheck%)."|
00005480  38 05 3a 0d 22 42 0a dd  20 f2 41 73 6d 0d 22 4c  |8.:."B.. .Asm."L|
00005490  14 e3 20 6f 70 74 25 3d  30 20 b8 20 32 20 88 20  |.. opt%=0 . 2 . |
000054a0  32 0d 22 56 0b 20 50 25  3d 6d 63 25 0d 22 60 0f  |2."V. P%=mc%."`.|
000054b0  20 5b 20 4f 50 54 20 6f  70 74 25 0d 22 6a 0e 2e  | [ OPT opt%."j..|
000054c0  4e 65 77 43 68 65 63 6b  25 0d 22 74 0f 20 4d 4f  |NewCheck%."t. MO|
000054d0  56 20 20 52 30 2c 23 30  0d 22 7e 18 20 41 44 44  |V  R0,#0."~. ADD|
000054e0  53 20 52 32 2c 52 31 2c  52 32 20 20 5c 43 3d 30  |S R2,R1,R2  \C=0|
000054f0  0d 22 88 0a 2e 6c 6f 6f  70 25 0d 22 92 16 20 4c  |."...loop%.".. L|
00005500  44 52 20 20 52 33 2c 5b  52 32 2c 23 2d 34 5d 21  |DR  R3,[R2,#-4]!|
00005510  0d 22 9c 12 20 41 44 43  53 20 52 30 2c 52 30 2c  |.".. ADCS R0,R0,|
00005520  52 33 0d 22 a6 0f 20 54  45 51 53 20 52 32 2c 52  |R3.".. TEQS R2,R|
00005530  31 0d 22 b0 0f 20 42 4e  45 20 20 6c 6f 6f 70 25  |1.".. BNE  loop%|
00005540  0d 22 ba 12 20 80 20 20  52 33 2c 52 33 2c 23 26  |.".. .  R3,R3,#&|
00005550  46 46 0d 22 c4 12 20 53  55 42 20 20 52 30 2c 52  |FF.".. SUB  R0,R|
00005560  30 2c 52 33 0d 22 ce 18  20 82 20 20 52 30 2c 52  |0,R3.".. .  R0,R|
00005570  30 2c 52 30 2c 4c 53 52  20 23 31 36 0d 22 d8 17  |0,R0,LSR #16."..|
00005580  20 82 20 20 52 30 2c 52  30 2c 52 30 2c 4c 53 52  | .  R0,R0,R0,LSR|
00005590  20 23 38 0d 22 e2 12 20  80 20 20 52 30 2c 52 30  | #8.".. .  R0,R0|
000055a0  2c 23 26 46 46 0d 22 ec  10 20 4d 4f 56 53 20 50  |,#&FF.".. MOVS P|
000055b0  43 2c 52 31 34 0d 22 f6  06 20 5d 0d 23 00 0a ed  |C,R14.".. ].#...|
000055c0  20 6f 70 74 25 0d 23 0a  05 e1 0d 23 14 05 3a 0d  | opt%.#....#..:.|
000055d0  23 1e 14 dd 20 f2 44 69  73 61 62 6c 65 45 73 63  |#... .DisableEsc|
000055e0  61 70 65 0d 23 28 2b c8  99 20 22 58 4f 53 5f 42  |ape.#(+.. "XOS_B|
000055f0  79 74 65 22 2c 32 30 30  2c 31 2c 30 20 b8 20 52  |yte",200,1,0 . R|
00005600  30 2c 4f 6c 64 45 73 63  53 74 61 74 65 25 0d 23  |0,OldEscState%.#|
00005610  32 35 c8 99 20 22 58 4f  53 5f 42 79 74 65 22 2c  |25.. "XOS_Byte",|
00005620  32 34 37 2c 25 31 30 31  30 31 30 31 30 2c 30 20  |247,%10101010,0 |
00005630  b8 20 52 30 2c 4f 6c 64  42 72 65 61 6b 53 74 61  |. R0,OldBreakSta|
00005640  74 65 25 0d 23 3c 05 e1  0d 23 46 05 3a 0d 23 50  |te%.#<...#F.:.#P|
00005650  14 dd 20 f2 52 65 73 74  6f 72 65 45 73 63 61 70  |.. .RestoreEscap|
00005660  65 0d 23 5a 24 c8 99 20  22 58 4f 53 5f 42 79 74  |e.#Z$.. "XOS_Byt|
00005670  65 22 2c 32 30 30 2c 4f  6c 64 45 73 63 53 74 61  |e",200,OldEscSta|
00005680  74 65 25 2c 30 0d 23 64  26 c8 99 20 22 58 4f 53  |te%,0.#d&.. "XOS|
00005690  5f 42 79 74 65 22 2c 32  34 37 2c 4f 6c 64 42 72  |_Byte",247,OldBr|
000056a0  65 61 6b 53 74 61 74 65  25 2c 30 0d 23 6e 05 e1  |eakState%,0.#n..|
000056b0  0d 23 78 05 3a 0d 23 82  1d dd 20 f2 4d 6f 61 6e  |.#x.:.#... .Moan|
000056c0  4f 70 28 62 25 2c 20 43  25 2c 20 44 25 2c 20 45  |Op(b%, C%, D%, E|
000056d0  25 29 0d 23 8c 50 c8 99  20 41 64 66 73 53 77 69  |%).#.P.. AdfsSwi|
000056e0  25 2c 20 30 2c 20 62 25  20 84 20 41 6c 74 44 65  |%, 0, b% . AltDe|
000056f0  66 65 63 74 42 69 74 25  20 84 20 28 44 69 73 63  |fectBit% . (Disc|
00005700  52 65 63 25 3c 3c 36 29  2c 20 43 25 20 84 20 44  |Rec%<<6), C% . D|
00005710  72 69 76 65 25 3c 3c 20  32 39 2c 20 44 25 2c 20  |rive%<< 29, D%, |
00005720  45 25 0d 23 96 05 e1 0d  23 a0 05 3a 0d 23 aa 19  |E%.#....#..:.#..|
00005730  dd 20 f2 4f 70 28 62 25  2c 20 43 25 2c 20 44 25  |. .Op(b%, C%, D%|
00005740  2c 20 45 25 29 0d 23 b4  76 c8 99 20 41 64 66 73  |, E%).#.v.. Adfs|
00005750  53 77 69 25 20 84 20 28  31 3c 3c 31 37 29 2c 20  |Swi% . (1<<17), |
00005760  30 2c 20 62 25 20 84 20  41 6c 74 44 65 66 65 63  |0, b% . AltDefec|
00005770  74 42 69 74 25 20 84 20  28 44 69 73 63 52 65 63  |tBit% . (DiscRec|
00005780  25 3c 3c 36 29 2c 20 43  25 20 84 20 44 72 69 76  |%<<6), C% . Driv|
00005790  65 25 3c 3c 20 32 39 2c  20 44 25 2c 20 45 25 20  |e%<< 29, D%, E% |
000057a0  b8 20 52 65 73 75 6c 74  25 2c 20 52 31 25 2c 20  |. Result%, R1%, |
000057b0  45 72 72 44 69 73 63 41  64 64 25 0d 23 be 0f e7  |ErrDiscAdd%.#...|
000057c0  20 52 65 73 75 6c 74 25  20 8c 0d 23 c8 1c 20 e7  | Result% ..#.. .|
000057d0  20 52 65 73 75 6c 74 25  20 80 20 28 31 20 3c 3c  | Result% . (1 <<|
000057e0  20 33 31 29 20 8c 0d 23  d2 28 20 20 f1 20 22 45  | 31) ..#.(  . "E|
000057f0  72 72 6f 72 20 26 22 3b  7e 52 65 73 75 6c 74 25  |rror &";~Result%|
00005800  20 80 20 26 33 46 46 46  46 46 46 46 3a e0 0d 23  | . &3FFFFFFF:..#|
00005810  dc 06 20 cc 0d 23 e6 2d  20 20 e7 20 28 28 21 52  |.. ..#.-  . ((!R|
00005820  65 73 75 6c 74 25 29 20  80 20 26 46 46 46 46 46  |esult%) . &FFFFF|
00005830  46 29 3d 41 64 66 73 44  69 73 63 45 72 72 25 20  |F)=AdfsDiscErr% |
00005840  8c 0d 23 f0 18 20 20 20  52 65 73 75 6c 74 25 3d  |..#..   Result%=|
00005850  52 65 73 75 6c 74 25 3f  33 0d 23 fa 07 20 20 cc  |Result%?3.#..  .|
00005860  0d 24 04 21 20 20 20 f1  20 22 45 72 72 6f 72 20  |.$.!   . "Error |
00005870  26 22 3b 7e 21 52 65 73  75 6c 74 25 3b 22 20 22  |&";~!Result%;" "|
00005880  3b 0d 24 0e 0b 20 20 20  49 25 3d 34 0d 24 18 14  |;.$..   I%=4.$..|
00005890  20 20 20 c8 95 20 52 65  73 75 6c 74 25 3f 49 25  |   .. Result%?I%|
000058a0  0d 24 22 14 20 20 20 20  ef 20 52 65 73 75 6c 74  |.$".    . Result|
000058b0  25 3f 49 25 0d 24 2c 0f  20 20 20 20 49 25 3d 49  |%?I%.$,.    I%=I|
000058c0  25 2b 31 0d 24 36 08 20  20 20 ce 0d 24 40 08 20  |%+1.$6.   ..$@. |
000058d0  20 20 e0 0d 24 4a 07 20  20 cd 0d 24 54 06 20 cd  |  ..$J.  ..$T. .|
000058e0  0d 24 5e 05 cc 0d 24 68  05 cd 0d 24 72 05 e1 0d  |.$^...$h...$r...|
000058f0  24 7c 05 3a 0d 24 86 79  f4 20 4d 61 6e 75 66 61  |$|.:.$.y. Manufa|
00005900  63 74 75 72 65 72 2c 20  53 65 63 74 6f 72 73 20  |cturer, Sectors |
00005910  70 65 72 20 74 72 61 63  6b 2c 20 68 65 61 64 73  |per track, heads|
00005920  2c 20 63 79 6c 69 6e 64  65 72 73 2c 20 6c 6f 77  |, cylinders, low|
00005930  20 63 75 72 72 65 6e 74  20 63 79 6c 69 6e 64 65  | current cylinde|
00005940  72 2c 20 70 72 65 63 6f  6d 70 65 6e 73 61 74 69  |r, precompensati|
00005950  6f 6e 20 63 79 6c 69 6e  64 65 72 2c 20 70 61 72  |on cylinder, par|
00005960  6b 69 6e 67 20 63 79 6c  69 6e 64 65 72 0d 24 90  |king cylinder.$.|
00005970  4a dc 20 32 30 4d 62 20  4d 69 6e 69 73 63 72 69  |J. 20Mb Miniscri|
00005980  62 65 20 38 34 32 35 2c  20 20 20 20 20 20 20 20  |be 8425,        |
00005990  20 20 20 20 20 20 20 20  20 20 20 20 33 32 2c 20  |            32, |
000059a0  34 2c 20 36 31 35 2c 20  26 33 46 46 2c 20 20 31  |4, 615, &3FF,  1|
000059b0  32 38 2c 20 36 36 33 0d  24 9a 4a dc 20 35 33 4d  |28, 663.$.J. 53M|
000059c0  62 20 52 6f 64 69 6d 65  20 52 4f 33 30 36 35 2c  |b Rodime RO3065,|
000059d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000059e0  20 20 20 20 20 20 33 32  2c 20 37 2c 20 38 37 32  |      32, 7, 872|
000059f0  2c 20 26 33 46 46 2c 20  20 36 35 30 2c 20 38 37  |, &3FF,  650, 87|
00005a00  31 0d 24 a4 5b dc 20 4f  54 48 45 52 2c 20 20 20  |1.$.[. OTHER,   |
00005a10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00005a30  33 32 2c 20 34 2c 20 36  31 32 2c 20 26 33 46 46  |32, 4, 612, &3FF|
00005a40  2c 20 20 31 32 38 2c 20  36 31 31 3a 52 45 4d 20  |,  128, 611:REM |
00005a50  4d 55 53 54 20 42 45 20  4c 41 53 54 0d 24 ae 4b  |MUST BE LAST.$.K|
00005a60  f4 20 20 32 30 4d 62 20  57 65 73 74 65 72 6e 20  |.  20Mb Western |
00005a70  44 69 67 69 74 61 6c 20  57 44 33 36 32 2f 54 61  |Digital WD362/Ta|
00005a80  6e 64 6f 6e 20 54 4d 33  36 32 2c 20 33 32 2c 20  |ndon TM362, 32, |
00005a90  34 2c 20 36 31 35 2c 20  26 33 46 46 2c 20 26 33  |4, 615, &3FF, &3|
00005aa0  46 46 2c 20 36 36 33 0d  24 b8 4b f4 20 20 32 30  |FF, 663.$.K.  20|
00005ab0  4d 62 20 4e 45 43 2c 20  20 20 20 20 20 20 20 20  |Mb NEC,         |
00005ac0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005ad0  20 20 20 20 20 20 20 33  32 2c 20 34 2c 20 36 31  |       32, 4, 61|
00005ae0  32 2c 20 26 33 46 46 2c  20 20 32 35 36 2c 20 36  |2, &3FF,  256, 6|
00005af0  37 32 0d 24 c2 4b f4 20  20 32 30 4d 62 20 4f 6c  |72.$.K.  20Mb Ol|
00005b00  69 76 65 74 74 69 2c 20  20 20 20 20 20 20 20 20  |ivetti,         |
00005b10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005b20  20 20 33 32 2c 20 34 2c  20 36 31 32 2c 20 26 33  |  32, 4, 612, &3|
00005b30  46 46 2c 20 20 31 32 38  2c 20 36 37 30 0d 24 cc  |FF,  128, 670.$.|
00005b40  5b f4 20 46 6f 72 20 73  6c 6f 77 20 73 74 65 70  |[. For slow step|
00005b50  70 69 6e 67 20 64 72 69  76 65 73 20 79 6f 75 20  |ping drives you |
00005b60  77 69 6c 6c 20 6e 65 65  64 20 74 6f 20 75 73 65  |will need to use|
00005b70  20 74 68 65 20 61 6c 74  65 72 6e 61 74 65 20 6c  | the alternate l|
00005b80  69 6e 65 73 20 69 6e 20  50 52 4f 43 49 6e 69 74  |ines in PROCInit|
00005b90  48 61 72 64 44 65 73 63  0d ff                    |HardDesc..|
00005b9a
Acorn/HFORM.m0
Acorn/HFORM.m1
Acorn/HFORM.m2
Acorn/HFORM.m4
Acorn/HFORM.m5