Home » Personal collection » Acorn hard disk » apps » SCSI » !HFORM/!Runimage

!HFORM/!Runimage

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 hard disk » apps » SCSI
Filename: !HFORM/!Runimage
Read OK:
File size: 97BA bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > !RunImage
  130*set HForm$EndStatus 1
  140Log2ShareSize%=0
  150ShareSize%=1<<Log2ShareSize%
  160dev%=FALSE
  170Verbose%=dev%
  200msgs_file_desc%=0
  210msgs_file_open%=FALSE
  220ONERRORPROCabort(REPORT$,1)
  230VDU26:VDU12
  240PROCInit
  250PROCGetShape
  260IFNOTBigADFS%THEN
  280IF(DiscSize2%<>0OR(DiscSize%AND&E0000000)<>0)THEN
  290PROCmessage_print_0("DiscSizeError")
  300PROCfinish
  310ENDIF
  320ENDIF
  330FormatFlag%=(FNChoose("Q01:","FormatOrInitChoose","FI","")="F")
  340SoakStyle$=FNChoose("Q02:","SoakTestChoose","LSN","")
  350BootOpt$=FNChoose("BootOpt:","BootOptChoose","YN","")
  360IFFNchoose_no_lookup("Q03:",FNmessage_lookup_1("SureChoose",STR$(Drive%)),"YN","")="N"PROCfinish
  380PROCDisableEscape
  390PROCMoanOp(Specify%,0,0,0)
  400IFFormatFlag%THEN
  410PROCFormat
  420ENDIF
  430IFSoakStyle$<>"N"THEN
  440SoakFlag%=(SoakStyle$="L")
  450PROCVerify
  460ENDIF
  470PRINT
  480PROCStructure
  490PROCRestoreEscape
  520OSCLI("-ADFS-%MOUNT :"+STR$Drive%)
  530OSCLI("-ADFS-%FREE :"+STR$Drive%)
  540OSCLI("-ADFS-%DISMOUNT :"+STR$Drive%)
  570*set HForm$EndStatus 0
  580PROCexit
  610DEFPROCInit
  620LOCALDriveOffset%
  630PROCopen_message_file("<HForm$Dir>.Messages")
  640PROCmessage_print_0("Banner")
  660autoreply$=FNreadvarval("Hform$Autoreply")
  680SYS"XOS_Module",18,"ADFS"TO,,,A%;F%
  690IFF%AND1PROCmessage_print_0("NoADFS"):PROCfinish
  700A%+=A%!20
  710WHILE(?A%<>32)AND(?A%<>9)AND(?A%<>0):A%+=1:ENDWHILE
  720IF?A%=0PROCfinish
  730WHILE(?A%<ASC"0")OR(?A%>ASC"9"):A%+=1:ENDWHILE
  740ADFSVersion%=((?A%-ASC"0")*10+(A%?2)-ASC"0")*10+(A%?3)-ASC"0"
  750SYS"ADFS_Drives"TO,,HDiscs%
  760IFHDiscs%<1PROCmessage_print_0("NoHardDiscs"):PROCfinish
  800BigADFS%=FNBigADFS
  820DriveOffset%=INSTR(autoreply$,"Drive=")
  830IF(DriveOffset%<>0)THEN
  840Drive%=VAL(MID$(autoreply$,DriveOffset%+6))
  850ELSE
  860REPEAT
  870Drive%=FNAsk("DriveAsk",4,4)
  880UNTILDrive%>=4AND Drive%<=7
  890ENDIF
  910IF(Drive%-3)>HDiscs%THEN
  920PROCmessage_print_1("SillyDiscNum",STR$(HDiscs%))
  930PROCfinish
  940ENDIF
  950IFADFSVersion%<210THEN
  960IDE%=FALSE
  970ELSE
  980SYS"ADFS_ControllerType",Drive%TODriveType%
  990IFDriveType%=0THEN
 1000PROCmessage_print_1("DriveNotPresent",STR$(Drive%))
 1010PROCfinish
 1020ELSE
 1030IFDriveType%=3PROCmessage_print_1("DriveIsST506",STR$(Drive%))
 1040IFDriveType%=4PROCmessage_print_1("DriveIsIDE",STR$(Drive%))
 1050ENDIF
 1060IDE%=DriveType%=4
 1070ENDIF
 1080IFIDE%THEN
 1100SYS"XADFS_ControllerType",Drive%-1TOA%;F%
 1110IF((F%AND1)=0)AND(A%=4)THENIDEdrive%=1ELSEIDEdrive%=0
 1120DIMIDEid%512
 1130DIMIDEpb%7
 1140IDEpb%!0=0
 1150IDEpb%!4=0
 1160IDEpb%?5=&A0+(IDEdrive%<<4)
 1170IDEpb%?6=&EC
 1180SYS"ADFS_IDEUserOp",1<<24,,IDEpb%,IDEid%,512TOr0%,,,,r4%
 1190IFr0%<>0ORr4%<>0THEN
 1200PROCmessage_print_1("DiscIdError",STR$~(r0%))
 1210IDEcyls%=0:IDEheads%=0:IDEsecs%=0
 1220ELSE
 1230IDEcyls%=(IDEid%!2)AND&FFFF
 1240IDEheads%=(IDEid%!6)AND&FFFF
 1250IDEsecs%=(IDEid%!12)AND&FFFF
 1260IDECapacity%=(IDEid%!(57*2))
 1270IDEAddressSpace%=(IDEid%!(60*2))
 1280IDEname$=""
 1290IF(((IDEid%!98)>>9)AND1)<>0THENIDEHasLBA%=1ELSEIDEHasLBA%=0
 1300FORI%=27*2TO46*2STEP2
 1310A%=(IDEid%?(I%+1)):B%=(IDEid%?I%)
 1320IF(A%<32)OR(A%>=127)A%=ASC"."
 1330IDEname$+=CHR$(A%)
 1340IF(B%<32)OR(B%>=127)B%=ASC"."
 1350IDEname$+=CHR$(B%)
 1360NEXT
 1370IDEfirm$=""
 1380FORI%=23*2TO26*2STEP2
 1390A%=(IDEid%?(I%+1)):B%=(IDEid%?I%)
 1400IF(A%<32)OR(A%>=127)A%=ASC"."
 1410IDEfirm$+=CHR$(A%)
 1420IF(B%<32)OR(B%>=127)B%=ASC"."
 1430IDEfirm$+=CHR$(B%)
 1440NEXT
 1450PROCmessage_print_3("IDEDescription",STR$(Drive%),IDEname$,IDEfirm$)
 1460PROCmessage_print_3("IDEConfiguration",STR$(IDEcyls%),STR$(IDEheads%),STR$(IDEsecs%))
 1470IFIDEHasLBA%<>0THEN
 1480PROCmessage_print_0("IDEHasLBA")
 1490ENDIF
 1500ENDIF
 1510ENDIF
 1520MakeParams%=7
 1530VerifyRetries%=1
 1540DefectRetries%=5
 1550Verify%=0
 1560Read%=1
 1570Write%=2
 1580WriteTrack%=4
 1590Restore%=6
 1600Specify%=&F
 1610AltDefectBit%=&10
 1620DiscStruc%=&14
 1640IFIDE%THEN
 1650Log2SecSize%=9
 1660LowSector%=1
 1670ELSE
 1680Log2SecSize%=8
 1690LowSector%=0
 1700ENDIF
 1710SecSize%=2^Log2SecSize%
 1730OldMapAdd%=0
 1740OldMapSize%=&200
 1750DirSize%=&800
 1770BootAdd%=&C00/SecSize%
 1780BootSize%=&200
 1870MaxDefects%=(BootSize%-64-&10-4-4)DIV4
 1930BigMaxDefects%=MaxDefects%-1
 1950EndDefect%=1<<29
 2000EndDefect2%=1<<30
 2020OldLWM%=&E00
 2030FreeLink%=1
 2040CrossCheck%=3
 2060IFBigADFS%THEN
 2070AdfsSwi%=&4024D
 2080ELSE
 2090AdfsSwi%=&40240
 2100ENDIF
 2120AdfsDiscErr%=&108C7
 2130MaxVerifyBad%=16
 2140Patterns%=8
 2150DIMBuf%&40000,DiscRec%64+BootSize%,Defect%BootSize%,DirMark%5,Bad%(MaxVerifyBad%),mc%100,Pattern%(Patterns%-1)
 2160Boot%=DiscRec%+64
 2170BootRec%=Boot%+BootSize%-64
 2290Pattern%(2)=&FFFFFF
 2300Pattern%(3)=&6DB6DB
 2310Pattern%(4)=0
 2320Pattern%(5)=&2CB2CB
 2330Pattern%(6)=&5A5A5A
 2340Pattern%(7)=&4D34D3
 2350SecsPerTrk%=32:Heads%=1:Cyls%=1:ParkCyl%=1
 2360IFIDE%THEN
 2370InitFlag%=0
 2380LBAflag%=0
 2390ELSE
 2400LowCurrentCyl%=1:PreCompCyl%=1
 2410ENDIF
 2430IFBigADFS%
 2440RootDirAdd%=&400/512
 2450ELSE
 2460RootDirAdd%=&400
 2470ENDIF
 2490Log2Alloc%=10:LinkBits%=10
 2500PROCShareSize
 2510IndRootDirAdd%=RootDirAdd%
 2560IFIDEHasLBA%THEN
 2570SectorsPerDisc%=IDEAddressSpace%
 2580ELSE
 2590SectorsPerDisc%=IDECapacity%
 2600ENDIF
 2610DiscSize%=(SectorsPerDisc%AND((1<<(32-Log2SecSize%))-1))<<Log2SecSize%
 2620DiscSize2%=(SectorsPerDisc%>>(32-Log2SecSize%))
 2640IF(DiscSize%>=(512*1024*1024))OR(DiscSize2%<>0)THEN
 2650BigDisc%=TRUE
 2660ELSE
 2670BigDisc%=FALSE
 2680ENDIF
 2700SYS"ADFS_Retries",&ff,0TO,,adfs_retries%
 2710LOCALERROR
 2720ONERRORLOCAL:ONERROROFF:SYS"ADFS_Retries",&ff,adfs_retries%:PROCAsm:ENDPROC
 2730OSCLI("-ADFS-%DISMOUNT :"+STR$Drive%)
 2740ONERROROFF
 2750SYS"ADFS_Retries",&ff,adfs_retries%
 2760PROCAsm
 2770ENDPROC
 2810DEFPROCGetShape
 2820Formatted%=FALSE
 2830PROCInitBootDefects
 2840PROCInitDiscRec
 2850SYS"ADFS_Retries",&ff,0TO,,adfs_retries%
 2860PROCMoanOp(Restore%,0,0,0)
 2870PROCOp(Read%,BootAdd%,Boot%,BootSize%)
 2880SYS"ADFS_Retries",&ff,adfs_retries%
 2890IFResult%<>0ORNOTFNGoodDefectsTHEN
 2900PROCmessage_print_0("NoValidFormat")
 2910ELSE
 2920PROCOldShape
 2930PROCOp(Verify%,0,0,SecSize%*SecsPerTrk%)
 2940IFFNConfirmMakeTHENFormatted%=TRUE
 2950ENDIF
 2970IFNOTFormatted%THEN
 2980IFIDE%THEN
 2990IFNOTFNCompareMakeTHEN
 3010IFINSTR(autoreply$,"NOunknown")PROCabort(FNmessage_lookup_0("UnknownDriveType"),1)
 3020PROCAskMake
 3030ENDIF
 3040ELSE
 3060PROCAskMake
 3070ENDIF
 3080FORI%=0TOBootSize%-4
 3090Boot%!I%=0
 3100NEXTI%
 3110PROCInitBootDefects
 3120ENDIF
 3140PROCAskShape((NOTFormatted%)AND EnglishMake$="OTHER")
 3150PROCmessage_print_1("WillFormat",TransMake$)
 3160PROCprintshape(IDE%)
 3170PRINT
 3180ENDPROC
 3210DEFPROCOldShape
 3220SecsPerTrk%=BootRec%?1
 3230Heads%=BootRec%?2
 3240Log2Alloc%=BootRec%?5
 3250DiscSize%=BootRec%!&10
 3260DiscSize2%=BootRec%!&24
 3280IF(DiscSize%>=(512*1024*1024))OR(DiscSize2%<>0)THEN
 3290BigDisc%=TRUE
 3300ELSE
 3310BigDisc%=FALSE
 3320ENDIF
 3340SectorsPerDisc%=(DiscSize%>>Log2SecSize%)+(DiscSize2%<<(32-Log2SecSize%))
 3360Cyls%=SectorsPerDisc%DIV(SecsPerTrk%*Heads%)
 3370IFIDE%THEN
 3380InitFlag%=(BootRec%?-5)
 3390LBAflag%=(BootRec%?-6)
 3400ELSE
 3410LowCurrentCyl%=(BootRec%!-8)AND&3FF
 3420PreCompCyl%=(BootRec%!-6)AND&3FF
 3430ENDIF
 3440IFBigDisc%THEN
 3450ParkCyl%=(BootRec%!-4)DIV(SecsPerTrk%*Heads%)
 3460ELSE
 3470ParkCyl%=(BootRec%!-4)DIV(SecSize%*SecsPerTrk%*Heads%)
 3480ENDIF
 3490PROCInitDiscRec
 3500ENDPROC
 3530DEFPROCAskMake
 3540PROCrestoreparams(IDE%)
 3550Makes%=0
 3560I%=INSTR(autoreply$,"DriveType:")
 3570IFI%<>0THEN
 3580I%+=LEN("DriveType:")
 3590Make%=EVAL(MID$(autoreply$,I%,INSTR(autoreply$,",",I%)-I%))
 3600ELSE
 3610PROCmessage_print_0("DriveDisclaim")
 3620REPEAT
 3630READEnglishMake$,TokenMake$
 3640TransMake$=FNmessage_lookup_0(TokenMake$)
 3650Makes%+=1
 3660PROCmessage_print_2("MakeMenu",RIGHT$(" "+STR$Makes%,2),TransMake$)
 3670FORI%=1TOMakeParams%
 3680READA$
 3690NEXTI%
 3700UNTILEnglishMake$="OTHER"
 3710PRINT
 3720Make%=FNInputDec("ManufacturerDec",1,Makes%)
 3730PROCrestoreparams(IDE%)
 3740ENDIF
 3750I%=(Make%-1)*(MakeParams%+2)
 3760WHILEI%>0
 3770READA$
 3780I%-=1
 3790ENDWHILE
 3800IFIDE%THEN
 3810READEnglishMake$,TokenMake$,SecsPerTrk%,Heads%,Cyls%,InitFlag%,Dummy%,ParkCyl%,LBAflag%
 3820ELSE
 3830READEnglishMake$,TokenMake$,SecsPerTrk%,Heads%,Cyls%,LowCurrentCyl%,PreCompCyl%,ParkCyl%
 3840ENDIF
 3850TransMake$=FNmessage_lookup_0(TokenMake$)
 3870IFIDE%THEN
 3880IF(EnglishMake$="OTHER")AND(IDEcyls%<>0)THEN
 3890SecsPerTrk%=IDEsecs%
 3900Heads%=IDEheads%
 3910Cyls%=IDEcyls%
 3920InitFlag%=1
 3930LBAFlag%=1
 3940IFINSTR(autoreply$,"LBA:On")<>0THEN
 3950LBAFlag%=1
 3960ELSE
 3970IFINSTR(autoreply$,"LBA:Off")<>0THEN
 3980LBAFlag%=0
 3990ENDIF
 4000ENDIF
 4010ParkCyl%=IDEcyls%-1
 4020ENDIF
 4030ENDIF
 4040ENDPROC
 4070DEFFNConfirmMake
 4080LOCALmatched%
 4090PROCrestoreparams(IDE%)
 4100REPEAT
 4110READEnglishMake$,TokenMake$,P1%,P2%,P3%,P4%,P5%,P6%,P7%
 4120TransMake$=FNmessage_lookup_0(TokenMake$)
 4130IFEnglishMake$="OTHER"THEN
 4140PROCmessage_print_0("NonStandardShape")
 4150PROCprintshape(IDE%)
 4160PRINT
 4170=FNChoose("Q04:","RetainShapeChoose","YN","")="Y"
 4180ENDIF
 4190matched%=TRUE
 4200IFIDE%THEN
 4210IFP1%<>SecsPerTrk%ORP2%<>Heads%ORP3%<>Cyls%ORP4%<>InitFlag%ORP6%<>ParkCyl%ORP7%<>LBAflag%ENDIF:matched%=FALSE
 4220ELSE
 4230IFP1%<>SecsPerTrk%ORP2%<>Heads%ORP3%<>Cyls%ORP4%<>LowCurrentCyl%ORP5%<>PreCompCyl%ORP6%<>ParkCyl%ENDIF:matched%=FALSE
 4240ENDIF
 4250UNTILmatched%
 4270PROCmessage_print_1("StandardShape",TransMake$)
 4280PROCprintshape(IDE%)
 4290PRINT
 4300=FNChoose("Q05:","UseShapeChoose","YN","")="Y"
 4330DEFPROCprintshape(itype%)
 4340PROCmessage_print_3("PrintShape",STR$(Cyls%),STR$(Heads%),STR$(SecsPerTrk%))
 4350IFitype%THEN
 4360PROCmessage_print_3("PrintShape3IDE",STR$(ParkCyl%),STR$(InitFlag%),STR$(LBAflag%))
 4370ELSE
 4380PROCmessage_print_3("PrintShape2ST506",STR$(ParkCyl%),STR$(LowCurrentCyl%),STR$(PreCompCyl%))
 4390ENDIF
 4400ENDPROC
 4440DEFFNCompareMake
 4450PROCrestorePROD
 4460REPEAT
 4470READEnglishMake$,TokenMake$,SecsPerTrk%,Heads%,Cyls%,InitFlag%,Dummy%,ParkCyl%,LBAflag%
 4480TransMake$=FNmessage_lookup_0(TokenMake$)
 4490IFEnglishMake$="OTHER"THEN
 4500PROCmessage_print_0("UnknownDriveMake")
 4510=FALSE
 4520ENDIF
 4530UNTILFNmatchstrings(EnglishMake$,IDEname$)
 4540=FNChoose("Q06:","StandardShapeChoose","YN","")="Y"
 4580DEFPROCAskShape(tailored%)
 4600IFIDE%OR(INSTR(autoreply$,"NewMap")<>0)THEN
 4610NewMap%=TRUE
 4620ELSE
 4630NewMap%=(FNChoose("OldOrNewMap:","OldNewMapChoose","ON","N")="N")
 4640ENDIF
 4660IFtailored%THEN
 4670SecsPerTrk%=FNAsk("SectorsAsk",SecsPerTrk%,1)
 4680IFIDE%THEN
 4690REPEAT
 4700Heads%=FNAsk("IDEHeadsAsk",Heads%,1)
 4710IFHeads%>16PROCmessage_print_0("IDEHeads16")
 4720UNTILHeads%<=16
 4730ELSE
 4740Heads%=FNAsk("ST506HeadsAsk",Heads%,1)
 4750IFHeads%>8PROCmessage_print_0("ST506Heads8")
 4760ENDIF
 4770Cyls%=FNAsk("CylindersAsk",Cyls%,1)
 4790IFIDE%THEN
 4800InitFlag%=FNAsk("InitAsk",InitFlag%,0)
 4810IFIDEHasLBA%THEN
 4820LBAFlag%=1
 4830IFINSTR(autoreply$,"LBA:On")<>0THEN
 4840LBAFlag%=1
 4850ELSE
 4860IFINSTR(autoreply$,"LBA:Off")<>0THEN
 4870LBAFlag%=0
 4880ELSE
 4890LBAflag%=FNAsk("LBAAsk",LBAflag%,1)
 4900ENDIF
 4910ENDIF
 4920ELSE
 4930LBAflag%=0
 4940ENDIF
 4950ELSE
 4960LowCurrentCyl%=FNAsk("LowCylinderAsk",LowCurrentCyl%,0)
 4970PreCompCyl%=FNAsk("PrecompCylinderAsk",PreCompCyl%,0)
 4980ENDIF
 4990ParkCyl%=FNAsk("ParkCylinderAsk",ParkCyl%,0)
 5000ENDIF
 5020DiscRec%?1=SecsPerTrk%
 5030DiscRec%?2=Heads%
 5060SectorsPerDisc%=SecsPerTrk%*Heads%*Cyls%
 5070IFIDEHasLBA%THEN
 5080IFSectorsPerDisc%>IDEAddressSpace%THENSectorsPerDisc%=IDEAddressSpace%
 5090ELSE
 5100IFSectorsPerDisc%>IDECapacity%THENSectorsPerDisc%=IDECapacity%
 5110ENDIF
 5130DiscSize%=(SectorsPerDisc%AND((1<<(32-Log2SecSize%))-1))<<Log2SecSize%
 5140DiscSize2%=(SectorsPerDisc%>>(32-Log2SecSize%))
 5160IF(DiscSize%>=(512*1024*1024))OR(DiscSize2%<>0)THEN
 5170BigDisc%=TRUE
 5180ELSE
 5190BigDisc%=FALSE
 5200ENDIF
 5220DiscRec%!&10=DiscSize%
 5230DiscRec%!&24=DiscSize2%
 5240DiscRec%?&28=Log2ShareSize%
 5270IF((DiscSize%AND&E0000000)<>0OR(DiscSize2%<>0))THEN
 5280DiscRec%?&29=1
 5290ELSE
 5300DiscRec%?&29=0
 5310ENDIF
 5330FORI%=0TOBootSize%-4STEP4
 5340Defect%!I%=Boot%!I%
 5350NEXTI%
 5360Boot%!0=EndDefect%
 5370REPEAT
 5380ptr%=0
 5390defectlist%=0
 5400IFBigDisc%THEN
 5410IFDefect%!ptr%>=EndDefect%THEN
 5420IFDefect%!(ptr%+4)<EndDefect2%PROCmessage_print_0("CurrentDefects")
 5430ELSE
 5440PROCmessage_print_0("CurrentDefects")
 5450ENDIF
 5460ELSE
 5470IFDefect%!(ptr%)<EndDefect%PROCmessage_print_0("CurrentDefects")
 5480ENDIF
 5490WHILE((Defect%!ptr%<EndDefect%)ANDNOTBigDisc%)OR(Defect%!ptr%<EndDefect2%AND BigDisc%)
 5500IF((Defect%!ptr%AND&E0000000)=EndDefect%)THEN
 5510ptr%+=4
 5520defectlist%=1
 5530ELSE
 5540IFdefectlist%=0THEN
 5550defect%=Defect%!ptr%
 5560defect%=defect%DIVSecSize%
 5570sector%=(defect%MODSecsPerTrk%)+LowSector%
 5580defect%=defect%DIVSecsPerTrk%
 5590PRINTTAB(((ptr%DIV4)MOD6)*13);"(";defect%DIVHeads%;",";defect%MODHeads%;",";sector%;")";
 5600ptr%=ptr%+4
 5610ELSE
 5620defect%=Defect%!ptr%
 5630sector%=(defect%MODSecsPerTrk%)+LowSector%
 5640defect%=defect%DIVSecsPerTrk%
 5650PRINTTAB((((ptr%-4)DIV4)MOD6)*13);"(";defect%DIVHeads%;",";defect%MODHeads%;",";sector%;")";
 5660ptr%=ptr%+4
 5670ENDIF
 5680ENDIF
 5690ENDWHILE
 5700IFBigDisc%THEN
 5710Defects%=(ptr%DIV4)-1
 5720ELSE
 5730Defects%=ptr%DIV4
 5740ENDIF
 5750IFINSTR(autoreply$,"NOadddefects")=0THEN
 5760PRINT:PRINT
 5770PROCmessage_print_0("DefectNoMore")
 5780PROCmessage_print_0("DefectAdd")
 5790IFNewMap%THEN
 5800PROCmessage_print_0("DefectAddDisc")
 5810ELSE
 5820PROCmessage_print_0("DefectAddLogical")
 5830ENDIF
 5840PROCmessage_print_0("DefectRemove")
 5850ENDIF
 5860opt$=FNChoose("Q07:","ABCDChoose","ABCD","")
 5870PRINT
 5880CASEopt$OF
 5890WHEN"B","D"
 5900cyl%=FNInputDec("CylinderDec",0,Cyls%-1)
 5910head%=FNInputDec("HeadDec",0,Heads%-1)
 5920IFIDE%THEN
 5930sector%=FNInputDec("SectorDec",1,SecsPerTrk%)
 5940ELSE
 5950sector%=FNInputDec("IndexMFMDec",1-SecsPerTrk%,&10000)
 5960IFsector%>=0THEN
 5970sector%=sector%DIV320
 5980ELSE
 5990sector%=-sector%
 6000ENDIF
 6010ENDIF
 6020defect%=((cyl%*Heads%+head%)*SecsPerTrk%+(sector%-LowSector%))
 6030IFopt$="B"THEN
 6040PROCAddPhysDefect(defect%)
 6050ELSE
 6060PROCRemovePhysDefect(defect%)
 6070ENDIF
 6080WHEN"C"
 6090IFNewMap%THEN
 6100PROCAddPhysDefect((FNInputHex2("DiscAddrHex")))
 6110ELSE
 6120PROCmessage_print_0("DFormatDefect1")
 6130PROCmessage_print_0("DFormatDefect2")
 6140PROCmessage_print_0("DFormatDefect3")
 6150defect%=(FNInputHex("LogicalAddrHex")DIVSecSize%)
 6160PROCAddPhysDefect(FNLogToPhys(defect%))
 6170ENDIF
 6180ENDCASE
 6190UNTILLEFT$(opt$,1)="A"
 6200FORI%=0TODiscStruc%-4STEP4
 6210BootRec%!I%=DiscRec%!I%
 6220NEXTI%
 6230PROCInitHardDesc
 6240ENDPROC
 6260DEFPROCFormat
 6270TIME=0
 6280LOCALI%,J%,cyl%,head%
 6290PROCMoanOp(Specify%,0,0,0)
 6300PROCMoanOp(Restore%,0,0,0)
 6320PROCmessage_print_0("Formatting")
 6330IFIDE%THEN
 6340FORI%=0TO512-4STEP4:Buf%!I%=0:NEXT
 6350FORI%=0TOSecsPerTrk%-1
 6360Buf%?(2*I%+0)=&00
 6370Buf%?(2*I%+1)=I%+1
 6380NEXT
 6390ELSE
 6400FORI%=0TO512-4STEP4:Buf%!I%=&077F03FF:NEXT
 6410ENDIF
 6420FORcyl%=0TOCyls%-1
 6430VDU13:PRINTcyl%;
 6440FORhead%=0TOHeads%-1
 6450IFcyl%<>0ORhead%<>0ORNOTFormatted%THEN
 6460IFNOTIDE%THEN
 6470J%=cyl%OR(head%<<24)
 6480FORI%=0TO(SecsPerTrk%-1)*4STEP4:Buf%!I%=J%OR(I%<<14):NEXT
 6490ENDIF
 6510PROCOp(WriteTrack%,(cyl%*Heads%+head%)*SecsPerTrk%,Buf%,512)
 6520IFResult%PROCmessage_print_0("FormatError")
 6530ENDIF
 6540NEXT
 6550NEXT
 6560ENDPROC
 6580DEFPROCVerify
 6590IFSoakFlag%PROCmessage_print_0("SoakPrompt")
 6600LOCALadd%,ptr%,sector%,head%,cyl%,defectlist%
 6610Cycle%=1:ErrorCycle%=-100
 6620CylSize%=SecsPerTrk%*Heads%
 6630suspects%=0:MaxSuspects%=1000
 6640DIMCylBuf%CylSize%+4,SusAdd%(MaxSuspects%),SusCount%MaxSuspects%
 6650VDU13:PROCmessage_print_0("Verifying")
 6660REPEAT
 6670IFCycle%>1THEN
 6680I%=Cycle%MODPatterns%
 6690IFI%>1THEN
 6700J%=Pattern%(I%)
 6710J%=(J%>>>1)OR((J%AND 1)<<23)
 6720Pattern%(I%)=J%
 6730ELSE
 6740J%=RND(&1000000)-1
 6750ENDIF
 6760IFNOTSoakFlag%THEN
 6770VDU13
 6780PROCmessage_print_1("Pattern",STR$~(J%))
 6790ENDIF
 6800FORI%=CylBuf%TOCylBuf%+CylSize%STEP3:!I%=J%:NEXT
 6810ptr%=0
 6820defectlist%=0
 6830IFBigADFS%THEN
 6840IFFormatted%add%=SecsPerTrk%ELSEadd%=0
 6850ELSE
 6860IFFormatted%add%=SecSize%*SecsPerTrk%ELSEadd%=0
 6870ENDIF
 6880REPEAT
 6890IFDefect%!ptr%>EndDefect%AND Defect%!ptr%<EndDefect2%AND BigADFS%AND BigDisc%AND defectlist%=0THEN
 6900ptr%+=4
 6910defectlist%=1
 6920ENDIF
 6940CylEnd%=add%-(add%MODCylSize%)+CylSize%
 6960IF(defectlist%=1)THEN
 6980defect%=Defect%!ptr%
 6990ELSE
 7010defect%=(Defect%!ptr%)DIVSecSize%
 7020ENDIF
 7040IFdefect%>CylEnd%ORdefect%<add%THEN
 7050length%=(CylEnd%-add%)*SecSize%
 7060ELSE
 7070length%=(defect%-add%)*SecSize%
 7080ENDIF
 7100PROCOp(Write%,add%,0,length%)
 7120IFResult%THEN
 7130IFBigADFS%THEN
 7140add%=(ErrDiscAdd%AND&1FFFFFFF)+1
 7150ELSE
 7160add%=((ErrDiscAdd%AND&1FFFFF00)DIVSecSize%)+1
 7170ENDIF
 7180ELSE
 7190add%+=length%
 7200ENDIF
 7210IFadd%=defect%THENadd%+=1:ptr%+=4
 7220UNTILadd%>=SectorsPerDisc%
 7230ENDIF
 7240IFSoakFlag%PRINT".";
 7270add%=0
 7280ptr%=0
 7290defectlist%=0
 7300PROCMoanOp(Restore%,0,0,0)
 7310REPEAT
 7320IFdefectlist%=0THEN
 7330REPEAT
 7340IF(Defect%!ptr%AND&E0000000)<>EndDefect%THEN
 7350IF((Defect%!ptr%)DIVSecSize%)<add%THEN
 7360ptr%+=4
 7370ENDIF
 7380ELSE
 7390IFBigDisc%THEN
 7400defectlist%=1
 7410ptr%+=4
 7420ENDIF
 7430ENDIF
 7440UNTILdefectlist%=1OR((Defect%!ptr%)DIVSecSize%)>=add%
 7450ENDIF
 7460IFdefectlist%=1THEN
 7470WHILEDefect%!ptr%<add%
 7480ptr%+=4
 7490ENDWHILE
 7500ENDIF
 7510IFdefectlist%=0THEN
 7520defect%=(Defect%!ptr%)DIVSecSize%
 7530ELSE
 7540defect%=Defect%!ptr%
 7550ENDIF
 7570IFdefect%>SectorsPerDisc%THEN
 7580length%=SectorsPerDisc%-add%
 7590ELSE
 7600length%=defect%-add%
 7610ENDIF
 7630PROCOp(Verify%,add%,0,length%*SecSize%)
 7650IFResult%THEN
 7660IFBigADFS%THEN
 7670add%=ErrDiscAdd%AND&1FFFFFFF
 7680ELSE
 7690add%=(ErrDiscAdd%AND&1FFFFF00)DIVSecSize%
 7700ENDIF
 7710Try%=0
 7720REPEAT
 7730Try%+=1
 7740PROCMoanOp(Restore%,0,0,0)
 7750PROCOp(Verify%,add%,0,SecSize%)
 7770UNTILResult%=0ORTry%=5
 7780IFResult%Try%+=1
 7790sector%=add%
 7800head%=sector%DIVSecsPerTrk%
 7810sector%=sector%MODSecsPerTrk%
 7820cyl%=head%DIVHeads%
 7830head%=head%MODHeads%
 7840PROCmessage_print_3("VerifyData",STR$(cyl%),STR$(head%),STR$(sector%+LowSector%))
 7850sus%=0
 7860WHILEsus%<suspects%AND SusAdd%(sus%)<>add%:sus%+=1:ENDWHILE
 7870IFsus%=suspects%THEN
 7880IFsuspects%=MaxSuspects%THEN
 7890sus%=RND(MaxSuspects%)-1
 7900ELSE
 7910suspects%+=1
 7920ENDIF
 7930SusAdd%(sus%)=add%
 7940SusCount%?sus%=0
 7950ENDIF
 7960score%=2^(Try%-1)-1
 7970IFNOTSoakFlag%score%=score%*4
 7980SusCount%?sus%+=score%
 7990IF(SusCount%?sus%>30)ORdev%THEN
 8000IFSoakFlag%THEN
 8010PROCmessage_print_1("DefectTIME",TIME$)
 8020ELSE
 8030PROCmessage_print_0("Defect")
 8040ENDIF
 8050PROCAddPhysDefect(add%)
 8060ErrorCycle%=Cycle%
 8070ELSE
 8080IFSoakFlag%THEN
 8090TIME=0:REPEATUNTILTIME>500:VDU13:PRINTSPC(78);:VDU13
 8100ELSE
 8110PROCmessage_print_1("Retries",STR$(Try%))
 8120ENDIF
 8130ENDIF
 8140add%=add%+1
 8150ELSE
 8160add%=add%+length%+1
 8170ENDIF
 8180IFadd%>defect%THEN
 8190ptr%+=4
 8200ENDIF
 8210UNTILadd%>=SectorsPerDisc%
 8220IFSoakFlag%THEN
 8230REPEAT
 8240Key%=INKEY(0)
 8250UNTILKey%=-1ORKey%=32
 8260done%=(Key%=32)
 8270ELSE
 8280done%=Cycle%>ErrorCycle%+2
 8290ENDIF
 8300Cycle%+=1
 8310IFSoakFlag%VDU&2E
 8320UNTILdone%
 8330ENDPROC
 8360DEFPROCStructure
 8370IFNewMap%THEN
 8380PROCNewStructure
 8390ELSE
 8400PROCOldStructure
 8410ENDIF
 8420ENDPROC
 8450DEFPROCOldStructure
 8460PROCWriteDefectList
 8470PROCWriteOldFsMap
 8480PROCWriteRootDir
 8490ENDPROC
 8520DEFFNRoundUpShare(Secs%)
 8530IFLog2ShareSize%=0THEN=Secs%
 8540=((Secs%+ShareSize%-1)DIVShareSize%)*ShareSize%
 8580DEFFNMapBits(Secs%,Lg%,Lg2SecSize%)
 8590LOCALShift%
 8600Shift%=Lg2SecSize%-Lg%
 8610IF(Shift%>0)THEN
 8620=Secs%<<Shift%
 8630ELSE
 8640=Secs%>>(-Shift%)
 8650ENDIF
 8670DEFFNRoundSectors(Bits%,Lg%,Lg2SecSize%)
 8680LOCALShift%
 8690Shift%=Lg2SecSize%-Lg%
 8700IF(Shift%>0)THEN
 8710=Bits%>>(Shift%)
 8720ELSE
 8730=Bits%<<(-Shift%)
 8740ENDIF
 8760DEFFNdoalloc(Verbose%)
 8770Log2Alloc%=Log%
 8780PROCShareSize
 8790MapBits%=FNMapBits(SectorsPerDisc%,Log2Alloc%,Log2SecSize%)
 8800RoundSectors%=FNRoundSectors(MapBits%,Log2Alloc%,Log2SecSize%)
 8810BestZones%=1<<30
 8820BestCylOff%=1<<30
 8830FORDummySpare%=1TO1
 8840FORSpareBits%=4*8TOZoneBits%-Zone0Bits%-8*8
 8850PROCCalcZones
 8860LinkBits%=10
 8870REPEATLinkBits%+=1
 8880PROCCalcIds
 8890UNTILIds%<=2^LinkBits%AND LinkBits%>=(Log2SecSize%+3)
 8900IFSpareBits%-4*8>0AND SpareBits%-4*8<=LinkBits%NEXTSpareBits%
 8910IFOddBits%>0AND OddBits%<=LinkBits%NEXTSpareBits%
 8920IFLinkBits%>15ORZones%>127THEN
 8930IFVerbose%THENPROCmessage_print_0("TooSmallAlloc")
 8940Log2Alloc%+=1
 8950NEXTDummySpare%
 8960=FALSE
 8970ENDIF
 8980IFZones%<=BestZones%THEN
 8990Crucial%=FNRoundUpShare(Zones%*2)*SecSize%+DirSize%
 9000IFMapZone%=0 Crucial%=BootAdd%*SecSize%+BootSize%
 9010IFCrucial%<Alloc%*(LinkBits%+1)Crucial%=Alloc%*(LinkBits%+1)
 9020CrucialEnd%=MapAdd%+Crucial%/SecSize%
 9030defectlist%=0
 9040DefPtr%=Defect%
 9050REPEAT
 9060defect%=!DefPtr%
 9070DefPtr%+=4
 9080IFdefect%>=EndDefect%AND defectlist%=0AND BigDisc%THEN
 9090defect%=!DefPtr%
 9100DefPtr%+=4
 9110defectlist%=1
 9120ENDIF
 9130IFdefectlist%=0AND defect%<EndDefect%THENdefect%=defect%/SecSize%
 9140UNTILdefect%>=EndDefect%OR(defect%>=MapAdd%AND defect%<CrucialEnd%)
 9150CylOff%=MapAdd%MOD(SecsPerTrk%*Heads%)
 9160IFdefect%>=EndDefect%AND CylOff%<BestCylOff%THEN
 9170BestCylOff%=CylOff%
 9180BestLinkBits%=LinkBits%
 9190BestSpare%=SpareBits%
 9200BestZones%=Zones%
 9210ENDIF
 9220IFBestCylOff%NEXTSpareBits%
 9230NEXTDummySpare%
 9240ELSE
 9250NEXTDummySpare%
 9260ENDIF
 9270IFBestZones%=(1<<30)AND Verbose%=TRUETHENPROCmessage_print_0("InvalidAllocSize"):=FALSE
 9280=TRUE
 9300DEFPROCNewStructure
 9310Zone0Bits%=60*8
 9320ZoneBits%=SecSize%*8
 9330Log2Alloc%=9
 9340PROCShareSize
 9350IFLog2Alloc%<8THENLog2Alloc%=10:PROCShareSize
 9380Alloc%=2^Log2Alloc%:Log%=Log2Alloc%
 9390WHILEFNdoalloc(FALSE)=FALSE
 9400Alloc%=2^Log2Alloc%:Log%=Log2Alloc%
 9410ENDWHILE
 9430PRINT
 9440REPEAT
 9450Alloc%=FNAsk("AllocUnitAsk",2^Log2Alloc%,256)
 9460Log%=7
 9470REPEAT
 9480Log%+=1
 9490UNTILAlloc%=2^Log%
 9510UNTILFNdoalloc(TRUE)
 9530PRINT
 9540LinkBits%=BestLinkBits%
 9550SpareBits%=BestSpare%
 9560PROCCalcZones
 9570PROCCalcIds
 9580Crucial%=FNRoundUpShare(Zones%*2)*SecSize%+DirSize%
 9590IFMapZone%=0 Crucial%=BootAdd%*SecSize%+BootSize%
 9600IFCrucial%<Alloc%*(LinkBits%+1)Crucial%=Alloc%*(LinkBits%+1)
 9610IFCrucial%MODAlloc%<>0 Crucial%+=Alloc%-Crucial%MODAlloc%
 9620IFMapZone%=0THEN
 9630RootDirAdd%=BootAdd%+BootSize%/SecSize%
 9640IndRootDirAdd%=&200+(BootAdd%*SecSize%+BootSize%)DIVSecSize%+1
 9650ELSE
 9660RootDirAdd%=MapAdd%+FNRoundUpShare((MapLen%*2)/SecSize%)
 9670IndRootDirAdd%=&200+FNRoundUpShare(Zones%*2)/ShareSize%+1
 9680ENDIF
 9690DiscRec%?4=LinkBits%
 9700DiscRec%?5=Log2Alloc%
 9710IFBootOpt$="Y"THENDiscRec%!7=2ELSEDiscRec%!7=0
 9720DiscRec%?8=LowSector%
 9730DiscRec%?9=Zones%
 9740DiscRec%?&A=SpareBits%MOD256
 9750DiscRec%?&B=SpareBits%DIV256
 9760DiscRec%!&C=IndRootDirAdd%
 9770DiscRec%?&28=Log2ShareSize%
 9780BootRec%!4=DiscRec%!4
 9790BootRec%!8=DiscRec%!8
 9800BootRec%!&C=DiscRec%!&C
 9810BootRec%!&24=DiscRec%!&24
 9820BootRec%!&28=DiscRec%!&28
 9830FORI%=0TOZones%*SecSize%-4STEP4
 9840Buf%!I%=0
 9850NEXTI%
 9860FORI%=0TO60-4STEP4
 9870Buf%!(I%+4)=DiscRec%!I%
 9880NEXTI%
 9890PROCWriteDefectList
 9900PROCmessage_print_0("CreatingMap")
 9910ptr%=0
 9920DefectStart%=0
 9930defectlist%=0
 9940DiscEndBit%=FNDiscToMap(SectorsPerDisc%)
 9950ZoneStart%=Buf%
 9960ZoneStartBit%=0
 9970BootStartBit%=0
 9980BootEndBit%=0
 9990MapStartBit%=0
10000MapEndBit%=0
10010FORzone%=0TOZones%-1
10020!ZoneStart%=1<<(15+FreeLink%*8)
10030ZoneEndBit%=ZoneStartBit%+ZoneBits%
10040UsedZoneEndBit%=ZoneEndBit%-SpareBits%+4*8
10050IFUsedZoneEndBit%>DiscEndBit%THEN
10060UsedZoneEndBit%=DiscEndBit%
10070ENDIF
10080PreFree%=ZoneStartBit%+FreeLink%*8
10090ZoneBit%=ZoneStartBit%+4*8
10100IFzone%=0THEN
10110BootStartBit%=ZoneBit%
10120ZoneBit%=ZoneBit%+Zone0Bits%
10130length%=(BootAdd%*SecSize%+BootSize%)DIVAlloc%
10140IFlength%<LinkBits%+1 length%=LinkBits%+1
10150PROCWriteLink(ZoneBit%,2)
10160PROCWriteLength(ZoneBit%,length%)
10170ZoneBit%=ZoneBit%+length%
10180BootEndBit%=ZoneBit%
10190ELSE
10200IFzone%=MapZone%THEN
10210MapStartBit%=ZoneBit%
10220length%=Crucial%DIVAlloc%
10230PROCWriteLink(ZoneBit%,2)
10240PROCWriteLength(ZoneBit%,length%)
10250ZoneBit%=ZoneBit%+length%
10260MapEndBit%=ZoneBit%
10270ENDIF
10280ENDIF
10290REPEAT
10310IFZoneBit%>DefectStart%THEN
10320IFdefectlist%=0THEN
10330IFDefect%!ptr%>=EndDefect%AND BigDisc%THEN
10340ptr%+=4
10350defectlist%=1
10360DefectStart%=FNDiscToMap(Defect%!ptr%)
10370ELSE
10380DefectStart%=FNDiscToMap((Defect%!ptr%)/SecSize%)
10390ENDIF
10400ELSE
10410DefectStart%=FNDiscToMap(Defect%!ptr%)
10420ENDIF
10430WHILE((zone%=0AND(DefectStart%>=BootStartBit%AND DefectStart%<BootEndBit%)))OR((zone%=MapZone%AND(DefectStart%>=MapStartBit%AND DefectStart%<MapEndBit%)))
10440IFdefectlist%=0THEN
10450defectaddr$=FNhexaddr((Defect%!ptr%)/SecSize%)
10460ELSE
10470defectaddr$=FNhexaddr(Defect%!ptr%)
10480ENDIF
10490IFzone%=0THEN
10500PROCmessage_print_1("BootDefectError",defectaddr$)
10510ELSE
10520PROCmessage_print_1("MapDefectError",defectaddr$)
10530ENDIF
10540ptr%+=4
10550IFdefectlist%=0THEN
10560IFDefect%!ptr%>=EndDefect%THEN
10570ptr%+=4
10580defectlist%=1
10590DefectStart%=FNDiscToMap(Defect%!ptr%)
10600ELSE
10610DefectStart%=FNDiscToMap((Defect%!ptr%)/SecSize%)
10620ENDIF
10630ELSE
10640DefectStart%=FNDiscToMap(Defect%!ptr%)
10650ENDIF
10660ENDWHILE
10670IFDefectStart%>=UsedZoneEndBit%THEN
10680DefectStart%=ZoneEndBit%
10690ELSE
10700DefectEnd%=DefectStart%+1
10710ptr%+=4
10720REPEAT
10730done1%=TRUE
10740REPEAT
10750done2%=TRUE
10760IFdefectlist%=1THEN
10770NextDefect%=FNDiscToMap(Defect%!ptr%)
10780ELSE
10790NextDefect%=FNDiscToMap((Defect%!ptr%)/SecSize%)
10800ENDIF
10810IFNextDefect%<UsedZoneEndBit%THEN
10820IFNextDefect%>ZoneEndBit%-(LinkBits%+1)THEN
10830NextDef%=ZoneEndBit%-(LinkBits%+1)
10840ELSE
10850NextDef%=NextDefect%
10860ENDIF
10870IFNextDef%-DefectEnd%<LinkBits%+1THEN
10880IFNextDefect%+1>DefectEnd%THEN
10890DefectEnd%=NextDefect%+1
10900ENDIF
10910ptr%+=4
10920done2%=FALSE
10930ENDIF
10940ENDIF
10950UNTILdone2%
10960IFDefectEnd%-DefectStart%<LinkBits%+1THEN
10970DefectEnd%=DefectStart%+LinkBits%+1
10980IFDefectEnd%>ZoneEndBit%THEN
10990DefectEnd%=ZoneEndBit%
11000ENDIF
11010done1%=FALSE
11020ENDIF
11030IFDefectEnd%>ZoneEndBit%-(LinkBits%+1)AND DefectEnd%<>ZoneEndBit%THEN
11040DefectEnd%=ZoneEndBit%
11050done1%=FALSE
11060ENDIF
11070IFDefectEnd%-DefectStart%<LinkBits%+1THEN
11080DefectStart%=DefectEnd%-(LinkBits%+1)
11090ENDIF
11100UNTILdone1%
11110ENDIF
11120ENDIF
11130IFZoneBit%>DefectStart%PROCmessage_print_0("ERROR1"):PROCfinish
11140IFDefectStart%-ZoneBit%<=LinkBits%THENDefectStart%=ZoneBit%
11150IFDefectStart%>ZoneBit%THEN
11160PROCWriteLink(PreFree%,ZoneBit%-PreFree%)
11170IFDefectStart%>=UsedZoneEndBit%THEN
11180PROCWriteLength(ZoneBit%,UsedZoneEndBit%-ZoneBit%)
11190IFZoneEndBit%>UsedZoneEndBit%THEN
11200PROCWriteLink(UsedZoneEndBit%,1)
11210PROCWriteLength(UsedZoneEndBit%,ZoneEndBit%-UsedZoneEndBit%)
11220ENDIF
11230ELSE
11240PROCWriteLength(ZoneBit%,DefectStart%-ZoneBit%)
11250ENDIF
11260PreFree%=ZoneBit%
11270ENDIF
11280IFDefectStart%<ZoneEndBit%THEN
11290IFDefectEnd%>UsedZoneEndBit%-(LinkBits%+1)THEN
11300DefectEnd%=ZoneEndBit%
11310ENDIF
11320PROCWriteLink(DefectStart%,1)
11330PROCWriteLength(DefectStart%,DefectEnd%-DefectStart%)
11340ZoneBit%=DefectEnd%
11350ELSE
11360ZoneBit%=ZoneEndBit%
11370ENDIF
11380UNTILZoneBit%=ZoneEndBit%
11390PROCWriteLink(PreFree%,0)
11400IFzone%=0THEN
11410ZoneStart%?CrossCheck%=&FF
11420ELSE
11430ZoneStart%?CrossCheck%=0
11440ENDIF
11450?ZoneStart%=FNNewMapCheck(ZoneStart%,SecSize%)
11460ZoneStart%=ZoneStart%+SecSize%
11470ZoneStartBit%=ZoneEndBit%
11480NEXTzone%
11490PROCmessage_print_0("WritingMap")
11500PROCMoanOp(Write%,MapAdd%,Buf%,MapLen%)
11510PROCMoanOp(Write%,MapAdd%+MapLen%/SecSize%,Buf%,MapLen%)
11520PROCWriteRootDir
11530ENDPROC
11550DEFPROCCalcZones
11560UsedBits%=SecSize%*8-SpareBits%
11570WholeZones%=(MapBits%+Zone0Bits%)DIVUsedBits%
11580OddBits%=(MapBits%+Zone0Bits%)MODUsedBits%
11590IFOddBits%Zones%=WholeZones%+1ELSEZones%=WholeZones%
11600MapZone%=Zones%DIV2
11610IFMapZone%=0THEN
11620MapAdd%=0
11630ELSE
11640IF(Alloc%>SecSize%)THEN
11650MapAdd%=(UsedBits%*MapZone%-Zone0Bits%)*(Alloc%DIVSecSize%)
11660ELSE
11670MapAdd%=(UsedBits%*MapZone%-Zone0Bits%)DIV(SecSize%DIVAlloc%)
11680ENDIF
11690ENDIF
11700MapLen%=Zones%*SecSize%
11710ENDPROC
11730DEFPROCCalcIds
11740IdsPerZone%=UsedBits%DIV(LinkBits%+1)
11750Ids%=IdsPerZone%*WholeZones%+OddBits%DIV(LinkBits%+1)
11760ENDPROC
11810DEFFNDiscToMap(discadd%)
11820LOCALbit%,zone%
11830IF(Alloc%>SecSize%)
11840bit%=(discadd%DIV(Alloc%DIVSecSize%))+Zone0Bits%
11850ELSE
11860bit%=(discadd%*(SecSize%DIVAlloc%))+Zone0Bits%
11870ENDIF
11880zone%=bit%DIVUsedBits%
11890bit%=bit%+(bit%DIVUsedBits%)*SpareBits%+4*8
11900=bit%
11930DEFPROCWriteLink(off%,link%)
11940IFlink%>=2^LinkBits%PROCmessage_print_0("ERROR2"):PROCfinish
11950LOCALbit%,add%,mask%
11960bit%=off%MOD8
11970add%=Buf%+off%DIV8
11980mask%=2^LinkBits%-1
11990!add%=(!add%ANDNOT(mask%<<bit%))ORlink%<<bit%
12000ENDPROC
12020DEFPROCWriteLength(off%,len%)
12030IFlen%<=LinkBits%PROCmessage_print_0("ERROR3"):PROCfinish
12040off%=off%+len%-1
12050Buf%?(off%DIV8)+=2^(off%MOD8)
12060ENDPROC
12080DEFPROCWriteDefectList
12090PROCmessage_print_0("WritingDefects")
12100ptr%=0
12110check%=0
12120WHILEDefect%!ptr%<EndDefect%
12130Boot%!ptr%=Defect%!ptr%
12140PROCCheckPut(Boot%!ptr%)
12150ptr%=ptr%+4
12160ENDWHILE
12170check%=check%EOR(check%>>>16)
12180check%=(check%EOR(check%>>>8))AND&FF
12190Boot%!ptr%=EndDefect%ORcheck%
12220IFBigDisc%THEN
12230ptr%+=4
12240check%=0
12250WHILEDefect%!ptr%<EndDefect%
12260Boot%!ptr%=Defect%!ptr%
12270PROCCheckPut(Boot%!ptr%)
12280ptr%=ptr%+4
12290ENDWHILE
12300check%=check%EOR(check%>>>16)
12310check%=(check%EOR(check%>>>8))AND&FF
12320Boot%!ptr%=EndDefect2%ORcheck%
12330ENDIF
12360WHILEptr%<(MaxDefects%*4)
12370ptr%=ptr%+4
12380Boot%!ptr%=0
12390ENDWHILE
12400PROCSum(Boot%,BootSize%)
12410PROCMoanOp(Write%,BootAdd%,Boot%,BootSize%)
12420ENDPROC
12440DEFPROCWriteOldFsMap
12450PROCmessage_print_0("WritingFreeSpace")
12460LOCALs%,I%
12470s%=OldMapSize%DIV2
12480FORI%=0TOOldMapSize%-4STEP4:Buf%!I%=0:NEXT
12490!Buf%=OldLWM%DIV&100
12500Buf%!s%=(DiscSize%-OldLWM%-Defects%*SecSize%)DIV&100
12510!(Buf%+s%-4)=DiscSize%DIV&100
12520!(Buf%+OldMapSize%-5)=RND(&10000)-1
12530!(Buf%+OldMapSize%-2)=3
12540PROCSum(Buf%,s%)
12550PROCSum(Buf%+s%,s%)
12560PROCMoanOp(Write%,OldMapAdd%p,Buf%,OldMapSize%)
12570ENDPROC
12590DEFPROCWriteRootDir
12600PROCmessage_print_0("WritingRootDir")
12610LOCALBF%
12620FORI%=0TODirSize%-4STEP4:Buf%!I%=0:NEXT
12630IFNewMap%THEN
12640$DirMark%="Hugo"
12650ELSE
12660$DirMark%="Hugo"
12670ENDIF
12680Buf%!1=!DirMark%
12690BF%=Buf%+DirSize%
12700IFNewMap%THEN
12710BF%!-38=IndRootDirAdd%
12720ELSE
12730BF%!-38=IndRootDirAdd%DIV&100
12740ENDIF
12750BF%?-35=ASC"$"
12760BF%?-16=ASC"$"
12770BF%!-5=!DirMark%
12780check%=0
12790PROCCheckPut(!Buf%)
12800PROCCheckPut(Buf%?4)
12810I%=BF%-40
12820WHILEI%AND3
12830PROCCheckPut(?I%)
12840I%=I%+1
12850ENDWHILE
12860WHILEI%<BF%-4
12870PROCCheckPut(!I%)
12880I%=I%+4
12890ENDWHILE
12900check%=check%EOR(check%>>>16)
12910check%=(check%EOR(check%>>>8))AND&FF
12920BF%?-1=check%
12930PROCMoanOp(Write%,RootDirAdd%,Buf%,DirSize%)
12940ENDPROC
12960DEFFNLogToPhys(add%)
12970LOCALptr%
12980ptr%=0
12990WHILEadd%>=(Defect%!ptr%)DIVSecSize%
13000ptr%=ptr%+4
13010add%=add%+SecSize%
13020ENDWHILE
13030=add%
13090DEFPROCAddPhysDefect(add%)
13100LOCALptr%,ptr2%,defect%,defectlist%
13120IF(add%>=SectorsPerDisc%)THEN
13130PROCmessage_print_0("DefectTooBig")
13140ELSE
13150IFNOTBigDisc%THEN
13170IFDefects%<MaxDefects%THEN
13180WHILE((Defect%!ptr%)DIVSecSize%)<add%
13190ptr%=ptr%+4
13200ENDWHILE
13210defect%=(Defect%!ptr%)/SecSize%
13220IFdefect%=add%THEN
13230PROCmessage_print_0("ExistingDefect")
13240ELSE
13250ptr2%=Defects%*4
13260WHILEptr2%>=ptr%
13270Defect%!(ptr2%+4)=Defect%!ptr2%
13280ptr2%=ptr2%-4
13290ENDWHILE
13300Defect%!ptr%=add%*SecSize%
13310Defects%=Defects%+1
13320ENDIF
13330ELSE
13340PROCmessage_print_0("FullDefectList")
13350ENDIF
13360ELSE
13380IFDefects%<BigMaxDefects%THEN
13390IF((add%*SecSize%)AND&E0000000)=0AND(add%>>>(32-Log2SecSize%))=0THEN
13410defectlist%=0
13420ELSE
13440defectlist%=1
13450WHILE(Defect%!ptr%<EndDefect%)
13460ptr%+=4
13470ENDWHILE
13480ptr%+=4
13490ENDIF
13500IFdefectlist%=1THEN
13510WHILE(Defect%!ptr%)<add%
13520ptr%+=4
13530ENDWHILE
13540ELSE
13550WHILE((Defect%!ptr%)/SecSize%)<add%
13560ptr%+=4
13570ENDWHILE
13580ENDIF
13590IFdefectlist%=0THEN
13600defect%=(Defect%!ptr%)/SecSize%
13610ELSE
13620defect%=(Defect%!ptr%)
13630ENDIF
13640IFdefect%=add%THEN
13650PROCmessage_print_0("ExistingDefect")
13660ELSE
13670ptr2%=Defects%*4+4
13680WHILEptr2%>=ptr%
13690Defect%!(ptr2%+4)=Defect%!ptr2%
13700ptr2%=ptr2%-4
13710ENDWHILE
13720IFdefectlist%=0THEN
13730Defect%!ptr%=add%*SecSize%
13740ELSE
13750Defect%!ptr%=add%
13760ENDIF
13770Defects%=Defects%+1
13780ENDIF
13790ELSE
13800PROCmessage_print_0("FullDefectList")
13810ENDIF
13820ENDIF
13830ENDIF
13840ENDPROC
13870DEFPROCRemovePhysDefect(add%)
13880LOCALptr%,ptr2%,defect%,defectlist%
13890ptr%=0
13900defectlist%=1
13910WHILE((Defect%!ptr%)/SecSize%)<add%AND(Defect%!ptr%<EndDefect%)
13920ptr%=ptr%+4
13930ENDWHILE
13940IFDefect%!ptr%>=EndDefect%THEN
13950defectlist%=2
13960ptr%+=4
13970WHILE(Defect%!ptr%)<add%AND(Defect%!ptr%)<EndDefect%
13980ptr%=ptr%+4
13990ENDWHILE
14000ENDIF
14010IFdefectlist%=1THEN
14020defect%=(Defect%!ptr%)/SecSize%
14030ELSE
14040defect%=Defect%!ptr%
14050ENDIF
14060IFdefect%=add%THEN
14070IFBigDisc%THEN
14080WHILEptr%<(Defects%*4+4)
14090Defect%!ptr%=Defect%!(ptr%+4)
14100ptr%=ptr%+4
14110ENDWHILE
14120Defects%=Defects%-1
14130ELSE
14140WHILEptr%<Defects%*4
14150Defect%!ptr%=Defect%!(ptr%+4)
14160ptr%=ptr%+4
14170ENDWHILE
14180Defects%=Defects%-1
14190ENDIF
14200Defects%=Defects%-1
14210ELSE
14220PROCmessage_print_0("MissingDefect")
14230ENDIF
14240ENDPROC
14300DEFFNGoodOldDefectList
14310ptr%=-4
14320check%=0
14330last%=-1
14340good%=TRUE
14350REPEAT
14360ptr%=ptr%+4
14370defect%=Boot%!ptr%
14380IFdefect%<=last%good%=FALSE
14390last%=defect%
14400IFdefect%<EndDefect%PROCCheckPut(defect%)
14410UNTIL(defect%>=EndDefect%)ORNOTgood%
14420OldDefects%=ptr%DIV4
14430check%=check%EOR(check%>>>16)
14440check%=(check%EOR(check%>>>8))AND&FF
14450=good%AND((defect%AND&FF)=check%)
14470DEFFNGoodNewDefectList
14480ptr%=4*OldDefects%
14490check%=0
14500last%=-1
14510good%=TRUE
14520REPEAT
14530ptr%=ptr%+4
14540defect%=Boot%!ptr%
14550IFdefect%<=last%good%=FALSE
14560last%=defect%
14570IFdefect%<EndDefect2%PROCCheckPut(defect%)
14580UNTIL(defect%>=EndDefect2%)ORNOTgood%
14590NewDefects%=ptr%DIV4-OldDefects%-1
14600check%=check%EOR(check%>>>16)
14610check%=(check%EOR(check%>>>8))AND&FF
14620=good%AND((defect%AND&FF)=check%)
14650DEFFNGoodDefects
14660bothgood%=FNGoodOldDefectList
14680IF((BootRec%!&10)>=(512*1024*1024)OR(BootRec%!&26)<>0)AND bothgood%THEN
14690bothgood%=bothgood%ANDFNGoodNewDefectList
14700ENDIF
14710=bothgood%AND(FNsum(Boot%,BootSize%)=Boot%?(BootSize%-1))
14750DEFPROCInitDiscRec
14760FORI%=0TO64-4STEP4
14770DiscRec%!I%=0
14780NEXTI%
14790?DiscRec%=Log2SecSize%
14800DiscRec%?1=SecsPerTrk%
14810DiscRec%?2=Heads%
14820DiscRec%?8=LowSector%
14830DiscRec%!&C=IndRootDirAdd%
14840DiscRec%!&10=DiscSize%
14850DiscRec%!&24=DiscSize2%
14860DiscRec%?&28=Log2ShareSize%
14880IF((DiscSize%AND&E0000000)<>0OR(DiscSize2%<>0))THEN
14890DiscRec%?&29=1
14900ELSE
14910DiscRec%?&29=0
14920ENDIF
14930DiscRec%!&14=RND(&10000)-1
14950$(DiscRec%+&16)="HardDisc"+STR$Drive%
14970DiscRec%?&22=Drive%
14980ENDPROC
15040DEFPROCInitBootDefects
15050!Boot%=EndDefect%
15060Boot%!4=EndDefect2%
15110OldDefects%=0
15120NewDefects%=0
15130PROCInitHardDesc
15140ENDPROC
15170DEFPROCInitHardDesc
15180IFIDE%THEN
15190BootRec%!-&10=0
15200BootRec%!-&C=0
15210BootRec%?-5=InitFlag%
15220BootRec%?-6=LBAflag%
15230ELSE
15240BootRec%!-&10=&00000000
15250BootRec%!-&C=&0D0C200A
15280BootRec%!-8=LowCurrentCyl%OR(PreCompCyl%<<16)
15290ENDIF
15320IFBigDisc%
15330BootRec%!-4=SecsPerTrk%*Heads%*ParkCyl%
15340ELSE
15350BootRec%!-4=SecSize%*SecsPerTrk%*Heads%*ParkCyl%
15360ENDIF
15380BootRec%!-&14=&FFFFFFFF
15390ENDPROC
15420DEFFNAsk(string$,Default%,min%)
15430LOCALX,Y,reply$,value%
15440IFINSTR(autoreply$,"Defaults")AND Default%>=min%THEN
15450=Default%
15460ENDIF
15470PRINT:VDU11
15480PROCmessage_print_0(string$):X=POS:Y=VPOS
15490LOCALERROR
15500ONERRORLOCALIFERR=17PROCabort(REPORT$,1)
15510REPEAT
15520PRINTTAB(X,Y);Default%;SPC3;TAB(X,Y);
15530*FX 15,1
15540INPUT""reply$
15550IFreply$=""THEN
15560value%=Default%
15570ELSE
15580value%=EVAL(reply$)
15590ENDIF
15600UNTILvalue%>=min%
15610PRINTTAB(X,Y);value%;SPC3
15620=value%
15650DEFFNInputDec(string$,min%,max%)
15660LOCALX,Y,reply$,value%
15670PRINT:VDU11
15680PROCmessage_print_2(string$,STR$(min%),STR$(max%)):X=POS:Y=VPOS
15690LOCALERROR
15700ONERRORLOCALIFERR=17PROCabort(REPORT$,1)
15710REPEAT
15720PRINTTAB(X,Y);SPC12;TAB(X,Y);:INPUT""reply$
15730value%=EVAL(reply$)
15740UNTILvalue%>=min%AND value%<=max%
15750=value%
15780DEFFNInputHex(string$)
15790LOCALX,Y,reply$,value%
15800PRINT:VDU11
15810PROCmessage_print_0(string$):X=POS:Y=VPOS
15820LOCALERROR
15830ONERRORLOCALIFERR=17PROCabort(REPORT$,1)
15840PRINTTAB(X,Y);SPC12;TAB(X,Y);:INPUT""reply$
15850=EVAL("&"+reply$)
15870DEFFNInputHex2(string$)
15880LOCALX,Y,reply$,value%
15890PRINT:VDU11
15900PROCmessage_print_0(string$):X=POS:Y=VPOS
15930PRINTTAB(X,Y);SPC12;TAB(X,Y);:INPUT""reply$
15940=FNSectorAddr(reply$)
15970DEFFNSectorAddr(reply$)
15980LOCALadd%,add2%
15990add%=0
16000add2%=0
16020WHILEINSTR("abcdefABCDEF0123456789",LEFT$(reply$,1))<>0ANDLEN(reply$)<>0
16030add2%=(add2%<<4)+(add%>>>28)
16040add%=add%<<4
16050add%=add%+EVAL("&"+LEFT$(reply$,1))
16060reply$=MID$(reply$,2)
16070ENDWHILE
16080=(add%>>>Log2SecSize%)+(add2%<<(32-Log2SecSize%))
16120DEFFNChoose(select$,string$,opt$,default$)
16130=FNchoose_no_lookup(select$,FNmessage_lookup_0(string$),opt$,default$)
16160DEFFNchoose_no_lookup(select$,String$,english_opt$,english_default$)
16170LOCALX,Y,reply$,start,end,opt$,default$
16180opt$=FNmessage_lookup_0(english_opt$)
16190IFenglish_default$<>""THEN
16200default$=MID$(opt$,INSTR(english_opt$,english_default$),1)
16210ELSE
16220default$=""
16230ENDIF
16250IFautoreply$<>""THEN
16260start=INSTR(autoreply$,select$)
16270end=INSTR(autoreply$,",",start+1)
16280IFend=0THENend=LEN(autoreply$)+1
16290IFstart=0THEN
16300PROCmessage_print_2("FailedAuto",select$,String$)
16310PROCfinish
16320ENDIF
16330start+=LEN(select$)
16340IFstart<>endTHEN
16350IFdev%PRINTString$;" ";MID$(autoreply$,start,end-start)
16360=MID$(autoreply$,start,end-start)
16370ENDIF
16380ENDIF
16390PRINT:VDU11
16400PRINTString$;:X=POS:Y=VPOS
16410REPEAT
16420REPEAT
16430PRINTTAB(X,Y);default$;SPC12;TAB(X,Y);:INPUT""reply$
16440IFreply$=""THENreply$=default$
16450UNTILLEN(reply$)=1
16460IFINSTR(opt$,reply$)=0THENreply$=CHR$(ASC(reply$)AND&DF)
16470UNTILINSTR(opt$,reply$)
16500=MID$(english_opt$,INSTR(opt$,reply$),1)
16530DEFFNreadvarval(varname$)
16540LOCALvarlen%,varbuf%
16550DIMvarbuf%256
16560SYS"XOS_ReadVarVal",varname$,varbuf%,256,0,3TO,,varlen%
16570varbuf%?varlen%=13
16580=$varbuf%
16620DEFPROCCheckPut(I%)
16630check%=(check%>>>13)EOR((check%AND(2^13-1))<<(32-13))EOR I%
16640ENDPROC
16670DEFFNsum(base%,len%)
16680sum%=0:c%=0
16690FORI%=len%-2TO0STEP-1
16700sum%=sum%+base%?I%+c%
16710IFsum%<&100 c%=0ELSEsum%=sum%AND&FF:c%=1
16720NEXTI%
16730=sum%
16750DEFPROCSum(base%,len%)
16760base%?(len%-1)=FNsum(base%,len%)
16770ENDPROC
16790DEFFNNewMapCheck(B%,C%)=USR(NewCheck%)
16810DEFPROCAsm
16820FORopt%=0TO2STEP2
16830P%=mc%
16840[OPT opt%
16850.NewCheck%
16860MOV R0,#0
16870ADDS R2,R1,R2\C=0
16880.loop%
16890LDR R3,[R2,#-4]!
16900ADCS R0,R0,R3
16910TEQS R2,R1
16920BNE loop%
16930AND R3,R3,#&FF
16940SUB R0,R0,R3
16950EOR R0,R0,R0,LSR#16
16960EOR R0,R0,R0,LSR#8
16970AND R0,R0,#&FF
16980MOVS PC,R14
16990]
17000NEXTopt%
17010ENDPROC
17030DEFPROCDisableEscape
17040SYS"XOS_Byte",200,1,0TOR0,OldEscState%
17050SYS"XOS_Byte",247,%10101010,0TOR0,OldBreakState%
17060ENDPROC
17080DEFPROCRestoreEscape
17090SYS"XOS_Byte",200,OldEscState%,0
17100SYS"XOS_Byte",247,OldBreakState%,0
17110ENDPROC
17130DEFPROCMoanOp(b%,C%,D%,E%)
17140IFBigADFS%THEN
17150SYSAdfsSwi%,0,b%ORAltDefectBit%OR(DiscRec%<<6),C%ORDrive%<<29,D%,E%
17160ELSE
17170SYSAdfsSwi%,0,b%ORAltDefectBit%OR(DiscRec%<<6),(C%*SecSize%)ORDrive%<<29,D%,E%
17180ENDIF
17190ENDPROC
17220DEFPROCOp(b%,C%,D%,E%)
17230IFBigADFS%THEN
17240SYSAdfsSwi%OR(1<<17),0,b%ORAltDefectBit%OR(DiscRec%<<6),C%ORDrive%<<29,D%,E%TOResult%,R1%,ErrDiscAdd%
17250ELSE
17260SYSAdfsSwi%OR(1<<17),0,b%ORAltDefectBit%OR(DiscRec%<<6),(C%*SecSize%)ORDrive%<<29,D%,E%TOResult%,R1%,ErrDiscAdd%
17270ENDIF
17280IFResult%THEN
17290IFVerbose%THEN
17300PRINT"(""";
17310I%=Result%+4:WHILE?I%VDU?I%:I%+=1:ENDWHILE
17320PROCmessage_print_1("OpError",STR$~(!Result%))
17330ENDIF
17340IF!Result%AND(1<<31)THEN
17350PROCmessage_print_1("Error",STR$~(Result%AND&3FFFFFFF))
17360PROCfinish
17370ELSE
17380IF((!Result%)AND&FFFFFF)=AdfsDiscErr%THEN
17390Result%=Result%?3
17400ELSE
17410PROCmessage_print_1("Error",STR$~(!Result%)):VDU32
17420I%=4
17430WHILEResult%?I%
17440VDUResult%?I%
17450I%=I%+1
17460ENDWHILE
17470PROCfinish
17480ENDIF
17490ENDIF
17500ELSE
17510ENDIF
17520ENDPROC
17550DEFFNmatchstrings(str1$,str2$)
17560LOCALII%,JJ%,LI%,LJ%
17570II%=0:LI%=LEN(str1$)
17580JJ%=0:LJ%=LEN(str2$)
17590REPEAT
17610WHILEII%<LI%ANDASC(MID$(str1$,II%+1,1))=ASC(" "):II%+=1:ENDWHILE
17620WHILEJJ%<LJ%ANDASC(MID$(str2$,JJ%+1,1))=ASC(" "):JJ%+=1:ENDWHILE
17630IFII%<LI%AND JJ%<LJ%THEN
17640IFASC(MID$(str1$,II%+1,1))<>ASC(MID$(str2$,JJ%+1,1))THEN
17650=FALSE
17660ENDIF
17670ELSE
17680IFII%=LI%EOR JJ%=LJ%=FALSE
17690ENDIF
17700IFII%<LI%II%+=1
17710IFJJ%<LJ%JJ%+=1
17720UNTILII%=LI%AND JJ%=LJ%
17730=TRUE
17770DEFPROCabort(why$,failcode%)
17780LOCALdummy$
17790LOCALERROR
17800ONERROROFF
17820IFERR=17THEN
17830PROCmessage_print_0("UserQuit")
17840PROCfinish
17850ENDIF
17870IFmsgs_file_open%THEN
17880PROCmessage_print_2("HFormFailed",why$,STR$(ERL))
17890ELSE
17900PRINT'"HFORM failed : ";why$;" at line ";ERL
17910ENDIF
17930IFINSTR(autoreply$,"NOprompts")=0THEN
17940IFmsgs_file_open%THEN
17950PROCmessage_print_0("PressKey")
17960ELSE
17970PRINT"Press Return to continue ";
17980ENDIF
17990INPUT""dummy$
18000ENDIF
18010PROCfinish
18020ENDPROC
18060DEFPROCfinish
18070*set HForm$EndStatus 20
18080PROCexit
18090ENDPROC
18130DEFPROCexit
18140PROCclose_message_file
18150END
18160ENDPROC
18190DEFPROCrestoreparams(iface%)
18200IFiface%THEN
18210PROCrestorePROD
18220ELSE
18230PROCrestoreST506
18240ENDIF
18250ENDPROC
18280DEFPROCrestorePROD
18290RESTORE+1
18300ENDPROC
18440DATA Conner Peripherals 40MB - CP3044,          TypeCP3044,     40,  4,  526, 1, 0,  525,  0
18470DATA Conner Peripherals 42MB - CP2044,          TypeCP2044PK,   38,  4,  548, 1, 0,  547,  0
18480DATA Conner Peripherals 63MB - CP2064,          TypeCP2064,     38,  4,  823, 1, 0,  822,  0
18490DATA Conner Peripherals 210MB - CFS210A,        TypeCFS210A,    38, 16,  685, 1, 0,  684,  0
18500DATA Conner Peripherals 270MB - CFS270A,        TypeCFS270A,    63, 14,  600, 1, 0,  599,  0
18510DATA Conner Peripherals 420MB - CFS420A,        TypeCFS420A,    63, 16,  826, 1, 0,  825,  0
18520DATA Conner Peripherals 425MB - CFS425A,        TypeCFS425A,    62, 16,  839, 1, 0,  838,  0
18530DATA Conner Peripherals 850MB - CFS850A,        TypeCFS850A,    63, 16, 1651, 1, 0, 1650,  1
18550DATA OTHER,                                     TypeOTHER,      1,  1,  1,   1, 1,  1, 1: REM Must be last, numbers irrelevant (except must be non zero).
18570DEFPROCrestoreST506
18580RESTORE+1
18590ENDPROC
18630DATA 20Mb Miniscribe 8425,                      Type8425,       32, 4, 615, &3FF,  128, 663
18640DATA 53Mb Rodime RO3065,                        TypeRO3065,     32, 7, 872, &3FF,  650, 871
18650DATA 20Mb Kalok KL320,                          TypeKL320,      32, 4, 615, 615,   300, 615
18670DATA OTHER,                                     TypeOTHER,      32, 4, 612, &3FF,  128, 611:REM MUST BE LAST
18750DEFPROCopen_message_file(filename$)
18760LOCALflags%,size%
18770SYS"MessageTrans_FileInfo",,filename$TOflags%,,size%
18780IF(flags%AND 1)THENmsgs_file_buf%=0ELSEDIMmsgs_file_buf%size%
18790SYS"OS_Module",6,,,17+LEN(filename$)TO,,msgs_file_desc%
18800$(msgs_file_desc%+16)=filename$
18810SYS"MessageTrans_OpenFile",msgs_file_desc%,msgs_file_desc%+16,msgs_file_buf%
18820msgs_file_open%=TRUE
18830msg_lookup_buf_size%=256
18840DIMmsg_lookup_buf%msg_lookup_buf_size%
18850ENDPROC
18900DEFPROCclose_message_file
18910LOCALflags%
18920LOCALERROR
18930ONERROROFF
18950IFmsgs_file_open%THEN
18960SYS"MessageTrans_CloseFile",msgs_file_desc%TO;flags%
18970msgs_file_open%=FALSE
18980IF(flags%AND 1)THENREPORT
18990ENDIF
19010IFmsgs_file_desc%THEN
19020SYS"OS_Module",7,,msgs_file_desc%TO;flags%
19030msgs_file_desc%=0
19040IF(flags%AND 1)THENREPORT
19050ENDIF
19060ENDPROC
19120DEFFNmessage_lookup_0(tag$)
19130=FNmessage_lookup_4(tag$,"","","","")
19150DEFFNmessage_lookup_1(tag$,arg1$)
19160=FNmessage_lookup_4(tag$,arg1$,"","","")
19180DEFFNmessage_lookup_2(tag$,arg1$,arg2$)
19190=FNmessage_lookup_4(tag$,arg1$,arg2$,"","")
19210DEFFNmessage_lookup_3(tag$,arg1$,arg2$,arg3$)
19220=FNmessage_lookup_4(tag$,arg1$,arg2$,arg3$,"")
19240DEFFNmessage_lookup_4(tag$,arg1$,arg2$,arg3$,arg4$)
19250LOCALlen%
19260SYS"MessageTrans_GSLookup",msgs_file_desc%,tag$,msg_lookup_buf%,msg_lookup_buf_size%,arg1$,arg2$,arg3$,arg4$TO,,,len%
19270msg_lookup_buf%?len%=13
19280=$msg_lookup_buf%
19330DEFPROCmessage_print_0(tag$)
19340PROCmessage_print_4(tag$,"","","","")
19350ENDPROC
19370DEFPROCmessage_print_1(tag$,arg1$)
19380PROCmessage_print_4(tag$,arg1$,"","","")
19390ENDPROC
19410DEFPROCmessage_print_2(tag$,arg1$,arg2$)
19420PROCmessage_print_4(tag$,arg1$,arg2$,"","")
19430ENDPROC
19450DEFPROCmessage_print_3(tag$,arg1$,arg2$,arg3$)
19460PROCmessage_print_4(tag$,arg1$,arg2$,arg3$,"")
19470ENDPROC
19490DEFPROCmessage_print_4(tag$,arg1$,arg2$,arg3$,arg4$)
19500LOCALlen%
19510SYS"MessageTrans_GSLookup",msgs_file_desc%,tag$,msg_lookup_buf%,msg_lookup_buf_size%,arg1$,arg2$,arg3$,arg4$TO,,,len%
19520SYS"OS_WriteN",msg_lookup_buf%,len%
19530ENDPROC
19590DEFFNBigADFS
19600LOCALMisc_InfoPtr%
19610LOCALERROR
19620ONERRORLOCAL:RESTOREERROR:=FALSE
19630SYS"ADFS_MiscOp",6TOMisc_InfoPtr%
19640RESTOREERROR
19650=((!Misc_InfoPtr%)AND(1<<9))=(1<<9)
19670DEFPROCShareSize
19680LOCALLFAU%
19690LFAU%=LinkBits%<<Log2Alloc%
19700Log2ShareSize%=0
19710WHILE(253*(SecSize%<<Log2ShareSize%)<LFAU%)
19720Log2ShareSize%+=1
19730ENDWHILE
19740ShareSize%=1<<Log2ShareSize%
19750ENDPROC
19770DEFFNhexaddr(Sector%)
19780LOCALhigh$,low$
19790high$=STR$~(Sector%>>>(32-Log2SecSize%))
19800WHILE(LEN(high$)<8)
19810high$="0"+high$
19820ENDWHILE
19830low$=STR$~(Sector%<<(Log2SecSize%))
19840WHILE(LEN(low$)<8)
19850low$="0"+low$
19860ENDWHILE
19870=high$+low$

� > !RunImage
�*set HForm$EndStatus 1
�Log2ShareSize%=0
� ShareSize%=1<<Log2ShareSize%
�
dev%=�
�Verbose%=dev%
�msgs_file_desc%=0
�msgs_file_open%=�
���abort(�$,1)
��26:�12
�	�Init
�
�GetShape
�BigADFS%�
.�(DiscSize2%<>0�(DiscSize%�&E0000000)<>0)�
"%�message_print_0("DiscSizeError")
,�finish
6�
@�
JBFormatFlag%=(�Choose("Q01:","FormatOrInitChoose","FI","")="F")
T8SoakStyle$=�Choose("Q02:","SoakTestChoose","LSN","")
^8BootOpt$=�Choose("BootOpt:","BootOptChoose","YN","")
h[�choose_no_lookup("Q03:",�message_lookup_1("SureChoose",�(Drive%)),"YN","")="N"�finish
|�DisableEscape
��MoanOp(Specify%,0,0,0)
��FormatFlag%�
��Format
��
��SoakStyle$<>"N"�
�SoakFlag%=(SoakStyle$="L")
��Verify
��
��
��Structure
��RestoreEscape
�("-ADFS-%MOUNT :"+�Drive%)
�("-ADFS-%FREE :"+�Drive%)
"�("-ADFS-%DISMOUNT :"+�Drive%)
:*set HForm$EndStatus 0
D	�exit
b
��Init
l�DriveOffset%
v.�open_message_file("<HForm$Dir>.Messages")
��message_print_0("Banner")
�-autoreply$=�readvarval("Hform$Autoreply")
�%ș"XOS_Module",18,"ADFS"�,,,A%;F%
�+�F%�1�message_print_0("NoADFS"):�finish
�
A%+=A%!20
�)ȕ(?A%<>32)�(?A%<>9)�(?A%<>0):A%+=1:�
��?A%=0�finish
�#ȕ(?A%<�"0")�(?A%>�"9"):A%+=1:�
�;ADFSVersion%=((?A%-�"0")*10+(A%?2)-�"0")*10+(A%?3)-�"0"
�ș"ADFS_Drives"�,,HDiscs%
�5�HDiscs%<1�message_print_0("NoHardDiscs"):�finish
 BigADFS%=�BigADFS
4&DriveOffset%=�autoreply$,"Drive=")
>�(DriveOffset%<>0)�
H)Drive%=�(�autoreply$,DriveOffset%+6))
R�
\�
fDrive%=�Ask("DriveAsk",4,4)
p�Drive%>=4� Drive%<=7
z�
��(Drive%-3)>HDiscs%�
�/�message_print_1("SillyDiscNum",�(HDiscs%))
��finish
��
��ADFSVersion%<210�
�
IDE%=�
��
�-ș"ADFS_ControllerType",Drive%�DriveType%
��DriveType%=0�
�1�message_print_1("DriveNotPresent",�(Drive%))
��finish
��
;�DriveType%=3�message_print_1("DriveIsST506",�(Drive%))
9�DriveType%=4�message_print_1("DriveIsIDE",�(Drive%))
�
$IDE%=DriveType%=4
.�
8
�IDE%�
L+ș"XADFS_ControllerType",Drive%-1�A%;F%
V.�((F%�1)=0)�(A%=4)�IDEdrive%=1�IDEdrive%=0
`�IDEid%512
j�IDEpb%7
tIDEpb%!0=0
~IDEpb%!4=0
�IDEpb%?5=&A0+(IDEdrive%<<4)
�IDEpb%?6=&EC
�:ș"ADFS_IDEUserOp",1<<24,,IDEpb%,IDEid%,512�r0%,,,,r4%
��r0%<>0�r4%<>0�
�+�message_print_1("DiscIdError",�~(r0%))
�%IDEcyls%=0:IDEheads%=0:IDEsecs%=0
��
�IDEcyls%=(IDEid%!2)�&FFFF
�IDEheads%=(IDEid%!6)�&FFFF
�IDEsecs%=(IDEid%!12)�&FFFF
� IDECapacity%=(IDEid%!(57*2))
�$IDEAddressSpace%=(IDEid%!(60*2))
IDEname$=""

6�(((IDEid%!98)>>9)�1)<>0�IDEHasLBA%=1�IDEHasLBA%=0
�I%=27*2�46*2�2
%A%=(IDEid%?(I%+1)):B%=(IDEid%?I%)
(�(A%<32)�(A%>=127)A%=�"."
2IDEname$+=�(A%)
<�(B%<32)�(B%>=127)B%=�"."
FIDEname$+=�(B%)
P�
ZIDEfirm$=""
d�I%=23*2�26*2�2
n%A%=(IDEid%?(I%+1)):B%=(IDEid%?I%)
x�(A%<32)�(A%>=127)A%=�"."
�IDEfirm$+=�(A%)
��(B%<32)�(B%>=127)B%=�"."
�IDEfirm$+=�(B%)
��
�B�message_print_3("IDEDescription",�(Drive%),IDEname$,IDEfirm$)
�M�message_print_3("IDEConfiguration",�(IDEcyls%),�(IDEheads%),�(IDEsecs%))
��IDEHasLBA%<>0�
�!�message_print_0("IDEHasLBA")
��
��
��
�MakeParams%=7
�VerifyRetries%=1
DefectRetries%=5

Verify%=0
Read%=1
"Write%=2
,WriteTrack%=4
6Restore%=6
@Specify%=&F
JAltDefectBit%=&10
TDiscStruc%=&14
h
�IDE%�
rLog2SecSize%=9
|LowSector%=1
��
�Log2SecSize%=8
�LowSector%=0
��
�SecSize%=2^Log2SecSize%
�OldMapAdd%=0
�OldMapSize%=&200
�DirSize%=&800
�BootAdd%=&C00/SecSize%
�BootSize%=&200
N(MaxDefects%=(BootSize%-64-&10-4-4)�4
� BigMaxDefects%=MaxDefects%-1
�EndDefect%=1<<29
�EndDefect2%=1<<30
�OldLWM%=&E00
�FreeLink%=1
�CrossCheck%=3
�BigADFS%�
AdfsSwi%=&4024D
 �
*AdfsSwi%=&40240
4�
HAdfsDiscErr%=&108C7
RMaxVerifyBad%=16
\Patterns%=8
fp�Buf%&40000,DiscRec%64+BootSize%,Defect%BootSize%,DirMark%5,Bad%(MaxVerifyBad%),mc%100,Pattern%(Patterns%-1)
pBoot%=DiscRec%+64
zBootRec%=Boot%+BootSize%-64
�Pattern%(2)=&FFFFFF
�Pattern%(3)=&6DB6DB
	Pattern%(4)=0
	Pattern%(5)=&2CB2CB
	Pattern%(6)=&5A5A5A
	$Pattern%(7)=&4D34D3
	..SecsPerTrk%=32:Heads%=1:Cyls%=1:ParkCyl%=1
	8
�IDE%�
	BInitFlag%=0
	LLBAflag%=0
	V�
	`"LowCurrentCyl%=1:PreCompCyl%=1
	j�
	~
�BigADFS%
	�RootDirAdd%=&400/512
	��
	�RootDirAdd%=&400
	��
	�Log2Alloc%=10:LinkBits%=10
	��ShareSize
	�IndRootDirAdd%=RootDirAdd%
�IDEHasLBA%�

$SectorsPerDisc%=IDEAddressSpace%
�
 SectorsPerDisc%=IDECapacity%
(�
2HDiscSize%=(SectorsPerDisc%�((1<<(32-Log2SecSize%))-1))<<Log2SecSize%
<3DiscSize2%=(SectorsPerDisc%>>(32-Log2SecSize%))
P2�(DiscSize%>=(512*1024*1024))�(DiscSize2%<>0)�
ZBigDisc%=�
d�
nBigDisc%=�
x�
�*ș"ADFS_Retries",&ff,0�,,adfs_retries%
��
�5��::ș"ADFS_Retries",&ff,adfs_retries%:�Asm:�
�"�("-ADFS-%DISMOUNT :"+�Drive%)
�
�&ș"ADFS_Retries",&ff,adfs_retries%
��Asm
��
���GetShape
Formatted%=�
�InitBootDefects
�InitDiscRec
"*ș"ADFS_Retries",&ff,0�,,adfs_retries%
,�MoanOp(Restore%,0,0,0)
6'�Op(Read%,BootAdd%,Boot%,BootSize%)
@&È™"ADFS_Retries",&ff,adfs_retries%
J�Result%<>0���GoodDefects�
T%�message_print_0("NoValidFormat")
^�
h
�OldShape
r)�Op(Verify%,0,0,SecSize%*SecsPerTrk%)
|�ConfirmMake�Formatted%=�
��
��Formatted%�
�
�IDE%�
�笤CompareMake�
�L�autoreply$,"NOunknown")�abort(�message_lookup_0("UnknownDriveType"),1)
��AskMake
��
��
��AskMake
��
�I%=0�BootSize%-4
Boot%!I%=0
�I%
&�InitBootDefects
0�
D2�AskShape((�Formatted%)� EnglishMake$="OTHER")
N-�message_print_1("WillFormat",TransMake$)
X�printshape(IDE%)
b�
l�
���OldShape
�SecsPerTrk%=BootRec%?1
�Heads%=BootRec%?2
�Log2Alloc%=BootRec%?5
�DiscSize%=BootRec%!&10
�DiscSize2%=BootRec%!&24
�2�(DiscSize%>=(512*1024*1024))�(DiscSize2%<>0)�
�BigDisc%=�
��
�BigDisc%=�
��

MSectorsPerDisc%=(DiscSize%>>Log2SecSize%)+(DiscSize2%<<(32-Log2SecSize%))

 .Cyls%=SectorsPerDisc%�(SecsPerTrk%*Heads%)

*
�IDE%�

4InitFlag%=(BootRec%?-5)

>LBAflag%=(BootRec%?-6)

H�

R%LowCurrentCyl%=(BootRec%!-8)�&3FF

\"PreCompCyl%=(BootRec%!-6)�&3FF

f�

p�BigDisc%�

z/ParkCyl%=(BootRec%!-4)�(SecsPerTrk%*Heads%)

��

�8ParkCyl%=(BootRec%!-4)�(SecSize%*SecsPerTrk%*Heads%)

��

��InitDiscRec

��

�
��AskMake

��restoreparams(IDE%)

�Makes%=0

� I%=�autoreply$,"DriveType:")

��I%<>0�

�I%+=�("DriveType:")
3Make%=�(�autoreply$,I%,�autoreply$,",",I%)-I%))
�
%�message_print_0("DriveDisclaim")
$�
.�EnglishMake$,TokenMake$
8,TransMake$=�message_lookup_0(TokenMake$)
B
Makes%+=1
L;�message_print_2("MakeMenu",�" "+�Makes%,2),TransMake$)
V�I%=1�MakeParams%
`�A$
j�I%
t�EnglishMake$="OTHER"
~�
�/Make%=�InputDec("ManufacturerDec",1,Makes%)
��restoreparams(IDE%)
��
� I%=(Make%-1)*(MakeParams%+2)
�
È•I%>0
��A$
�	I%-=1
��
�
�IDE%�
�X�EnglishMake$,TokenMake$,SecsPerTrk%,Heads%,Cyls%,InitFlag%,Dummy%,ParkCyl%,LBAflag%
��
�Y�EnglishMake$,TokenMake$,SecsPerTrk%,Heads%,Cyls%,LowCurrentCyl%,PreCompCyl%,ParkCyl%
�

,TransMake$=�message_lookup_0(TokenMake$)

�IDE%�
(*�(EnglishMake$="OTHER")�(IDEcyls%<>0)�
2SecsPerTrk%=IDEsecs%
<Heads%=IDEheads%
FCyls%=IDEcyls%
PInitFlag%=1
ZLBAFlag%=1
d�autoreply$,"LBA:On")<>0�
nLBAFlag%=1
x�
��autoreply$,"LBA:Off")<>0�
�LBAFlag%=0
��
��
�ParkCyl%=IDEcyls%-1
��
��
��
�ݤConfirmMake
�
�matched%
��restoreparams(IDE%)
�
8�EnglishMake$,TokenMake$,P1%,P2%,P3%,P4%,P5%,P6%,P7%
,TransMake$=�message_lookup_0(TokenMake$)
"�EnglishMake$="OTHER"�
,(�message_print_0("NonStandardShape")
6�printshape(IDE%)
@�
J4=�Choose("Q04:","RetainShapeChoose","YN","")="Y"
T�
^matched%=�
h
�IDE%�
rc�P1%<>SecsPerTrk%�P2%<>Heads%�P3%<>Cyls%�P4%<>InitFlag%�P6%<>ParkCyl%�P7%<>LBAflag%�:matched%=�
|�
�k�P1%<>SecsPerTrk%�P2%<>Heads%�P3%<>Cyls%�P4%<>LowCurrentCyl%�P5%<>PreCompCyl%�P6%<>ParkCyl%�:matched%=�
��
�
�matched%
�0�message_print_1("StandardShape",TransMake$)
��printshape(IDE%)
��
�1=�Choose("Q05:","UseShapeChoose","YN","")="Y"
���printshape(itype%)
�D�message_print_3("PrintShape",�(Cyls%),�(Heads%),�(SecsPerTrk%))
��itype%�
K�message_print_3("PrintShape3IDE",�(ParkCyl%),�(InitFlag%),�(LBAflag%))
�
U�message_print_3("PrintShape2ST506",�(ParkCyl%),�(LowCurrentCyl%),�(PreCompCyl%))
&�
0�
XݤCompareMake
b�restorePROD
l�
vX�EnglishMake$,TokenMake$,SecsPerTrk%,Heads%,Cyls%,InitFlag%,Dummy%,ParkCyl%,LBAflag%
�,TransMake$=�message_lookup_0(TokenMake$)
��EnglishMake$="OTHER"�
�(�message_print_0("UnknownDriveMake")
�=�
��
�)��matchstrings(EnglishMake$,IDEname$)
�6=�Choose("Q06:","StandardShapeChoose","YN","")="Y"
���AskShape(tailored%)
�%�IDE%�(�autoreply$,"NewMap")<>0)�

NewMap%=�
�
DNewMap%=(�Choose("OldOrNewMap:","OldNewMapChoose","ON","N")="N")
 �
4�tailored%�
>0SecsPerTrk%=�Ask("SectorsAsk",SecsPerTrk%,1)
H
�IDE%�
R�
\'Heads%=�Ask("IDEHeadsAsk",Heads%,1)
f,�Heads%>16�message_print_0("IDEHeads16")
p�Heads%<=16
z�
�)Heads%=�Ask("ST506HeadsAsk",Heads%,1)
�,�Heads%>8�message_print_0("ST506Heads8")
��
�&Cyls%=�Ask("CylindersAsk",Cyls%,1)
�
�IDE%�
�)InitFlag%=�Ask("InitAsk",InitFlag%,0)
��IDEHasLBA%�
�LBAFlag%=1
��autoreply$,"LBA:On")<>0�
�LBAFlag%=1
��
��autoreply$,"LBA:Off")<>0�
LBAFlag%=0
�
&LBAflag%=�Ask("LBAAsk",LBAflag%,1)
$�
.�
8�
BLBAflag%=0
L�
V�
`:LowCurrentCyl%=�Ask("LowCylinderAsk",LowCurrentCyl%,0)
j8PreCompCyl%=�Ask("PrecompCylinderAsk",PreCompCyl%,0)
t�
~/ParkCyl%=�Ask("ParkCylinderAsk",ParkCyl%,0)
��
�DiscRec%?1=SecsPerTrk%
�DiscRec%?2=Heads%
�,SectorsPerDisc%=SecsPerTrk%*Heads%*Cyls%
��IDEHasLBA%�
�F�SectorsPerDisc%>IDEAddressSpace%�SectorsPerDisc%=IDEAddressSpace%
��
�>�SectorsPerDisc%>IDECapacity%�SectorsPerDisc%=IDECapacity%
��

HDiscSize%=(SectorsPerDisc%�((1<<(32-Log2SecSize%))-1))<<Log2SecSize%
3DiscSize2%=(SectorsPerDisc%>>(32-Log2SecSize%))
(2�(DiscSize%>=(512*1024*1024))�(DiscSize2%<>0)�
2BigDisc%=�
<�
FBigDisc%=�
P�
dDiscRec%!&10=DiscSize%
nDiscRec%!&24=DiscSize2%
xDiscRec%?&28=Log2ShareSize%
�0�((DiscSize%�&E0000000)<>0�(DiscSize2%<>0))�
�DiscRec%?&29=1
��
�DiscRec%?&29=0
��
��I%=0�BootSize%-4�4
�Defect%!I%=Boot%!I%
��I%
�Boot%!0=EndDefect%
��

ptr%=0
defectlist%=0
�BigDisc%�
"�Defect%!ptr%>=EndDefect%�
,C�Defect%!(ptr%+4)<EndDefect2%�message_print_0("CurrentDefects")
6�
@&�message_print_0("CurrentDefects")
J�
T�
^@�Defect%!(ptr%)<EndDefect%�message_print_0("CurrentDefects")
h�
rPȕ((Defect%!ptr%<EndDefect%)��BigDisc%)�(Defect%!ptr%<EndDefect2%� BigDisc%)
|+�((Defect%!ptr%�&E0000000)=EndDefect%)�
�ptr%+=4
�defectlist%=1
��
��defectlist%=0�
�defect%=Defect%!ptr%
�defect%=defect%�SecSize%
�,sector%=(defect%�SecsPerTrk%)+LowSector%
�defect%=defect%�SecsPerTrk%
�M�((ptr%�4)�6)*13);"(";defect%�Heads%;",";defect%�Heads%;",";sector%;")";
�ptr%=ptr%+4
��
�defect%=Defect%!ptr%
�,sector%=(defect%�SecsPerTrk%)+LowSector%
defect%=defect%�SecsPerTrk%
Q�(((ptr%-4)�4)�6)*13);"(";defect%�Heads%;",";defect%�Heads%;",";sector%;")";
ptr%=ptr%+4
&�
0�
:�
D�BigDisc%�
NDefects%=(ptr%�4)-1
X�
bDefects%=ptr%�4
l�
v#�autoreply$,"NOadddefects")=0�
��:�
�$�message_print_0("DefectNoMore")
�!�message_print_0("DefectAdd")
�
�NewMap%�
�%�message_print_0("DefectAddDisc")
��
�(�message_print_0("DefectAddLogical")
��
�$�message_print_0("DefectRemove")
��
�/opt$=�Choose("Q07:","ABCDChoose","ABCD","")
��
�Ȏopt$�
�"B","D"
+cyl%=�InputDec("CylinderDec",0,Cyls%-1)
)head%=�InputDec("HeadDec",0,Heads%-1)
 
�IDE%�
*0sector%=�InputDec("SectorDec",1,SecsPerTrk%)
4�
>9sector%=�InputDec("IndexMFMDec",1-SecsPerTrk%,&10000)
H�sector%>=0�
Rsector%=sector%�320
\�
fsector%=-sector%
p�
z�
�Bdefect%=((cyl%*Heads%+head%)*SecsPerTrk%+(sector%-LowSector%))
��opt$="B"�
��AddPhysDefect(defect%)
��
��RemovePhysDefect(defect%)
��
��"C"
�
�NewMap%�
�/�AddPhysDefect((�InputHex2("DiscAddrHex")))
��
�&�message_print_0("DFormatDefect1")
�&�message_print_0("DFormatDefect2")
�&�message_print_0("DFormatDefect3")
2defect%=(�InputHex("LogicalAddrHex")�SecSize%)
'�AddPhysDefect(�LogToPhys(defect%))
�
$�
.��opt$,1)="A"
8�I%=0�DiscStruc%-4�4
BBootRec%!I%=DiscRec%!I%
L�I%
V�InitHardDesc
`�
t��Format
~�=0
��I%,J%,cyl%,head%
��MoanOp(Specify%,0,0,0)
��MoanOp(Restore%,0,0,0)
�"�message_print_0("Formatting")
�
�IDE%�
��I%=0�512-4�4:Buf%!I%=0:�
��I%=0�SecsPerTrk%-1
�Buf%?(2*I%+0)=&00
�Buf%?(2*I%+1)=I%+1
��
��
%�I%=0�512-4�4:Buf%!I%=&077F03FF:�

�
�cyl%=0�Cyls%-1
�13:�cyl%;
(�head%=0�Heads%-1
2"�cyl%<>0�head%<>0��Formatted%�
<�IDE%�
FJ%=cyl%�(head%<<24)
P3�I%=0�(SecsPerTrk%-1)*4�4:Buf%!I%=J%�(I%<<14):�
Z�
n=�Op(WriteTrack%,(cyl%*Heads%+head%)*SecsPerTrk%,Buf%,512)
x+�Result%�message_print_0("FormatError")
��
��
��
��
���Verify
�,�SoakFlag%�message_print_0("SoakPrompt")
�-�add%,ptr%,sector%,head%,cyl%,defectlist%
�Cycle%=1:ErrorCycle%=-100
�CylSize%=SecsPerTrk%*Heads%
�!suspects%=0:MaxSuspects%=1000
�B�CylBuf%CylSize%+4,SusAdd%(MaxSuspects%),SusCount%MaxSuspects%
�%�13:�message_print_0("Verifying")
�
�Cycle%>1�
I%=Cycle%�Patterns%
"
�I%>1�
,J%=Pattern%(I%)
6J%=(J%>>>1)�((J%� 1)<<23)
@Pattern%(I%)=J%
J�
TJ%=�(&1000000)-1
^�
h�SoakFlag%�
r�13
|&�message_print_1("Pattern",�~(J%))
��
�+�I%=CylBuf%�CylBuf%+CylSize%�3:!I%=J%:�
�
ptr%=0
�defectlist%=0
��BigADFS%�
�&�Formatted%add%=SecsPerTrk%�add%=0
��
�/�Formatted%add%=SecSize%*SecsPerTrk%�add%=0
��
��
�Z�Defect%!ptr%>EndDefect%� Defect%!ptr%<EndDefect2%� BigADFS%� BigDisc%� defectlist%=0�
�ptr%+=4
�defectlist%=1
�
)CylEnd%=add%-(add%�CylSize%)+CylSize%
0�(defectlist%=1)�
Ddefect%=Defect%!ptr%
N�
b#defect%=(Defect%!ptr%)�SecSize%
l�
�"�defect%>CylEnd%�defect%<add%�
�#length%=(CylEnd%-add%)*SecSize%
��
�#length%=(defect%-add%)*SecSize%
��
��Op(Write%,add%,0,length%)
�
�Result%�
��BigADFS%�
�"add%=(ErrDiscAdd%�&1FFFFFFF)+1
��
�-add%=((ErrDiscAdd%�&1FFFFF00)�SecSize%)+1
�
�
add%+=length%
 �
*!�add%=defect%�add%+=1:ptr%+=4
4�add%>=SectorsPerDisc%
>�
H�SoakFlag%�".";
f
add%=0
p
ptr%=0
zdefectlist%=0
��MoanOp(Restore%,0,0,0)
��
��defectlist%=0�
��
�*�(Defect%!ptr%�&E0000000)<>EndDefect%�
�$�((Defect%!ptr%)�SecSize%)<add%�
�ptr%+=4
��
��
��BigDisc%�
�defectlist%=1
�ptr%+=4
��
�
2�defectlist%=1�((Defect%!ptr%)�SecSize%)>=add%
�
$�defectlist%=1�
.È•Defect%!ptr%<add%
8ptr%+=4
B�
L�
V�defectlist%=0�
`#defect%=(Defect%!ptr%)�SecSize%
j�
tdefect%=Defect%!ptr%
~�
��defect%>SectorsPerDisc%�
� length%=SectorsPerDisc%-add%
��
�length%=defect%-add%
��
�(�Op(Verify%,add%,0,length%*SecSize%)
�
�Result%�
��BigADFS%�
�add%=ErrDiscAdd%�&1FFFFFFF
�

)add%=(ErrDiscAdd%�&1FFFFF00)�SecSize%
�

Try%=0
(�
2Try%+=1
<�MoanOp(Restore%,0,0,0)
F �Op(Verify%,add%,0,SecSize%)
Z�Result%=0�Try%=5
d�Result%Try%+=1
nsector%=add%
xhead%=sector%�SecsPerTrk%
�sector%=sector%�SecsPerTrk%
�cyl%=head%�Heads%
�head%=head%�Heads%
�I�message_print_3("VerifyData",�(cyl%),�(head%),�(sector%+LowSector%))
�
sus%=0
�3ȕsus%<suspects%� SusAdd%(sus%)<>add%:sus%+=1:�
��sus%=suspects%�
��suspects%=MaxSuspects%�
�sus%=�(MaxSuspects%)-1
��
�suspects%+=1
��
�SusAdd%(sus%)=add%
SusCount%?sus%=0
�
score%=2^(Try%-1)-1
"�SoakFlag%score%=score%*4
,SusCount%?sus%+=score%
6�(SusCount%?sus%>30)�dev%�
@�SoakFlag%�
J%�message_print_1("DefectTIME",�$)
T�
^�message_print_0("Defect")
h�
r�AddPhysDefect(add%)
|ErrorCycle%=Cycle%
��
��SoakFlag%�
��=0:���>500:�13:�(78);:�13
��
�'�message_print_1("Retries",�(Try%))
��
��
�add%=add%+1
��
�add%=add%+length%+1
��
��add%>defect%�
�ptr%+=4
 �
 �add%>=SectorsPerDisc%
 �SoakFlag%�
 &�
 0
Key%=�(0)
 :�Key%=-1�Key%=32
 Ddone%=(Key%=32)
 N�
 Xdone%=Cycle%>ErrorCycle%+2
 b�
 l
Cycle%+=1
 v�SoakFlag%�&2E
 �
�done%
 ��
 ���Structure
 �
�NewMap%�
 ��NewStructure
 ��
 ��OldStructure
 ��
 ��
!��OldStructure
!�WriteDefectList
!�WriteOldFsMap
! �WriteRootDir
!*�
!HݤRoundUpShare(Secs%)
!R�Log2ShareSize%=0�=Secs%
!\1=((Secs%+ShareSize%-1)�ShareSize%)*ShareSize%
!�$ݤMapBits(Secs%,Lg%,Lg2SecSize%)
!��Shift%
!�Shift%=Lg2SecSize%-Lg%
!��(Shift%>0)�
!�=Secs%<<Shift%
!��
!�=Secs%>>(-Shift%)
!��
!�)ݤRoundSectors(Bits%,Lg%,Lg2SecSize%)
!��Shift%
!�Shift%=Lg2SecSize%-Lg%
!��(Shift%>0)�
"=Bits%>>(Shift%)
"�
"=Bits%<<(-Shift%)
"$�
"8ݤdoalloc(Verbose%)
"BLog2Alloc%=Log%
"L�ShareSize
"V>MapBits%=�MapBits(SectorsPerDisc%,Log2Alloc%,Log2SecSize%)
"`ARoundSectors%=�RoundSectors(MapBits%,Log2Alloc%,Log2SecSize%)
"jBestZones%=1<<30
"tBestCylOff%=1<<30
"~�DummySpare%=1�1
"�,�SpareBits%=4*8�ZoneBits%-Zone0Bits%-8*8
"��CalcZones
"�LinkBits%=10
"��LinkBits%+=1
"��CalcIds
"�3�Ids%<=2^LinkBits%� LinkBits%>=(Log2SecSize%+3)
"�;�SpareBits%-4*8>0� SpareBits%-4*8<=LinkBits%�SpareBits%
"�/�OddBits%>0� OddBits%<=LinkBits%�SpareBits%
"��LinkBits%>15�Zones%>127�
"�/�Verbose%��message_print_0("TooSmallAlloc")
"�Log2Alloc%+=1
"��DummySpare%
#=�
#
�
#�Zones%<=BestZones%�
#6Crucial%=�RoundUpShare(Zones%*2)*SecSize%+DirSize%
#(4�MapZone%=0 Crucial%=BootAdd%*SecSize%+BootSize%
#2?�Crucial%<Alloc%*(LinkBits%+1)Crucial%=Alloc%*(LinkBits%+1)
#<)CrucialEnd%=MapAdd%+Crucial%/SecSize%
#Fdefectlist%=0
#PDefPtr%=Defect%
#Z�
#ddefect%=!DefPtr%
#nDefPtr%+=4
#x2�defect%>=EndDefect%� defectlist%=0� BigDisc%�
#�defect%=!DefPtr%
#�DefPtr%+=4
#�defectlist%=1
#��
#�?�defectlist%=0� defect%<EndDefect%�defect%=defect%/SecSize%
#�@�defect%>=EndDefect%�(defect%>=MapAdd%� defect%<CrucialEnd%)
#�(CylOff%=MapAdd%�(SecsPerTrk%*Heads%)
#�.�defect%>=EndDefect%� CylOff%<BestCylOff%�
#�BestCylOff%=CylOff%
#�BestLinkBits%=LinkBits%
#�BestSpare%=SpareBits%
#�BestZones%=Zones%
#��
$�BestCylOff%�SpareBits%
$�DummySpare%
$�
$"�DummySpare%
$,�
$6K�BestZones%=(1<<30)� Verbose%=���message_print_0("InvalidAllocSize"):=�
$@=�
$T��NewStructure
$^Zone0Bits%=60*8
$hZoneBits%=SecSize%*8
$rLog2Alloc%=9
$|�ShareSize
$�*�Log2Alloc%<8�Log2Alloc%=10:�ShareSize
$�'Alloc%=2^Log2Alloc%:Log%=Log2Alloc%
$�ȕ�doalloc(�)=�
$�'Alloc%=2^Log2Alloc%:Log%=Log2Alloc%
$��
$��
$��
$�0Alloc%=�Ask("AllocUnitAsk",2^Log2Alloc%,256)
$�
Log%=7
$��
%Log%+=1
%�Alloc%=2^Log%
%&��doalloc(�)
%:�
%DLinkBits%=BestLinkBits%
%NSpareBits%=BestSpare%
%X�CalcZones
%b�CalcIds
%l6Crucial%=�RoundUpShare(Zones%*2)*SecSize%+DirSize%
%v4�MapZone%=0 Crucial%=BootAdd%*SecSize%+BootSize%
%�?�Crucial%<Alloc%*(LinkBits%+1)Crucial%=Alloc%*(LinkBits%+1)
%�8�Crucial%�Alloc%<>0 Crucial%+=Alloc%-Crucial%�Alloc%
%��MapZone%=0�
%�+RootDirAdd%=BootAdd%+BootSize%/SecSize%
%�@IndRootDirAdd%=&200+(BootAdd%*SecSize%+BootSize%)�SecSize%+1
%��
%�;RootDirAdd%=MapAdd%+�RoundUpShare((MapLen%*2)/SecSize%)
%�<IndRootDirAdd%=&200+�RoundUpShare(Zones%*2)/ShareSize%+1
%��
%�DiscRec%?4=LinkBits%
%�DiscRec%?5=Log2Alloc%
%�+�BootOpt$="Y"�DiscRec%!7=2�DiscRec%!7=0
%�DiscRec%?8=LowSector%
&DiscRec%?9=Zones%
&DiscRec%?&A=SpareBits%�256
&DiscRec%?&B=SpareBits%�256
& DiscRec%!&C=IndRootDirAdd%
&*DiscRec%?&28=Log2ShareSize%
&4BootRec%!4=DiscRec%!4
&>BootRec%!8=DiscRec%!8
&HBootRec%!&C=DiscRec%!&C
&RBootRec%!&24=DiscRec%!&24
&\BootRec%!&28=DiscRec%!&28
&f�I%=0�Zones%*SecSize%-4�4
&p
Buf%!I%=0
&z�I%
&��I%=0�60-4�4
&�Buf%!(I%+4)=DiscRec%!I%
&��I%
&��WriteDefectList
&�#�message_print_0("CreatingMap")
&�
ptr%=0
&�DefectStart%=0
&�defectlist%=0
&�+DiscEndBit%=�DiscToMap(SectorsPerDisc%)
&�ZoneStart%=Buf%
&�ZoneStartBit%=0
&�BootStartBit%=0
&�BootEndBit%=0
'MapStartBit%=0
'MapEndBit%=0
'�zone%=0�Zones%-1
'$#!ZoneStart%=1<<(15+FreeLink%*8)
'.'ZoneEndBit%=ZoneStartBit%+ZoneBits%
'8.UsedZoneEndBit%=ZoneEndBit%-SpareBits%+4*8
'B!�UsedZoneEndBit%>DiscEndBit%�
'LUsedZoneEndBit%=DiscEndBit%
'V�
'`&PreFree%=ZoneStartBit%+FreeLink%*8
'jZoneBit%=ZoneStartBit%+4*8
't
�zone%=0�
'~BootStartBit%=ZoneBit%
'� ZoneBit%=ZoneBit%+Zone0Bits%
'�0length%=(BootAdd%*SecSize%+BootSize%)�Alloc%
'�,�length%<LinkBits%+1 length%=LinkBits%+1
'��WriteLink(ZoneBit%,2)
'�"�WriteLength(ZoneBit%,length%)
'�ZoneBit%=ZoneBit%+length%
'�BootEndBit%=ZoneBit%
'��
'��zone%=MapZone%�
'�MapStartBit%=ZoneBit%
'�length%=Crucial%�Alloc%
'��WriteLink(ZoneBit%,2)
("�WriteLength(ZoneBit%,length%)
(
ZoneBit%=ZoneBit%+length%
(MapEndBit%=ZoneBit%
(�
((�
(2�
(F�ZoneBit%>DefectStart%�
(P�defectlist%=0�
(Z(�Defect%!ptr%>=EndDefect%� BigDisc%�
(dptr%+=4
(ndefectlist%=1
(x)DefectStart%=�DiscToMap(Defect%!ptr%)
(��
(�4DefectStart%=�DiscToMap((Defect%!ptr%)/SecSize%)
(��
(��
(�)DefectStart%=�DiscToMap(Defect%!ptr%)
(��
(��ȕ((zone%=0�(DefectStart%>=BootStartBit%� DefectStart%<BootEndBit%)))�((zone%=MapZone%�(DefectStart%>=MapStartBit%� DefectStart%<MapEndBit%)))
(��defectlist%=0�
(�1defectaddr$=�hexaddr((Defect%!ptr%)/SecSize%)
(��
(�&defectaddr$=�hexaddr(Defect%!ptr%)
(��
(�
�zone%=0�
)3�message_print_1("BootDefectError",defectaddr$)
)�
)2�message_print_1("MapDefectError",defectaddr$)
)"�
),ptr%+=4
)6�defectlist%=0�
)@�Defect%!ptr%>=EndDefect%�
)Jptr%+=4
)Tdefectlist%=1
)^)DefectStart%=�DiscToMap(Defect%!ptr%)
)h�
)r4DefectStart%=�DiscToMap((Defect%!ptr%)/SecSize%)
)|�
)��
)�)DefectStart%=�DiscToMap(Defect%!ptr%)
)��
)��
)�#�DefectStart%>=UsedZoneEndBit%�
)�DefectStart%=ZoneEndBit%
)��
)�DefectEnd%=DefectStart%+1
)�ptr%+=4
)��
)�done1%=�
)��
)�done2%=�
*�defectlist%=1�
*(NextDefect%=�DiscToMap(Defect%!ptr%)
*�
*&3NextDefect%=�DiscToMap((Defect%!ptr%)/SecSize%)
*0�
*:!�NextDefect%<UsedZoneEndBit%�
*D+�NextDefect%>ZoneEndBit%-(LinkBits%+1)�
*N&NextDef%=ZoneEndBit%-(LinkBits%+1)
*X�
*bNextDef%=NextDefect%
*l�
*v%�NextDef%-DefectEnd%<LinkBits%+1�
*��NextDefect%+1>DefectEnd%�
*�DefectEnd%=NextDefect%+1
*��
*�ptr%+=4
*�done2%=�
*��
*��
*��done2%
*�)�DefectEnd%-DefectStart%<LinkBits%+1�
*�'DefectEnd%=DefectStart%+LinkBits%+1
*��DefectEnd%>ZoneEndBit%�
*�DefectEnd%=ZoneEndBit%
*��
+done1%=�
+�
+C�DefectEnd%>ZoneEndBit%-(LinkBits%+1)� DefectEnd%<>ZoneEndBit%�
+ DefectEnd%=ZoneEndBit%
+*done1%=�
+4�
+>)�DefectEnd%-DefectStart%<LinkBits%+1�
+H)DefectStart%=DefectEnd%-(LinkBits%+1)
+R�
+\�done1%
+f�
+p�
+z<�ZoneBit%>DefectStart%�message_print_0("ERROR1"):�finish
+�;�DefectStart%-ZoneBit%<=LinkBits%�DefectStart%=ZoneBit%
+��DefectStart%>ZoneBit%�
+�*�WriteLink(PreFree%,ZoneBit%-PreFree%)
+�#�DefectStart%>=UsedZoneEndBit%�
+�3�WriteLength(ZoneBit%,UsedZoneEndBit%-ZoneBit%)
+�!�ZoneEndBit%>UsedZoneEndBit%�
+�!�WriteLink(UsedZoneEndBit%,1)
+�=�WriteLength(UsedZoneEndBit%,ZoneEndBit%-UsedZoneEndBit%)
+��
+��
+�0�WriteLength(ZoneBit%,DefectStart%-ZoneBit%)
+��
+�PreFree%=ZoneBit%
,�
,�DefectStart%<ZoneEndBit%�
,.�DefectEnd%>UsedZoneEndBit%-(LinkBits%+1)�
,$DefectEnd%=ZoneEndBit%
,.�
,8�WriteLink(DefectStart%,1)
,B6�WriteLength(DefectStart%,DefectEnd%-DefectStart%)
,LZoneBit%=DefectEnd%
,V�
,`ZoneBit%=ZoneEndBit%
,j�
,t�ZoneBit%=ZoneEndBit%
,~�WriteLink(PreFree%,0)
,�
�zone%=0�
,�ZoneStart%?CrossCheck%=&FF
,��
,�ZoneStart%?CrossCheck%=0
,��
,�1?ZoneStart%=�NewMapCheck(ZoneStart%,SecSize%)
,�"ZoneStart%=ZoneStart%+SecSize%
,�ZoneStartBit%=ZoneEndBit%
,�
�zone%
,�"�message_print_0("WritingMap")
,�(�MoanOp(Write%,MapAdd%,Buf%,MapLen%)
,�9�MoanOp(Write%,MapAdd%+MapLen%/SecSize%,Buf%,MapLen%)
-�WriteRootDir
-
�
-��CalcZones
-(#UsedBits%=SecSize%*8-SpareBits%
-2/WholeZones%=(MapBits%+Zone0Bits%)�UsedBits%
-<,OddBits%=(MapBits%+Zone0Bits%)�UsedBits%
-F4�OddBits%Zones%=WholeZones%+1�Zones%=WholeZones%
-PMapZone%=Zones%�2
-Z�MapZone%=0�
-d
MapAdd%=0
-n�
-x�(Alloc%>SecSize%)�
-�=MapAdd%=(UsedBits%*MapZone%-Zone0Bits%)*(Alloc%�SecSize%)
-��
-�=MapAdd%=(UsedBits%*MapZone%-Zone0Bits%)�(SecSize%�Alloc%)
-��
-��
-�MapLen%=Zones%*SecSize%
-��
-�
��CalcIds
-�'IdsPerZone%=UsedBits%�(LinkBits%+1)
-�7Ids%=IdsPerZone%*WholeZones%+OddBits%�(LinkBits%+1)
-��
."ݤDiscToMap(discadd%)
.,�bit%,zone%
.6�(Alloc%>SecSize%)
.@0bit%=(discadd%�(Alloc%�SecSize%))+Zone0Bits%
.J�
.T0bit%=(discadd%*(SecSize%�Alloc%))+Zone0Bits%
.^�
.hzone%=bit%�UsedBits%
.r-bit%=bit%+(bit%�UsedBits%)*SpareBits%+4*8
.|	=bit%
.���WriteLink(off%,link%)
.�9�link%>=2^LinkBits%�message_print_0("ERROR2"):�finish
.��bit%,add%,mask%
.�bit%=off%�8
.�add%=Buf%+off%�8
.�mask%=2^LinkBits%-1
.�,!add%=(!add%��(mask%<<bit%))�link%<<bit%
.��
.���WriteLength(off%,len%)
.�6�len%<=LinkBits%�message_print_0("ERROR3"):�finish
/off%=off%+len%-1
/Buf%?(off%�8)+=2^(off%�8)
/�
/0��WriteDefectList
/:&�message_print_0("WritingDefects")
/D
ptr%=0
/Ncheck%=0
/XÈ•Defect%!ptr%<EndDefect%
/bBoot%!ptr%=Defect%!ptr%
/l�CheckPut(Boot%!ptr%)
/vptr%=ptr%+4
/��
/�check%=check%�(check%>>>16)
/�$check%=(check%�(check%>>>8))�&FF
/� Boot%!ptr%=EndDefect%�check%
/��BigDisc%�
/�ptr%+=4
/�check%=0
/�ȕDefect%!ptr%<EndDefect%
/�Boot%!ptr%=Defect%!ptr%
/��CheckPut(Boot%!ptr%)
/�ptr%=ptr%+4
0�
0check%=check%�(check%>>>16)
0$check%=(check%�(check%>>>8))�&FF
0 !Boot%!ptr%=EndDefect2%�check%
0*�
0HÈ•ptr%<(MaxDefects%*4)
0Rptr%=ptr%+4
0\Boot%!ptr%=0
0f�
0p�Sum(Boot%,BootSize%)
0z,�MoanOp(Write%,BootAdd%,Boot%,BootSize%)
0��
0���WriteOldFsMap
0�(�message_print_0("WritingFreeSpace")
0�
�s%,I%
0�s%=OldMapSize%�2
0�%�I%=0�OldMapSize%-4�4:Buf%!I%=0:�
0�!Buf%=OldLWM%�&100
0�6Buf%!s%=(DiscSize%-OldLWM%-Defects%*SecSize%)�&100
0�!(Buf%+s%-4)=DiscSize%�&100
0�%!(Buf%+OldMapSize%-5)=�(&10000)-1
0�!(Buf%+OldMapSize%-2)=3
0��Sum(Buf%,s%)
1�Sum(Buf%+s%,s%)
10�MoanOp(Write%,OldMapAdd%p,Buf%,OldMapSize%)
1�
1.��WriteRootDir
18&�message_print_0("WritingRootDir")
1B�BF%
1L"�I%=0�DirSize%-4�4:Buf%!I%=0:�
1V
�NewMap%�
1`$DirMark%="Hugo"
1j�
1t$DirMark%="Hugo"
1~�
1�Buf%!1=!DirMark%
1�BF%=Buf%+DirSize%
1�
�NewMap%�
1�BF%!-38=IndRootDirAdd%
1��
1�BF%!-38=IndRootDirAdd%�&100
1��
1�BF%?-35=�"$"
1�BF%?-16=�"$"
1�BF%!-5=!DirMark%
1�check%=0
1��CheckPut(!Buf%)
2�CheckPut(Buf%?4)
2

I%=BF%-40
2
ȕI%�3
2�CheckPut(?I%)
2(I%=I%+1
22�
2<È•I%<BF%-4
2F�CheckPut(!I%)
2PI%=I%+4
2Z�
2dcheck%=check%�(check%>>>16)
2n$check%=(check%�(check%>>>8))�&FF
2xBF%?-1=check%
2�-�MoanOp(Write%,RootDirAdd%,Buf%,DirSize%)
2��
2�ݤLogToPhys(add%)
2�	�ptr%
2�
ptr%=0
2�#ȕadd%>=(Defect%!ptr%)�SecSize%
2�ptr%=ptr%+4
2�add%=add%+SecSize%
2��
2�	=add%
3"��AddPhysDefect(add%)
3,#�ptr%,ptr2%,defect%,defectlist%
3@�(add%>=SectorsPerDisc%)�
3J$�message_print_0("DefectTooBig")
3T�
3^�BigDisc%�
3r�Defects%<MaxDefects%�
3|$ȕ((Defect%!ptr%)�SecSize%)<add%
3�ptr%=ptr%+4
3��
3�#defect%=(Defect%!ptr%)/SecSize%
3��defect%=add%�
3�&�message_print_0("ExistingDefect")
3��
3�ptr2%=Defects%*4
3�ȕptr2%>=ptr%
3�#Defect%!(ptr2%+4)=Defect%!ptr2%
3�ptr2%=ptr2%-4
3��
3�Defect%!ptr%=add%*SecSize%
3�Defects%=Defects%+1
4�
4�
4&�message_print_0("FullDefectList")
4&�
40�
4D�Defects%<BigMaxDefects%�
4N@�((add%*SecSize%)�&E0000000)=0�(add%>>>(32-Log2SecSize%))=0�
4bdefectlist%=0
4l�
4�defectlist%=1
4�ȕ(Defect%!ptr%<EndDefect%)
4�ptr%+=4
4��
4�ptr%+=4
4��
4��defectlist%=1�
4�ȕ(Defect%!ptr%)<add%
4�ptr%+=4
4��
4��
4�$ȕ((Defect%!ptr%)/SecSize%)<add%
4�ptr%+=4
5�
5�
5�defectlist%=0�
5 #defect%=(Defect%!ptr%)/SecSize%
5*�
54defect%=(Defect%!ptr%)
5>�
5H�defect%=add%�
5R&�message_print_0("ExistingDefect")
5\�
5fptr2%=Defects%*4+4
5pȕptr2%>=ptr%
5z#Defect%!(ptr2%+4)=Defect%!ptr2%
5�ptr2%=ptr2%-4
5��
5��defectlist%=0�
5�Defect%!ptr%=add%*SecSize%
5��
5�Defect%!ptr%=add%
5��
5�Defects%=Defects%+1
5��
5��
5�&�message_print_0("FullDefectList")
5��
5��
6�
6�
6.��RemovePhysDefect(add%)
68#�ptr%,ptr2%,defect%,defectlist%
6B
ptr%=0
6Ldefectlist%=1
6V>ȕ((Defect%!ptr%)/SecSize%)<add%�(Defect%!ptr%<EndDefect%)
6`ptr%=ptr%+4
6j�
6t�Defect%!ptr%>=EndDefect%�
6~defectlist%=2
6�ptr%+=4
6�3ȕ(Defect%!ptr%)<add%�(Defect%!ptr%)<EndDefect%
6�ptr%=ptr%+4
6��
6��
6��defectlist%=1�
6�#defect%=(Defect%!ptr%)/SecSize%
6��
6�defect%=Defect%!ptr%
6��
6��defect%=add%�
6��BigDisc%�
7È•ptr%<(Defects%*4+4)
7
!Defect%!ptr%=Defect%!(ptr%+4)
7ptr%=ptr%+4
7�
7(Defects%=Defects%-1
72�
7<È•ptr%<Defects%*4
7F!Defect%!ptr%=Defect%!(ptr%+4)
7Pptr%=ptr%+4
7Z�
7dDefects%=Defects%-1
7n�
7xDefects%=Defects%-1
7��
7�%�message_print_0("MissingDefect")
7��
7��
7�ݤGoodOldDefectList
7�ptr%=-4
7�check%=0
7�last%=-1
8good%=�
8�
8ptr%=ptr%+4
8"defect%=Boot%!ptr%
8,�defect%<=last%good%=�
86last%=defect%
8@)�defect%<EndDefect%�CheckPut(defect%)
8J!�(defect%>=EndDefect%)��good%
8TOldDefects%=ptr%�4
8^check%=check%�(check%>>>16)
8h$check%=(check%�(check%>>>8))�&FF
8r!=good%�((defect%�&FF)=check%)
8�ݤGoodNewDefectList
8�ptr%=4*OldDefects%
8�check%=0
8�last%=-1
8�good%=�
8��
8�ptr%=ptr%+4
8�defect%=Boot%!ptr%
8��defect%<=last%good%=�
8�last%=defect%
8�*�defect%<EndDefect2%�CheckPut(defect%)
8�"�(defect%>=EndDefect2%)��good%
8�$NewDefects%=ptr%�4-OldDefects%-1
9check%=check%�(check%>>>16)
9$check%=(check%�(check%>>>8))�&FF
9!=good%�((defect%�&FF)=check%)
9:ݤGoodDefects
9D bothgood%=�GoodOldDefectList
9XD�((BootRec%!&10)>=(512*1024*1024)�(BootRec%!&26)<>0)� bothgood%�
9b*bothgood%=bothgood%��GoodNewDefectList
9l�
9v:=bothgood%�(�sum(Boot%,BootSize%)=Boot%?(BootSize%-1))
9���InitDiscRec
9��I%=0�64-4�4
9�DiscRec%!I%=0
9��I%
9�?DiscRec%=Log2SecSize%
9�DiscRec%?1=SecsPerTrk%
9�DiscRec%?2=Heads%
9�DiscRec%?8=LowSector%
9�DiscRec%!&C=IndRootDirAdd%
9�DiscRec%!&10=DiscSize%
:DiscRec%!&24=DiscSize2%
:DiscRec%?&28=Log2ShareSize%
: 0�((DiscSize%�&E0000000)<>0�(DiscSize2%<>0))�
:*DiscRec%?&29=1
:4�
:>DiscRec%?&29=0
:H�
:RDiscRec%!&14=�(&10000)-1
:f&$(DiscRec%+&16)="HardDisc"+�Drive%
:zDiscRec%?&22=Drive%
:��
:���InitBootDefects
:�!Boot%=EndDefect%
:�Boot%!4=EndDefect2%
;OldDefects%=0
;NewDefects%=0
;�InitHardDesc
;$�
;B��InitHardDesc
;L
�IDE%�
;VBootRec%!-&10=0
;`BootRec%!-&C=0
;jBootRec%?-5=InitFlag%
;tBootRec%?-6=LBAflag%
;~�
;�BootRec%!-&10=&00000000
;�BootRec%!-&C=&0D0C200A
;�0BootRec%!-8=LowCurrentCyl%�(PreCompCyl%<<16)
;��
;�
�BigDisc%
;�+BootRec%!-4=SecsPerTrk%*Heads%*ParkCyl%
;��
;�4BootRec%!-4=SecSize%*SecsPerTrk%*Heads%*ParkCyl%
<�
<BootRec%!-&14=&FFFFFFFF
<�
<< ݤAsk(string$,Default%,min%)
<F�X,Y,reply$,value%
<P-�autoreply$,"Defaults")� Default%>=min%�
<Z
=Default%
<d�
<n	�:�11
<x%�message_print_0(string$):X=�:Y=�
<��
<����=17�abort(�$,1)
<��
<��X,Y);Default%;�3;�X,Y);
<�*FX 15,1
<�
�""reply$
<��reply$=""�
<�value%=Default%
<��
<�value%=�(reply$)
<��
<��value%>=min%
<��X,Y);value%;�3
==value%
="!ݤInputDec(string$,min%,max%)
=,�X,Y,reply$,value%
=6	�:�11
=@5�message_print_2(string$,�(min%),�(max%)):X=�:Y=�
=J�
=T���=17�abort(�$,1)
=^�
=h�X,Y);�12;�X,Y);:�""reply$
=rvalue%=�(reply$)
=|�value%>=min%� value%<=max%
=�=value%
=�ݤInputHex(string$)
=��X,Y,reply$,value%
=�	�:�11
=�%�message_print_0(string$):X=�:Y=�
=��
=����=17�abort(�$,1)
=��X,Y);�12;�X,Y);:�""reply$
=�=�("&"+reply$)
=�ݤInputHex2(string$)
>�X,Y,reply$,value%
>	�:�11
>%�message_print_0(string$):X=�:Y=�
>:�X,Y);�12;�X,Y);:�""reply$
>D=�SectorAddr(reply$)
>bݤSectorAddr(reply$)
>l�add%,add2%
>v
add%=0
>�add2%=0
>�;ȕ�"abcdefABCDEF0123456789",�reply$,1))<>0��(reply$)<>0
>� add2%=(add2%<<4)+(add%>>>28)
>�add%=add%<<4
>�add%=add%+�("&"+�reply$,1))
>�reply$=�reply$,2)
>��
>�5=(add%>>>Log2SecSize%)+(add2%<<(32-Log2SecSize%))
>�+ݤChoose(select$,string$,opt$,default$)
?H=�choose_no_lookup(select$,�message_lookup_0(string$),opt$,default$)
? Eݤchoose_no_lookup(select$,String$,english_opt$,english_default$)
?*'�X,Y,reply$,start,end,opt$,default$
?4(opt$=�message_lookup_0(english_opt$)
?>�english_default$<>""�
?H5default$=�opt$,�english_opt$,english_default$),1)
?R�
?\default$=""
?f�
?z�autoreply$<>""�
?�start=�autoreply$,select$)
?� end=�autoreply$,",",start+1)
?��end=0�end=�(autoreply$)+1
?�
�start=0�
?�2�message_print_2("FailedAuto",select$,String$)
?��finish
?��
?�start+=�(select$)
?��start<>end�
?�2�dev%�String$;" ";�autoreply$,start,end-start)
?�!=�autoreply$,start,end-start)
?��
?��
@	�:�11
@�String$;:X=�:Y=�
@�
@$�
@.(�X,Y);default$;�12;�X,Y);:�""reply$
@8�reply$=""�reply$=default$
@B��(reply$)=1
@L,�opt$,reply$)=0�reply$=�(�(reply$)�&DF)
@V��opt$,reply$)
@t#=�english_opt$,�opt$,reply$),1)
@�ݤreadvarval(varname$)
@��varlen%,varbuf%
@��varbuf%256
@�9ș"XOS_ReadVarVal",varname$,varbuf%,256,0,3�,,varlen%
@�varbuf%?varlen%=13
@�
=$varbuf%
@���CheckPut(I%)
@�9check%=(check%>>>13)�((check%�(2^13-1))<<(32-13))� I%
A�
Aݤsum(base%,len%)
A(sum%=0:c%=0
A2�I%=len%-2�0�-1
A<sum%=sum%+base%?I%+c%
AF&�sum%<&100 c%=0�sum%=sum%�&FF:c%=1
AP�I%
AZ	=sum%
An��Sum(base%,len%)
Ax#base%?(len%-1)=�sum(base%,len%)
A��
A�%ݤNewMapCheck(B%,C%)=�(NewCheck%)
A�	��Asm
A��opt%=0�2�2
A�
P%=mc%
A�
[OPT opt%
A�.NewCheck%
A�
MOV R0,#0
A�ADDS R2,R1,R2\C=0
A�
.loop%
A�LDR R3,[R2,#-4]!
BADCS R0,R0,R3
BTEQS R2,R1
B
BNE loop%
B"� R3,R3,#&FF
B,SUB R0,R0,R3
B6� R0,R0,R0,LSR#16
B@� R0,R0,R0,LSR#8
BJ� R0,R0,#&FF
BTMOVS PC,R14
B^]
Bh	�opt%
Br�
B���DisableEscape
B�(ș"XOS_Byte",200,1,0�R0,OldEscState%
B�2ș"XOS_Byte",247,%10101010,0�R0,OldBreakState%
B��
B���RestoreEscape
B�#ș"XOS_Byte",200,OldEscState%,0
B�%ș"XOS_Byte",247,OldBreakState%,0
B��
B���MoanOp(b%,C%,D%,E%)
B��BigADFS%�
B�CșAdfsSwi%,0,b%�AltDefectBit%�(DiscRec%<<6),C%�Drive%<<29,D%,E%
C�
CNșAdfsSwi%,0,b%�AltDefectBit%�(DiscRec%<<6),(C%*SecSize%)�Drive%<<29,D%,E%
C�
C&�
CD��Op(b%,C%,D%,E%)
CN�BigADFS%�
CXcșAdfsSwi%�(1<<17),0,b%�AltDefectBit%�(DiscRec%<<6),C%�Drive%<<29,D%,E%�Result%,R1%,ErrDiscAdd%
Cb�
ClnșAdfsSwi%�(1<<17),0,b%�AltDefectBit%�(DiscRec%<<6),(C%*SecSize%)�Drive%<<29,D%,E%�Result%,R1%,ErrDiscAdd%
Cv�
C�
�Result%�
C��Verbose%�
C��"(""";
C�"I%=Result%+4:ȕ?I%�?I%:I%+=1:�
C�,�message_print_1("OpError",�~(!Result%))
C��
C��!Result%�(1<<31)�
C�3�message_print_1("Error",�~(Result%�&3FFFFFFF))
C��finish
C��
C�'�((!Result%)�&FFFFFF)=AdfsDiscErr%�
C�Result%=Result%?3
C��
D.�message_print_1("Error",�~(!Result%)):�32
DI%=4
DÈ•Result%?I%
D �Result%?I%
D*I%=I%+1
D4�
D>�finish
DH�
DR�
D\�
Df�
Dp�
D�ݤmatchstrings(str1$,str2$)
D��II%,JJ%,LI%,LJ%
D�II%=0:LI%=�(str1$)
D�JJ%=0:LJ%=�(str2$)
D��
D�0ȕII%<LI%��(�str1$,II%+1,1))=�(" "):II%+=1:�
D�0ȕJJ%<LJ%��(�str2$,JJ%+1,1))=�(" "):JJ%+=1:�
D��II%<LI%� JJ%<LJ%�
D�,�(�str1$,II%+1,1))<>�(�str2$,JJ%+1,1))�
D�=�
D��
E�
E�II%=LI%� JJ%=LJ%=�
E�
E$�II%<LI%II%+=1
E.�JJ%<LJ%JJ%+=1
E8�II%=LI%� JJ%=LJ%
EB=�
Ej��abort(why$,failcode%)
Et�dummy$
E~�
E�
E�
�=17�
E� �message_print_0("UserQuit")
E��finish
E��
E��msgs_file_open%�
E�-�message_print_2("HFormFailed",why$,�(�))
E��
E�*�'"HFORM failed : ";why$;" at line ";�
E��
F
 �autoreply$,"NOprompts")=0�
F�msgs_file_open%�
F �message_print_0("PressKey")
F(�
F2!�"Press Return to continue ";
F<�
FF
�""dummy$
FP�
FZ�finish
Fd�
F���finish
F�*set HForm$EndStatus 20
F�	�exit
F��
F�
��exit
F��close_message_file
F��
F��
G��restoreparams(iface%)
G�iface%�
G"�restorePROD
G,�
G6�restoreST506
G@�
GJ�
Gh��restorePROD
Gr�+1
G|�
H]� Conner Peripherals 40MB - CP3044,          TypeCP3044,     40,  4,  526, 1, 0,  525,  0
H&]� Conner Peripherals 42MB - CP2044,          TypeCP2044PK,   38,  4,  548, 1, 0,  547,  0
H0]� Conner Peripherals 63MB - CP2064,          TypeCP2064,     38,  4,  823, 1, 0,  822,  0
H:]� Conner Peripherals 210MB - CFS210A,        TypeCFS210A,    38, 16,  685, 1, 0,  684,  0
HD]� Conner Peripherals 270MB - CFS270A,        TypeCFS270A,    63, 14,  600, 1, 0,  599,  0
HN]� Conner Peripherals 420MB - CFS420A,        TypeCFS420A,    63, 16,  826, 1, 0,  825,  0
HX]� Conner Peripherals 425MB - CFS425A,        TypeCFS425A,    62, 16,  839, 1, 0,  838,  0
Hb]� Conner Peripherals 850MB - CFS850A,        TypeCFS850A,    63, 16, 1651, 1, 0, 1650,  1
Hv�� OTHER,                                     TypeOTHER,      1,  1,  1,   1, 1,  1, 1: REM Must be last, numbers irrelevant (except must be non zero).
H���restoreST506
H��+1
H��
H�\� 20Mb Miniscribe 8425,                      Type8425,       32, 4, 615, &3FF,  128, 663
H�\� 53Mb Rodime RO3065,                        TypeRO3065,     32, 7, 872, &3FF,  650, 871
H�\� 20Mb Kalok KL320,                          TypeKL320,      32, 4, 615, 615,   300, 615
H�m� OTHER,                                     TypeOTHER,      32, 4, 612, &3FF,  128, 611:REM MUST BE LAST
I>"��open_message_file(filename$)
IH�flags%,size%
IR6ș"MessageTrans_FileInfo",,filename$�flags%,,size%
I\6�(flags%� 1)�msgs_file_buf%=0��msgs_file_buf%size%
If7ș"OS_Module",6,,,17+�(filename$)�,,msgs_file_desc%
Ip#$(msgs_file_desc%+16)=filename$
IzOÈ™"MessageTrans_OpenFile",msgs_file_desc%,msgs_file_desc%+16,msgs_file_buf%
I�msgs_file_open%=�
I�msg_lookup_buf_size%=256
I�(�msg_lookup_buf%msg_lookup_buf_size%
I��
I���close_message_file
I��flags%
I��
I�
J�msgs_file_open%�
J6ș"MessageTrans_CloseFile",msgs_file_desc%�;flags%
Jmsgs_file_open%=�
J$�(flags%� 1)��
J.�
JB�msgs_file_desc%�
JL,ș"OS_Module",7,,msgs_file_desc%�;flags%
JVmsgs_file_desc%=0
J`�(flags%� 1)��
Jj�
Jt�
J�ݤmessage_lookup_0(tag$)
J�(=�message_lookup_4(tag$,"","","","")
J�"ݤmessage_lookup_1(tag$,arg1$)
J�+=�message_lookup_4(tag$,arg1$,"","","")
J�(ݤmessage_lookup_2(tag$,arg1$,arg2$)
J�.=�message_lookup_4(tag$,arg1$,arg2$,"","")
K
.ݤmessage_lookup_3(tag$,arg1$,arg2$,arg3$)
K1=�message_lookup_4(tag$,arg1$,arg2$,arg3$,"")
K(4ݤmessage_lookup_4(tag$,arg1$,arg2$,arg3$,arg4$)
K2	�len%
K<wș"MessageTrans_GSLookup",msgs_file_desc%,tag$,msg_lookup_buf%,msg_lookup_buf_size%,arg1$,arg2$,arg3$,arg4$�,,,len%
KFmsg_lookup_buf%?len%=13
KP=$msg_lookup_buf%
K���message_print_0(tag$)
K�&�message_print_4(tag$,"","","","")
K��
K�!��message_print_1(tag$,arg1$)
K�)�message_print_4(tag$,arg1$,"","","")
K��
K�'��message_print_2(tag$,arg1$,arg2$)
K�,�message_print_4(tag$,arg1$,arg2$,"","")
K��
K�-��message_print_3(tag$,arg1$,arg2$,arg3$)
L/�message_print_4(tag$,arg1$,arg2$,arg3$,"")
L�
L"3��message_print_4(tag$,arg1$,arg2$,arg3$,arg4$)
L,	�len%
L6wș"MessageTrans_GSLookup",msgs_file_desc%,tag$,msg_lookup_buf%,msg_lookup_buf_size%,arg1$,arg2$,arg3$,arg4$�,,,len%
L@&È™"OS_WriteN",msg_lookup_buf%,len%
LJ�
L�
ݤBigADFS
L��Misc_InfoPtr%
L��
L�
��:��:=�
L�#ș"ADFS_MiscOp",6�Misc_InfoPtr%
L���
L�%=((!Misc_InfoPtr%)�(1<<9))=(1<<9)
L���ShareSize
L�
�LFAU%
L�LFAU%=LinkBits%<<Log2Alloc%
L�Log2ShareSize%=0
L�,ȕ(253*(SecSize%<<Log2ShareSize%)<LFAU%)
MLog2ShareSize%+=1
M�
M ShareSize%=1<<Log2ShareSize%
M&�
M:ݤhexaddr(Sector%)
MD�high$,low$
MN)high$=�~(Sector%>>>(32-Log2SecSize%))
MXȕ(�(high$)<8)
Mbhigh$="0"+high$
Ml�
Mv$low$=�~(Sector%<<(Log2SecSize%))
M�ȕ(�(low$)<8)
M�low$="0"+low$
M��
M�=high$+low$
�
00000000  0d 00 0a 11 f4 20 3e 20  21 52 75 6e 49 6d 61 67  |..... > !RunImag|
00000010  65 0d 00 82 1a 2a 73 65  74 20 48 46 6f 72 6d 24  |e....*set HForm$|
00000020  45 6e 64 53 74 61 74 75  73 20 31 0d 00 8c 14 4c  |EndStatus 1....L|
00000030  6f 67 32 53 68 61 72 65  53 69 7a 65 25 3d 30 0d  |og2ShareSize%=0.|
00000040  00 96 20 53 68 61 72 65  53 69 7a 65 25 3d 31 3c  |.. ShareSize%=1<|
00000050  3c 4c 6f 67 32 53 68 61  72 65 53 69 7a 65 25 0d  |<Log2ShareSize%.|
00000060  00 a0 0a 64 65 76 25 3d  a3 0d 00 aa 11 56 65 72  |...dev%=.....Ver|
00000070  62 6f 73 65 25 3d 64 65  76 25 0d 00 c8 15 6d 73  |bose%=dev%....ms|
00000080  67 73 5f 66 69 6c 65 5f  64 65 73 63 25 3d 30 0d  |gs_file_desc%=0.|
00000090  00 d2 15 6d 73 67 73 5f  66 69 6c 65 5f 6f 70 65  |...msgs_file_ope|
000000a0  6e 25 3d a3 0d 00 dc 12  ee 85 f2 61 62 6f 72 74  |n%=........abort|
000000b0  28 f6 24 2c 31 29 0d 00  e6 0b ef 32 36 3a ef 31  |(.$,1).....26:.1|
000000c0  32 0d 00 f0 09 f2 49 6e  69 74 0d 00 fa 0d f2 47  |2.....Init.....G|
000000d0  65 74 53 68 61 70 65 0d  01 04 0f e7 ac 42 69 67  |etShape......Big|
000000e0  41 44 46 53 25 8c 0d 01  18 2e e7 28 44 69 73 63  |ADFS%......(Disc|
000000f0  53 69 7a 65 32 25 3c 3e  30 84 28 44 69 73 63 53  |Size2%<>0.(DiscS|
00000100  69 7a 65 25 80 26 45 30  30 30 30 30 30 30 29 3c  |ize%.&E0000000)<|
00000110  3e 30 29 8c 0d 01 22 25  f2 6d 65 73 73 61 67 65  |>0)..."%.message|
00000120  5f 70 72 69 6e 74 5f 30  28 22 44 69 73 63 53 69  |_print_0("DiscSi|
00000130  7a 65 45 72 72 6f 72 22  29 0d 01 2c 0b f2 66 69  |zeError")..,..fi|
00000140  6e 69 73 68 0d 01 36 05  cd 0d 01 40 05 cd 0d 01  |nish..6....@....|
00000150  4a 42 46 6f 72 6d 61 74  46 6c 61 67 25 3d 28 a4  |JBFormatFlag%=(.|
00000160  43 68 6f 6f 73 65 28 22  51 30 31 3a 22 2c 22 46  |Choose("Q01:","F|
00000170  6f 72 6d 61 74 4f 72 49  6e 69 74 43 68 6f 6f 73  |ormatOrInitChoos|
00000180  65 22 2c 22 46 49 22 2c  22 22 29 3d 22 46 22 29  |e","FI","")="F")|
00000190  0d 01 54 38 53 6f 61 6b  53 74 79 6c 65 24 3d a4  |..T8SoakStyle$=.|
000001a0  43 68 6f 6f 73 65 28 22  51 30 32 3a 22 2c 22 53  |Choose("Q02:","S|
000001b0  6f 61 6b 54 65 73 74 43  68 6f 6f 73 65 22 2c 22  |oakTestChoose","|
000001c0  4c 53 4e 22 2c 22 22 29  0d 01 5e 38 42 6f 6f 74  |LSN","")..^8Boot|
000001d0  4f 70 74 24 3d a4 43 68  6f 6f 73 65 28 22 42 6f  |Opt$=.Choose("Bo|
000001e0  6f 74 4f 70 74 3a 22 2c  22 42 6f 6f 74 4f 70 74  |otOpt:","BootOpt|
000001f0  43 68 6f 6f 73 65 22 2c  22 59 4e 22 2c 22 22 29  |Choose","YN","")|
00000200  0d 01 68 5b e7 a4 63 68  6f 6f 73 65 5f 6e 6f 5f  |..h[..choose_no_|
00000210  6c 6f 6f 6b 75 70 28 22  51 30 33 3a 22 2c a4 6d  |lookup("Q03:",.m|
00000220  65 73 73 61 67 65 5f 6c  6f 6f 6b 75 70 5f 31 28  |essage_lookup_1(|
00000230  22 53 75 72 65 43 68 6f  6f 73 65 22 2c c3 28 44  |"SureChoose",.(D|
00000240  72 69 76 65 25 29 29 2c  22 59 4e 22 2c 22 22 29  |rive%)),"YN","")|
00000250  3d 22 4e 22 f2 66 69 6e  69 73 68 0d 01 7c 12 f2  |="N".finish..|..|
00000260  44 69 73 61 62 6c 65 45  73 63 61 70 65 0d 01 86  |DisableEscape...|
00000270  1b f2 4d 6f 61 6e 4f 70  28 53 70 65 63 69 66 79  |..MoanOp(Specify|
00000280  25 2c 30 2c 30 2c 30 29  0d 01 90 11 e7 46 6f 72  |%,0,0,0).....For|
00000290  6d 61 74 46 6c 61 67 25  8c 0d 01 9a 0b f2 46 6f  |matFlag%......Fo|
000002a0  72 6d 61 74 0d 01 a4 05  cd 0d 01 ae 15 e7 53 6f  |rmat..........So|
000002b0  61 6b 53 74 79 6c 65 24  3c 3e 22 4e 22 8c 0d 01  |akStyle$<>"N"...|
000002c0  b8 1e 53 6f 61 6b 46 6c  61 67 25 3d 28 53 6f 61  |..SoakFlag%=(Soa|
000002d0  6b 53 74 79 6c 65 24 3d  22 4c 22 29 0d 01 c2 0b  |kStyle$="L")....|
000002e0  f2 56 65 72 69 66 79 0d  01 cc 05 cd 0d 01 d6 05  |.Verify.........|
000002f0  f1 0d 01 e0 0e f2 53 74  72 75 63 74 75 72 65 0d  |......Structure.|
00000300  01 ea 12 f2 52 65 73 74  6f 72 65 45 73 63 61 70  |....RestoreEscap|
00000310  65 0d 02 08 1f ff 28 22  2d 41 44 46 53 2d 25 4d  |e.....("-ADFS-%M|
00000320  4f 55 4e 54 20 3a 22 2b  c3 44 72 69 76 65 25 29  |OUNT :"+.Drive%)|
00000330  0d 02 12 1e ff 28 22 2d  41 44 46 53 2d 25 46 52  |.....("-ADFS-%FR|
00000340  45 45 20 3a 22 2b c3 44  72 69 76 65 25 29 0d 02  |EE :"+.Drive%)..|
00000350  1c 22 ff 28 22 2d 41 44  46 53 2d 25 44 49 53 4d  |.".("-ADFS-%DISM|
00000360  4f 55 4e 54 20 3a 22 2b  c3 44 72 69 76 65 25 29  |OUNT :"+.Drive%)|
00000370  0d 02 3a 1a 2a 73 65 74  20 48 46 6f 72 6d 24 45  |..:.*set HForm$E|
00000380  6e 64 53 74 61 74 75 73  20 30 0d 02 44 09 f2 65  |ndStatus 0..D..e|
00000390  78 69 74 0d 02 62 0a dd  f2 49 6e 69 74 0d 02 6c  |xit..b...Init..l|
000003a0  11 ea 44 72 69 76 65 4f  66 66 73 65 74 25 0d 02  |..DriveOffset%..|
000003b0  76 2e f2 6f 70 65 6e 5f  6d 65 73 73 61 67 65 5f  |v..open_message_|
000003c0  66 69 6c 65 28 22 3c 48  46 6f 72 6d 24 44 69 72  |file("<HForm$Dir|
000003d0  3e 2e 4d 65 73 73 61 67  65 73 22 29 0d 02 80 1e  |>.Messages")....|
000003e0  f2 6d 65 73 73 61 67 65  5f 70 72 69 6e 74 5f 30  |.message_print_0|
000003f0  28 22 42 61 6e 6e 65 72  22 29 0d 02 94 2d 61 75  |("Banner")...-au|
00000400  74 6f 72 65 70 6c 79 24  3d a4 72 65 61 64 76 61  |toreply$=.readva|
00000410  72 76 61 6c 28 22 48 66  6f 72 6d 24 41 75 74 6f  |rval("Hform$Auto|
00000420  72 65 70 6c 79 22 29 0d  02 a8 25 c8 99 22 58 4f  |reply")...%.."XO|
00000430  53 5f 4d 6f 64 75 6c 65  22 2c 31 38 2c 22 41 44  |S_Module",18,"AD|
00000440  46 53 22 b8 2c 2c 2c 41  25 3b 46 25 0d 02 b2 2b  |FS".,,,A%;F%...+|
00000450  e7 46 25 80 31 f2 6d 65  73 73 61 67 65 5f 70 72  |.F%.1.message_pr|
00000460  69 6e 74 5f 30 28 22 4e  6f 41 44 46 53 22 29 3a  |int_0("NoADFS"):|
00000470  f2 66 69 6e 69 73 68 0d  02 bc 0d 41 25 2b 3d 41  |.finish....A%+=A|
00000480  25 21 32 30 0d 02 c6 29  c8 95 28 3f 41 25 3c 3e  |%!20...)..(?A%<>|
00000490  33 32 29 80 28 3f 41 25  3c 3e 39 29 80 28 3f 41  |32).(?A%<>9).(?A|
000004a0  25 3c 3e 30 29 3a 41 25  2b 3d 31 3a ce 0d 02 d0  |%<>0):A%+=1:....|
000004b0  11 e7 3f 41 25 3d 30 f2  66 69 6e 69 73 68 0d 02  |..?A%=0.finish..|
000004c0  da 23 c8 95 28 3f 41 25  3c 97 22 30 22 29 84 28  |.#..(?A%<."0").(|
000004d0  3f 41 25 3e 97 22 39 22  29 3a 41 25 2b 3d 31 3a  |?A%>."9"):A%+=1:|
000004e0  ce 0d 02 e4 3b 41 44 46  53 56 65 72 73 69 6f 6e  |....;ADFSVersion|
000004f0  25 3d 28 28 3f 41 25 2d  97 22 30 22 29 2a 31 30  |%=((?A%-."0")*10|
00000500  2b 28 41 25 3f 32 29 2d  97 22 30 22 29 2a 31 30  |+(A%?2)-."0")*10|
00000510  2b 28 41 25 3f 33 29 2d  97 22 30 22 0d 02 ee 1d  |+(A%?3)-."0"....|
00000520  c8 99 22 41 44 46 53 5f  44 72 69 76 65 73 22 b8  |.."ADFS_Drives".|
00000530  2c 2c 48 44 69 73 63 73  25 0d 02 f8 35 e7 48 44  |,,HDiscs%...5.HD|
00000540  69 73 63 73 25 3c 31 f2  6d 65 73 73 61 67 65 5f  |iscs%<1.message_|
00000550  70 72 69 6e 74 5f 30 28  22 4e 6f 48 61 72 64 44  |print_0("NoHardD|
00000560  69 73 63 73 22 29 3a f2  66 69 6e 69 73 68 0d 03  |iscs"):.finish..|
00000570  20 15 42 69 67 41 44 46  53 25 3d a4 42 69 67 41  | .BigADFS%=.BigA|
00000580  44 46 53 0d 03 34 26 44  72 69 76 65 4f 66 66 73  |DFS..4&DriveOffs|
00000590  65 74 25 3d a7 61 75 74  6f 72 65 70 6c 79 24 2c  |et%=.autoreply$,|
000005a0  22 44 72 69 76 65 3d 22  29 0d 03 3e 17 e7 28 44  |"Drive=")..>..(D|
000005b0  72 69 76 65 4f 66 66 73  65 74 25 3c 3e 30 29 8c  |riveOffset%<>0).|
000005c0  0d 03 48 29 44 72 69 76  65 25 3d bb 28 c1 61 75  |..H)Drive%=.(.au|
000005d0  74 6f 72 65 70 6c 79 24  2c 44 72 69 76 65 4f 66  |toreply$,DriveOf|
000005e0  66 73 65 74 25 2b 36 29  29 0d 03 52 05 cc 0d 03  |fset%+6))..R....|
000005f0  5c 05 f5 0d 03 66 1f 44  72 69 76 65 25 3d a4 41  |\....f.Drive%=.A|
00000600  73 6b 28 22 44 72 69 76  65 41 73 6b 22 2c 34 2c  |sk("DriveAsk",4,|
00000610  34 29 0d 03 70 19 fd 44  72 69 76 65 25 3e 3d 34  |4)..p..Drive%>=4|
00000620  80 20 44 72 69 76 65 25  3c 3d 37 0d 03 7a 05 cd  |. Drive%<=7..z..|
00000630  0d 03 8e 18 e7 28 44 72  69 76 65 25 2d 33 29 3e  |.....(Drive%-3)>|
00000640  48 44 69 73 63 73 25 8c  0d 03 98 2f f2 6d 65 73  |HDiscs%..../.mes|
00000650  73 61 67 65 5f 70 72 69  6e 74 5f 31 28 22 53 69  |sage_print_1("Si|
00000660  6c 6c 79 44 69 73 63 4e  75 6d 22 2c c3 28 48 44  |llyDiscNum",.(HD|
00000670  69 73 63 73 25 29 29 0d  03 a2 0b f2 66 69 6e 69  |iscs%)).....fini|
00000680  73 68 0d 03 ac 05 cd 0d  03 b6 16 e7 41 44 46 53  |sh..........ADFS|
00000690  56 65 72 73 69 6f 6e 25  3c 32 31 30 8c 0d 03 c0  |Version%<210....|
000006a0  0a 49 44 45 25 3d a3 0d  03 ca 05 cc 0d 03 d4 2d  |.IDE%=.........-|
000006b0  c8 99 22 41 44 46 53 5f  43 6f 6e 74 72 6f 6c 6c  |.."ADFS_Controll|
000006c0  65 72 54 79 70 65 22 2c  44 72 69 76 65 25 b8 44  |erType",Drive%.D|
000006d0  72 69 76 65 54 79 70 65  25 0d 03 de 12 e7 44 72  |riveType%.....Dr|
000006e0  69 76 65 54 79 70 65 25  3d 30 8c 0d 03 e8 31 f2  |iveType%=0....1.|
000006f0  6d 65 73 73 61 67 65 5f  70 72 69 6e 74 5f 31 28  |message_print_1(|
00000700  22 44 72 69 76 65 4e 6f  74 50 72 65 73 65 6e 74  |"DriveNotPresent|
00000710  22 2c c3 28 44 72 69 76  65 25 29 29 0d 03 f2 0b  |",.(Drive%))....|
00000720  f2 66 69 6e 69 73 68 0d  03 fc 05 cc 0d 04 06 3b  |.finish........;|
00000730  e7 44 72 69 76 65 54 79  70 65 25 3d 33 f2 6d 65  |.DriveType%=3.me|
00000740  73 73 61 67 65 5f 70 72  69 6e 74 5f 31 28 22 44  |ssage_print_1("D|
00000750  72 69 76 65 49 73 53 54  35 30 36 22 2c c3 28 44  |riveIsST506",.(D|
00000760  72 69 76 65 25 29 29 0d  04 10 39 e7 44 72 69 76  |rive%))...9.Driv|
00000770  65 54 79 70 65 25 3d 34  f2 6d 65 73 73 61 67 65  |eType%=4.message|
00000780  5f 70 72 69 6e 74 5f 31  28 22 44 72 69 76 65 49  |_print_1("DriveI|
00000790  73 49 44 45 22 2c c3 28  44 72 69 76 65 25 29 29  |sIDE",.(Drive%))|
000007a0  0d 04 1a 05 cd 0d 04 24  15 49 44 45 25 3d 44 72  |.......$.IDE%=Dr|
000007b0  69 76 65 54 79 70 65 25  3d 34 0d 04 2e 05 cd 0d  |iveType%=4......|
000007c0  04 38 0a e7 49 44 45 25  8c 0d 04 4c 2b c8 99 22  |.8..IDE%...L+.."|
000007d0  58 41 44 46 53 5f 43 6f  6e 74 72 6f 6c 6c 65 72  |XADFS_Controller|
000007e0  54 79 70 65 22 2c 44 72  69 76 65 25 2d 31 b8 41  |Type",Drive%-1.A|
000007f0  25 3b 46 25 0d 04 56 2e  e7 28 28 46 25 80 31 29  |%;F%..V..((F%.1)|
00000800  3d 30 29 80 28 41 25 3d  34 29 8c 49 44 45 64 72  |=0).(A%=4).IDEdr|
00000810  69 76 65 25 3d 31 8b 49  44 45 64 72 69 76 65 25  |ive%=1.IDEdrive%|
00000820  3d 30 0d 04 60 0e de 49  44 45 69 64 25 35 31 32  |=0..`..IDEid%512|
00000830  0d 04 6a 0c de 49 44 45  70 62 25 37 0d 04 74 0e  |..j..IDEpb%7..t.|
00000840  49 44 45 70 62 25 21 30  3d 30 0d 04 7e 0e 49 44  |IDEpb%!0=0..~.ID|
00000850  45 70 62 25 21 34 3d 30  0d 04 88 1f 49 44 45 70  |Epb%!4=0....IDEp|
00000860  62 25 3f 35 3d 26 41 30  2b 28 49 44 45 64 72 69  |b%?5=&A0+(IDEdri|
00000870  76 65 25 3c 3c 34 29 0d  04 92 10 49 44 45 70 62  |ve%<<4)....IDEpb|
00000880  25 3f 36 3d 26 45 43 0d  04 9c 3a c8 99 22 41 44  |%?6=&EC...:.."AD|
00000890  46 53 5f 49 44 45 55 73  65 72 4f 70 22 2c 31 3c  |FS_IDEUserOp",1<|
000008a0  3c 32 34 2c 2c 49 44 45  70 62 25 2c 49 44 45 69  |<24,,IDEpb%,IDEi|
000008b0  64 25 2c 35 31 32 b8 72  30 25 2c 2c 2c 2c 72 34  |d%,512.r0%,,,,r4|
000008c0  25 0d 04 a6 13 e7 72 30  25 3c 3e 30 84 72 34 25  |%.....r0%<>0.r4%|
000008d0  3c 3e 30 8c 0d 04 b0 2b  f2 6d 65 73 73 61 67 65  |<>0....+.message|
000008e0  5f 70 72 69 6e 74 5f 31  28 22 44 69 73 63 49 64  |_print_1("DiscId|
000008f0  45 72 72 6f 72 22 2c c3  7e 28 72 30 25 29 29 0d  |Error",.~(r0%)).|
00000900  04 ba 25 49 44 45 63 79  6c 73 25 3d 30 3a 49 44  |..%IDEcyls%=0:ID|
00000910  45 68 65 61 64 73 25 3d  30 3a 49 44 45 73 65 63  |Eheads%=0:IDEsec|
00000920  73 25 3d 30 0d 04 c4 05  cc 0d 04 ce 1d 49 44 45  |s%=0.........IDE|
00000930  63 79 6c 73 25 3d 28 49  44 45 69 64 25 21 32 29  |cyls%=(IDEid%!2)|
00000940  80 26 46 46 46 46 0d 04  d8 1e 49 44 45 68 65 61  |.&FFFF....IDEhea|
00000950  64 73 25 3d 28 49 44 45  69 64 25 21 36 29 80 26  |ds%=(IDEid%!6).&|
00000960  46 46 46 46 0d 04 e2 1e  49 44 45 73 65 63 73 25  |FFFF....IDEsecs%|
00000970  3d 28 49 44 45 69 64 25  21 31 32 29 80 26 46 46  |=(IDEid%!12).&FF|
00000980  46 46 0d 04 ec 20 49 44  45 43 61 70 61 63 69 74  |FF... IDECapacit|
00000990  79 25 3d 28 49 44 45 69  64 25 21 28 35 37 2a 32  |y%=(IDEid%!(57*2|
000009a0  29 29 0d 04 f6 24 49 44  45 41 64 64 72 65 73 73  |))...$IDEAddress|
000009b0  53 70 61 63 65 25 3d 28  49 44 45 69 64 25 21 28  |Space%=(IDEid%!(|
000009c0  36 30 2a 32 29 29 0d 05  00 0f 49 44 45 6e 61 6d  |60*2))....IDEnam|
000009d0  65 24 3d 22 22 0d 05 0a  36 e7 28 28 28 49 44 45  |e$=""...6.(((IDE|
000009e0  69 64 25 21 39 38 29 3e  3e 39 29 80 31 29 3c 3e  |id%!98)>>9).1)<>|
000009f0  30 8c 49 44 45 48 61 73  4c 42 41 25 3d 31 8b 49  |0.IDEHasLBA%=1.I|
00000a00  44 45 48 61 73 4c 42 41  25 3d 30 0d 05 14 13 e3  |DEHasLBA%=0.....|
00000a10  49 25 3d 32 37 2a 32 b8  34 36 2a 32 88 32 0d 05  |I%=27*2.46*2.2..|
00000a20  1e 25 41 25 3d 28 49 44  45 69 64 25 3f 28 49 25  |.%A%=(IDEid%?(I%|
00000a30  2b 31 29 29 3a 42 25 3d  28 49 44 45 69 64 25 3f  |+1)):B%=(IDEid%?|
00000a40  49 25 29 0d 05 28 1d e7  28 41 25 3c 33 32 29 84  |I%)..(..(A%<32).|
00000a50  28 41 25 3e 3d 31 32 37  29 41 25 3d 97 22 2e 22  |(A%>=127)A%=."."|
00000a60  0d 05 32 13 49 44 45 6e  61 6d 65 24 2b 3d bd 28  |..2.IDEname$+=.(|
00000a70  41 25 29 0d 05 3c 1d e7  28 42 25 3c 33 32 29 84  |A%)..<..(B%<32).|
00000a80  28 42 25 3e 3d 31 32 37  29 42 25 3d 97 22 2e 22  |(B%>=127)B%=."."|
00000a90  0d 05 46 13 49 44 45 6e  61 6d 65 24 2b 3d bd 28  |..F.IDEname$+=.(|
00000aa0  42 25 29 0d 05 50 05 ed  0d 05 5a 0f 49 44 45 66  |B%)..P....Z.IDEf|
00000ab0  69 72 6d 24 3d 22 22 0d  05 64 13 e3 49 25 3d 32  |irm$=""..d..I%=2|
00000ac0  33 2a 32 b8 32 36 2a 32  88 32 0d 05 6e 25 41 25  |3*2.26*2.2..n%A%|
00000ad0  3d 28 49 44 45 69 64 25  3f 28 49 25 2b 31 29 29  |=(IDEid%?(I%+1))|
00000ae0  3a 42 25 3d 28 49 44 45  69 64 25 3f 49 25 29 0d  |:B%=(IDEid%?I%).|
00000af0  05 78 1d e7 28 41 25 3c  33 32 29 84 28 41 25 3e  |.x..(A%<32).(A%>|
00000b00  3d 31 32 37 29 41 25 3d  97 22 2e 22 0d 05 82 13  |=127)A%=."."....|
00000b10  49 44 45 66 69 72 6d 24  2b 3d bd 28 41 25 29 0d  |IDEfirm$+=.(A%).|
00000b20  05 8c 1d e7 28 42 25 3c  33 32 29 84 28 42 25 3e  |....(B%<32).(B%>|
00000b30  3d 31 32 37 29 42 25 3d  97 22 2e 22 0d 05 96 13  |=127)B%=."."....|
00000b40  49 44 45 66 69 72 6d 24  2b 3d bd 28 42 25 29 0d  |IDEfirm$+=.(B%).|
00000b50  05 a0 05 ed 0d 05 aa 42  f2 6d 65 73 73 61 67 65  |.......B.message|
00000b60  5f 70 72 69 6e 74 5f 33  28 22 49 44 45 44 65 73  |_print_3("IDEDes|
00000b70  63 72 69 70 74 69 6f 6e  22 2c c3 28 44 72 69 76  |cription",.(Driv|
00000b80  65 25 29 2c 49 44 45 6e  61 6d 65 24 2c 49 44 45  |e%),IDEname$,IDE|
00000b90  66 69 72 6d 24 29 0d 05  b4 4d f2 6d 65 73 73 61  |firm$)...M.messa|
00000ba0  67 65 5f 70 72 69 6e 74  5f 33 28 22 49 44 45 43  |ge_print_3("IDEC|
00000bb0  6f 6e 66 69 67 75 72 61  74 69 6f 6e 22 2c c3 28  |onfiguration",.(|
00000bc0  49 44 45 63 79 6c 73 25  29 2c c3 28 49 44 45 68  |IDEcyls%),.(IDEh|
00000bd0  65 61 64 73 25 29 2c c3  28 49 44 45 73 65 63 73  |eads%),.(IDEsecs|
00000be0  25 29 29 0d 05 be 13 e7  49 44 45 48 61 73 4c 42  |%)).....IDEHasLB|
00000bf0  41 25 3c 3e 30 8c 0d 05  c8 21 f2 6d 65 73 73 61  |A%<>0....!.messa|
00000c00  67 65 5f 70 72 69 6e 74  5f 30 28 22 49 44 45 48  |ge_print_0("IDEH|
00000c10  61 73 4c 42 41 22 29 0d  05 d2 05 cd 0d 05 dc 05  |asLBA").........|
00000c20  cd 0d 05 e6 05 cd 0d 05  f0 11 4d 61 6b 65 50 61  |..........MakePa|
00000c30  72 61 6d 73 25 3d 37 0d  05 fa 14 56 65 72 69 66  |rams%=7....Verif|
00000c40  79 52 65 74 72 69 65 73  25 3d 31 0d 06 04 14 44  |yRetries%=1....D|
00000c50  65 66 65 63 74 52 65 74  72 69 65 73 25 3d 35 0d  |efectRetries%=5.|
00000c60  06 0e 0d 56 65 72 69 66  79 25 3d 30 0d 06 18 0b  |...Verify%=0....|
00000c70  52 65 61 64 25 3d 31 0d  06 22 0c 57 72 69 74 65  |Read%=1..".Write|
00000c80  25 3d 32 0d 06 2c 11 57  72 69 74 65 54 72 61 63  |%=2..,.WriteTrac|
00000c90  6b 25 3d 34 0d 06 36 0e  52 65 73 74 6f 72 65 25  |k%=4..6.Restore%|
00000ca0  3d 36 0d 06 40 0f 53 70  65 63 69 66 79 25 3d 26  |=6..@.Specify%=&|
00000cb0  46 0d 06 4a 15 41 6c 74  44 65 66 65 63 74 42 69  |F..J.AltDefectBi|
00000cc0  74 25 3d 26 31 30 0d 06  54 12 44 69 73 63 53 74  |t%=&10..T.DiscSt|
00000cd0  72 75 63 25 3d 26 31 34  0d 06 68 0a e7 49 44 45  |ruc%=&14..h..IDE|
00000ce0  25 8c 0d 06 72 12 4c 6f  67 32 53 65 63 53 69 7a  |%...r.Log2SecSiz|
00000cf0  65 25 3d 39 0d 06 7c 10  4c 6f 77 53 65 63 74 6f  |e%=9..|.LowSecto|
00000d00  72 25 3d 31 0d 06 86 05  cc 0d 06 90 12 4c 6f 67  |r%=1.........Log|
00000d10  32 53 65 63 53 69 7a 65  25 3d 38 0d 06 9a 10 4c  |2SecSize%=8....L|
00000d20  6f 77 53 65 63 74 6f 72  25 3d 30 0d 06 a4 05 cd  |owSector%=0.....|
00000d30  0d 06 ae 1b 53 65 63 53  69 7a 65 25 3d 32 5e 4c  |....SecSize%=2^L|
00000d40  6f 67 32 53 65 63 53 69  7a 65 25 0d 06 c2 10 4f  |og2SecSize%....O|
00000d50  6c 64 4d 61 70 41 64 64  25 3d 30 0d 06 cc 14 4f  |ldMapAdd%=0....O|
00000d60  6c 64 4d 61 70 53 69 7a  65 25 3d 26 32 30 30 0d  |ldMapSize%=&200.|
00000d70  06 d6 11 44 69 72 53 69  7a 65 25 3d 26 38 30 30  |...DirSize%=&800|
00000d80  0d 06 ea 1a 42 6f 6f 74  41 64 64 25 3d 26 43 30  |....BootAdd%=&C0|
00000d90  30 2f 53 65 63 53 69 7a  65 25 0d 06 f4 12 42 6f  |0/SecSize%....Bo|
00000da0  6f 74 53 69 7a 65 25 3d  26 32 30 30 0d 07 4e 28  |otSize%=&200..N(|
00000db0  4d 61 78 44 65 66 65 63  74 73 25 3d 28 42 6f 6f  |MaxDefects%=(Boo|
00000dc0  74 53 69 7a 65 25 2d 36  34 2d 26 31 30 2d 34 2d  |tSize%-64-&10-4-|
00000dd0  34 29 81 34 0d 07 8a 20  42 69 67 4d 61 78 44 65  |4).4... BigMaxDe|
00000de0  66 65 63 74 73 25 3d 4d  61 78 44 65 66 65 63 74  |fects%=MaxDefect|
00000df0  73 25 2d 31 0d 07 9e 14  45 6e 64 44 65 66 65 63  |s%-1....EndDefec|
00000e00  74 25 3d 31 3c 3c 32 39  0d 07 d0 15 45 6e 64 44  |t%=1<<29....EndD|
00000e10  65 66 65 63 74 32 25 3d  31 3c 3c 33 30 0d 07 e4  |efect2%=1<<30...|
00000e20  10 4f 6c 64 4c 57 4d 25  3d 26 45 30 30 0d 07 ee  |.OldLWM%=&E00...|
00000e30  0f 46 72 65 65 4c 69 6e  6b 25 3d 31 0d 07 f8 11  |.FreeLink%=1....|
00000e40  43 72 6f 73 73 43 68 65  63 6b 25 3d 33 0d 08 0c  |CrossCheck%=3...|
00000e50  0e e7 42 69 67 41 44 46  53 25 8c 0d 08 16 13 41  |..BigADFS%.....A|
00000e60  64 66 73 53 77 69 25 3d  26 34 30 32 34 44 0d 08  |dfsSwi%=&4024D..|
00000e70  20 05 cc 0d 08 2a 13 41  64 66 73 53 77 69 25 3d  | ....*.AdfsSwi%=|
00000e80  26 34 30 32 34 30 0d 08  34 05 cd 0d 08 48 17 41  |&40240..4....H.A|
00000e90  64 66 73 44 69 73 63 45  72 72 25 3d 26 31 30 38  |dfsDiscErr%=&108|
00000ea0  43 37 0d 08 52 14 4d 61  78 56 65 72 69 66 79 42  |C7..R.MaxVerifyB|
00000eb0  61 64 25 3d 31 36 0d 08  5c 0f 50 61 74 74 65 72  |ad%=16..\.Patter|
00000ec0  6e 73 25 3d 38 0d 08 66  70 de 42 75 66 25 26 34  |ns%=8..fp.Buf%&4|
00000ed0  30 30 30 30 2c 44 69 73  63 52 65 63 25 36 34 2b  |0000,DiscRec%64+|
00000ee0  42 6f 6f 74 53 69 7a 65  25 2c 44 65 66 65 63 74  |BootSize%,Defect|
00000ef0  25 42 6f 6f 74 53 69 7a  65 25 2c 44 69 72 4d 61  |%BootSize%,DirMa|
00000f00  72 6b 25 35 2c 42 61 64  25 28 4d 61 78 56 65 72  |rk%5,Bad%(MaxVer|
00000f10  69 66 79 42 61 64 25 29  2c 6d 63 25 31 30 30 2c  |ifyBad%),mc%100,|
00000f20  50 61 74 74 65 72 6e 25  28 50 61 74 74 65 72 6e  |Pattern%(Pattern|
00000f30  73 25 2d 31 29 0d 08 70  15 42 6f 6f 74 25 3d 44  |s%-1)..p.Boot%=D|
00000f40  69 73 63 52 65 63 25 2b  36 34 0d 08 7a 1f 42 6f  |iscRec%+64..z.Bo|
00000f50  6f 74 52 65 63 25 3d 42  6f 6f 74 25 2b 42 6f 6f  |otRec%=Boot%+Boo|
00000f60  74 53 69 7a 65 25 2d 36  34 0d 08 f2 17 50 61 74  |tSize%-64....Pat|
00000f70  74 65 72 6e 25 28 32 29  3d 26 46 46 46 46 46 46  |tern%(2)=&FFFFFF|
00000f80  0d 08 fc 17 50 61 74 74  65 72 6e 25 28 33 29 3d  |....Pattern%(3)=|
00000f90  26 36 44 42 36 44 42 0d  09 06 11 50 61 74 74 65  |&6DB6DB....Patte|
00000fa0  72 6e 25 28 34 29 3d 30  0d 09 10 17 50 61 74 74  |rn%(4)=0....Patt|
00000fb0  65 72 6e 25 28 35 29 3d  26 32 43 42 32 43 42 0d  |ern%(5)=&2CB2CB.|
00000fc0  09 1a 17 50 61 74 74 65  72 6e 25 28 36 29 3d 26  |...Pattern%(6)=&|
00000fd0  35 41 35 41 35 41 0d 09  24 17 50 61 74 74 65 72  |5A5A5A..$.Patter|
00000fe0  6e 25 28 37 29 3d 26 34  44 33 34 44 33 0d 09 2e  |n%(7)=&4D34D3...|
00000ff0  2e 53 65 63 73 50 65 72  54 72 6b 25 3d 33 32 3a  |.SecsPerTrk%=32:|
00001000  48 65 61 64 73 25 3d 31  3a 43 79 6c 73 25 3d 31  |Heads%=1:Cyls%=1|
00001010  3a 50 61 72 6b 43 79 6c  25 3d 31 0d 09 38 0a e7  |:ParkCyl%=1..8..|
00001020  49 44 45 25 8c 0d 09 42  0f 49 6e 69 74 46 6c 61  |IDE%...B.InitFla|
00001030  67 25 3d 30 0d 09 4c 0e  4c 42 41 66 6c 61 67 25  |g%=0..L.LBAflag%|
00001040  3d 30 0d 09 56 05 cc 0d  09 60 22 4c 6f 77 43 75  |=0..V....`"LowCu|
00001050  72 72 65 6e 74 43 79 6c  25 3d 31 3a 50 72 65 43  |rrentCyl%=1:PreC|
00001060  6f 6d 70 43 79 6c 25 3d  31 0d 09 6a 05 cd 0d 09  |ompCyl%=1..j....|
00001070  7e 0d e7 42 69 67 41 44  46 53 25 0d 09 88 18 52  |~..BigADFS%....R|
00001080  6f 6f 74 44 69 72 41 64  64 25 3d 26 34 30 30 2f  |ootDirAdd%=&400/|
00001090  35 31 32 0d 09 92 05 cc  0d 09 9c 14 52 6f 6f 74  |512.........Root|
000010a0  44 69 72 41 64 64 25 3d  26 34 30 30 0d 09 a6 05  |DirAdd%=&400....|
000010b0  cd 0d 09 ba 1e 4c 6f 67  32 41 6c 6c 6f 63 25 3d  |.....Log2Alloc%=|
000010c0  31 30 3a 4c 69 6e 6b 42  69 74 73 25 3d 31 30 0d  |10:LinkBits%=10.|
000010d0  09 c4 0e f2 53 68 61 72  65 53 69 7a 65 0d 09 ce  |....ShareSize...|
000010e0  1e 49 6e 64 52 6f 6f 74  44 69 72 41 64 64 25 3d  |.IndRootDirAdd%=|
000010f0  52 6f 6f 74 44 69 72 41  64 64 25 0d 0a 00 10 e7  |RootDirAdd%.....|
00001100  49 44 45 48 61 73 4c 42  41 25 8c 0d 0a 0a 24 53  |IDEHasLBA%....$S|
00001110  65 63 74 6f 72 73 50 65  72 44 69 73 63 25 3d 49  |ectorsPerDisc%=I|
00001120  44 45 41 64 64 72 65 73  73 53 70 61 63 65 25 0d  |DEAddressSpace%.|
00001130  0a 14 05 cc 0d 0a 1e 20  53 65 63 74 6f 72 73 50  |....... SectorsP|
00001140  65 72 44 69 73 63 25 3d  49 44 45 43 61 70 61 63  |erDisc%=IDECapac|
00001150  69 74 79 25 0d 0a 28 05  cd 0d 0a 32 48 44 69 73  |ity%..(....2HDis|
00001160  63 53 69 7a 65 25 3d 28  53 65 63 74 6f 72 73 50  |cSize%=(SectorsP|
00001170  65 72 44 69 73 63 25 80  28 28 31 3c 3c 28 33 32  |erDisc%.((1<<(32|
00001180  2d 4c 6f 67 32 53 65 63  53 69 7a 65 25 29 29 2d  |-Log2SecSize%))-|
00001190  31 29 29 3c 3c 4c 6f 67  32 53 65 63 53 69 7a 65  |1))<<Log2SecSize|
000011a0  25 0d 0a 3c 33 44 69 73  63 53 69 7a 65 32 25 3d  |%..<3DiscSize2%=|
000011b0  28 53 65 63 74 6f 72 73  50 65 72 44 69 73 63 25  |(SectorsPerDisc%|
000011c0  3e 3e 28 33 32 2d 4c 6f  67 32 53 65 63 53 69 7a  |>>(32-Log2SecSiz|
000011d0  65 25 29 29 0d 0a 50 32  e7 28 44 69 73 63 53 69  |e%))..P2.(DiscSi|
000011e0  7a 65 25 3e 3d 28 35 31  32 2a 31 30 32 34 2a 31  |ze%>=(512*1024*1|
000011f0  30 32 34 29 29 84 28 44  69 73 63 53 69 7a 65 32  |024)).(DiscSize2|
00001200  25 3c 3e 30 29 8c 0d 0a  5a 0e 42 69 67 44 69 73  |%<>0)...Z.BigDis|
00001210  63 25 3d b9 0d 0a 64 05  cc 0d 0a 6e 0e 42 69 67  |c%=...d....n.Big|
00001220  44 69 73 63 25 3d a3 0d  0a 78 05 cd 0d 0a 8c 2a  |Disc%=...x.....*|
00001230  c8 99 22 41 44 46 53 5f  52 65 74 72 69 65 73 22  |.."ADFS_Retries"|
00001240  2c 26 66 66 2c 30 b8 2c  2c 61 64 66 73 5f 72 65  |,&ff,0.,,adfs_re|
00001250  74 72 69 65 73 25 0d 0a  96 06 ea 85 0d 0a a0 35  |tries%.........5|
00001260  ee 85 ea 3a ee 85 87 3a  c8 99 22 41 44 46 53 5f  |...:...:.."ADFS_|
00001270  52 65 74 72 69 65 73 22  2c 26 66 66 2c 61 64 66  |Retries",&ff,adf|
00001280  73 5f 72 65 74 72 69 65  73 25 3a f2 41 73 6d 3a  |s_retries%:.Asm:|
00001290  e1 0d 0a aa 22 ff 28 22  2d 41 44 46 53 2d 25 44  |....".("-ADFS-%D|
000012a0  49 53 4d 4f 55 4e 54 20  3a 22 2b c3 44 72 69 76  |ISMOUNT :"+.Driv|
000012b0  65 25 29 0d 0a b4 07 ee  85 87 0d 0a be 26 c8 99  |e%)..........&..|
000012c0  22 41 44 46 53 5f 52 65  74 72 69 65 73 22 2c 26  |"ADFS_Retries",&|
000012d0  66 66 2c 61 64 66 73 5f  72 65 74 72 69 65 73 25  |ff,adfs_retries%|
000012e0  0d 0a c8 08 f2 41 73 6d  0d 0a d2 05 e1 0d 0a fa  |.....Asm........|
000012f0  0e dd f2 47 65 74 53 68  61 70 65 0d 0b 04 10 46  |...GetShape....F|
00001300  6f 72 6d 61 74 74 65 64  25 3d a3 0d 0b 0e 14 f2  |ormatted%=......|
00001310  49 6e 69 74 42 6f 6f 74  44 65 66 65 63 74 73 0d  |InitBootDefects.|
00001320  0b 18 10 f2 49 6e 69 74  44 69 73 63 52 65 63 0d  |....InitDiscRec.|
00001330  0b 22 2a c8 99 22 41 44  46 53 5f 52 65 74 72 69  |."*.."ADFS_Retri|
00001340  65 73 22 2c 26 66 66 2c  30 b8 2c 2c 61 64 66 73  |es",&ff,0.,,adfs|
00001350  5f 72 65 74 72 69 65 73  25 0d 0b 2c 1b f2 4d 6f  |_retries%..,..Mo|
00001360  61 6e 4f 70 28 52 65 73  74 6f 72 65 25 2c 30 2c  |anOp(Restore%,0,|
00001370  30 2c 30 29 0d 0b 36 27  f2 4f 70 28 52 65 61 64  |0,0)..6'.Op(Read|
00001380  25 2c 42 6f 6f 74 41 64  64 25 2c 42 6f 6f 74 25  |%,BootAdd%,Boot%|
00001390  2c 42 6f 6f 74 53 69 7a  65 25 29 0d 0b 40 26 c8  |,BootSize%)..@&.|
000013a0  99 22 41 44 46 53 5f 52  65 74 72 69 65 73 22 2c  |."ADFS_Retries",|
000013b0  26 66 66 2c 61 64 66 73  5f 72 65 74 72 69 65 73  |&ff,adfs_retries|
000013c0  25 0d 0b 4a 1e e7 52 65  73 75 6c 74 25 3c 3e 30  |%..J..Result%<>0|
000013d0  84 ac a4 47 6f 6f 64 44  65 66 65 63 74 73 8c 0d  |...GoodDefects..|
000013e0  0b 54 25 f2 6d 65 73 73  61 67 65 5f 70 72 69 6e  |.T%.message_prin|
000013f0  74 5f 30 28 22 4e 6f 56  61 6c 69 64 46 6f 72 6d  |t_0("NoValidForm|
00001400  61 74 22 29 0d 0b 5e 05  cc 0d 0b 68 0d f2 4f 6c  |at")..^....h..Ol|
00001410  64 53 68 61 70 65 0d 0b  72 29 f2 4f 70 28 56 65  |dShape..r).Op(Ve|
00001420  72 69 66 79 25 2c 30 2c  30 2c 53 65 63 53 69 7a  |rify%,0,0,SecSiz|
00001430  65 25 2a 53 65 63 73 50  65 72 54 72 6b 25 29 0d  |e%*SecsPerTrk%).|
00001440  0b 7c 1e e7 a4 43 6f 6e  66 69 72 6d 4d 61 6b 65  |.|...ConfirmMake|
00001450  8c 46 6f 72 6d 61 74 74  65 64 25 3d b9 0d 0b 86  |.Formatted%=....|
00001460  05 cd 0d 0b 9a 11 e7 ac  46 6f 72 6d 61 74 74 65  |........Formatte|
00001470  64 25 8c 0d 0b a4 0a e7  49 44 45 25 8c 0d 0b ae  |d%......IDE%....|
00001480  13 e7 ac a4 43 6f 6d 70  61 72 65 4d 61 6b 65 8c  |....CompareMake.|
00001490  0d 0b c2 4c e7 a7 61 75  74 6f 72 65 70 6c 79 24  |...L..autoreply$|
000014a0  2c 22 4e 4f 75 6e 6b 6e  6f 77 6e 22 29 f2 61 62  |,"NOunknown").ab|
000014b0  6f 72 74 28 a4 6d 65 73  73 61 67 65 5f 6c 6f 6f  |ort(.message_loo|
000014c0  6b 75 70 5f 30 28 22 55  6e 6b 6e 6f 77 6e 44 72  |kup_0("UnknownDr|
000014d0  69 76 65 54 79 70 65 22  29 2c 31 29 0d 0b cc 0c  |iveType"),1)....|
000014e0  f2 41 73 6b 4d 61 6b 65  0d 0b d6 05 cd 0d 0b e0  |.AskMake........|
000014f0  05 cc 0d 0b f4 0c f2 41  73 6b 4d 61 6b 65 0d 0b  |.......AskMake..|
00001500  fe 05 cd 0d 0c 08 15 e3  49 25 3d 30 b8 42 6f 6f  |........I%=0.Boo|
00001510  74 53 69 7a 65 25 2d 34  0d 0c 12 0e 42 6f 6f 74  |tSize%-4....Boot|
00001520  25 21 49 25 3d 30 0d 0c  1c 07 ed 49 25 0d 0c 26  |%!I%=0.....I%..&|
00001530  14 f2 49 6e 69 74 42 6f  6f 74 44 65 66 65 63 74  |..InitBootDefect|
00001540  73 0d 0c 30 05 cd 0d 0c  44 32 f2 41 73 6b 53 68  |s..0....D2.AskSh|
00001550  61 70 65 28 28 ac 46 6f  72 6d 61 74 74 65 64 25  |ape((.Formatted%|
00001560  29 80 20 45 6e 67 6c 69  73 68 4d 61 6b 65 24 3d  |). EnglishMake$=|
00001570  22 4f 54 48 45 52 22 29  0d 0c 4e 2d f2 6d 65 73  |"OTHER")..N-.mes|
00001580  73 61 67 65 5f 70 72 69  6e 74 5f 31 28 22 57 69  |sage_print_1("Wi|
00001590  6c 6c 46 6f 72 6d 61 74  22 2c 54 72 61 6e 73 4d  |llFormat",TransM|
000015a0  61 6b 65 24 29 0d 0c 58  15 f2 70 72 69 6e 74 73  |ake$)..X..prints|
000015b0  68 61 70 65 28 49 44 45  25 29 0d 0c 62 05 f1 0d  |hape(IDE%)..b...|
000015c0  0c 6c 05 e1 0d 0c 8a 0e  dd f2 4f 6c 64 53 68 61  |.l........OldSha|
000015d0  70 65 0d 0c 94 1a 53 65  63 73 50 65 72 54 72 6b  |pe....SecsPerTrk|
000015e0  25 3d 42 6f 6f 74 52 65  63 25 3f 31 0d 0c 9e 15  |%=BootRec%?1....|
000015f0  48 65 61 64 73 25 3d 42  6f 6f 74 52 65 63 25 3f  |Heads%=BootRec%?|
00001600  32 0d 0c a8 19 4c 6f 67  32 41 6c 6c 6f 63 25 3d  |2....Log2Alloc%=|
00001610  42 6f 6f 74 52 65 63 25  3f 35 0d 0c b2 1a 44 69  |BootRec%?5....Di|
00001620  73 63 53 69 7a 65 25 3d  42 6f 6f 74 52 65 63 25  |scSize%=BootRec%|
00001630  21 26 31 30 0d 0c bc 1b  44 69 73 63 53 69 7a 65  |!&10....DiscSize|
00001640  32 25 3d 42 6f 6f 74 52  65 63 25 21 26 32 34 0d  |2%=BootRec%!&24.|
00001650  0c d0 32 e7 28 44 69 73  63 53 69 7a 65 25 3e 3d  |..2.(DiscSize%>=|
00001660  28 35 31 32 2a 31 30 32  34 2a 31 30 32 34 29 29  |(512*1024*1024))|
00001670  84 28 44 69 73 63 53 69  7a 65 32 25 3c 3e 30 29  |.(DiscSize2%<>0)|
00001680  8c 0d 0c da 0e 42 69 67  44 69 73 63 25 3d b9 0d  |.....BigDisc%=..|
00001690  0c e4 05 cc 0d 0c ee 0e  42 69 67 44 69 73 63 25  |........BigDisc%|
000016a0  3d a3 0d 0c f8 05 cd 0d  0d 0c 4d 53 65 63 74 6f  |=.........MSecto|
000016b0  72 73 50 65 72 44 69 73  63 25 3d 28 44 69 73 63  |rsPerDisc%=(Disc|
000016c0  53 69 7a 65 25 3e 3e 4c  6f 67 32 53 65 63 53 69  |Size%>>Log2SecSi|
000016d0  7a 65 25 29 2b 28 44 69  73 63 53 69 7a 65 32 25  |ze%)+(DiscSize2%|
000016e0  3c 3c 28 33 32 2d 4c 6f  67 32 53 65 63 53 69 7a  |<<(32-Log2SecSiz|
000016f0  65 25 29 29 0d 0d 20 2e  43 79 6c 73 25 3d 53 65  |e%)).. .Cyls%=Se|
00001700  63 74 6f 72 73 50 65 72  44 69 73 63 25 81 28 53  |ctorsPerDisc%.(S|
00001710  65 63 73 50 65 72 54 72  6b 25 2a 48 65 61 64 73  |ecsPerTrk%*Heads|
00001720  25 29 0d 0d 2a 0a e7 49  44 45 25 8c 0d 0d 34 1b  |%)..*..IDE%...4.|
00001730  49 6e 69 74 46 6c 61 67  25 3d 28 42 6f 6f 74 52  |InitFlag%=(BootR|
00001740  65 63 25 3f 2d 35 29 0d  0d 3e 1a 4c 42 41 66 6c  |ec%?-5)..>.LBAfl|
00001750  61 67 25 3d 28 42 6f 6f  74 52 65 63 25 3f 2d 36  |ag%=(BootRec%?-6|
00001760  29 0d 0d 48 05 cc 0d 0d  52 25 4c 6f 77 43 75 72  |)..H....R%LowCur|
00001770  72 65 6e 74 43 79 6c 25  3d 28 42 6f 6f 74 52 65  |rentCyl%=(BootRe|
00001780  63 25 21 2d 38 29 80 26  33 46 46 0d 0d 5c 22 50  |c%!-8).&3FF..\"P|
00001790  72 65 43 6f 6d 70 43 79  6c 25 3d 28 42 6f 6f 74  |reCompCyl%=(Boot|
000017a0  52 65 63 25 21 2d 36 29  80 26 33 46 46 0d 0d 66  |Rec%!-6).&3FF..f|
000017b0  05 cd 0d 0d 70 0e e7 42  69 67 44 69 73 63 25 8c  |....p..BigDisc%.|
000017c0  0d 0d 7a 2f 50 61 72 6b  43 79 6c 25 3d 28 42 6f  |..z/ParkCyl%=(Bo|
000017d0  6f 74 52 65 63 25 21 2d  34 29 81 28 53 65 63 73  |otRec%!-4).(Secs|
000017e0  50 65 72 54 72 6b 25 2a  48 65 61 64 73 25 29 0d  |PerTrk%*Heads%).|
000017f0  0d 84 05 cc 0d 0d 8e 38  50 61 72 6b 43 79 6c 25  |.......8ParkCyl%|
00001800  3d 28 42 6f 6f 74 52 65  63 25 21 2d 34 29 81 28  |=(BootRec%!-4).(|
00001810  53 65 63 53 69 7a 65 25  2a 53 65 63 73 50 65 72  |SecSize%*SecsPer|
00001820  54 72 6b 25 2a 48 65 61  64 73 25 29 0d 0d 98 05  |Trk%*Heads%)....|
00001830  cd 0d 0d a2 10 f2 49 6e  69 74 44 69 73 63 52 65  |......InitDiscRe|
00001840  63 0d 0d ac 05 e1 0d 0d  ca 0d dd f2 41 73 6b 4d  |c...........AskM|
00001850  61 6b 65 0d 0d d4 18 f2  72 65 73 74 6f 72 65 70  |ake.....restorep|
00001860  61 72 61 6d 73 28 49 44  45 25 29 0d 0d de 0c 4d  |arams(IDE%)....M|
00001870  61 6b 65 73 25 3d 30 0d  0d e8 20 49 25 3d a7 61  |akes%=0... I%=.a|
00001880  75 74 6f 72 65 70 6c 79  24 2c 22 44 72 69 76 65  |utoreply$,"Drive|
00001890  54 79 70 65 3a 22 29 0d  0d f2 0b e7 49 25 3c 3e  |Type:").....I%<>|
000018a0  30 8c 0d 0d fc 17 49 25  2b 3d a9 28 22 44 72 69  |0.....I%+=.("Dri|
000018b0  76 65 54 79 70 65 3a 22  29 0d 0e 06 33 4d 61 6b  |veType:")...3Mak|
000018c0  65 25 3d a0 28 c1 61 75  74 6f 72 65 70 6c 79 24  |e%=.(.autoreply$|
000018d0  2c 49 25 2c a7 61 75 74  6f 72 65 70 6c 79 24 2c  |,I%,.autoreply$,|
000018e0  22 2c 22 2c 49 25 29 2d  49 25 29 29 0d 0e 10 05  |",",I%)-I%))....|
000018f0  cc 0d 0e 1a 25 f2 6d 65  73 73 61 67 65 5f 70 72  |....%.message_pr|
00001900  69 6e 74 5f 30 28 22 44  72 69 76 65 44 69 73 63  |int_0("DriveDisc|
00001910  6c 61 69 6d 22 29 0d 0e  24 05 f5 0d 0e 2e 1c f3  |laim")..$.......|
00001920  45 6e 67 6c 69 73 68 4d  61 6b 65 24 2c 54 6f 6b  |EnglishMake$,Tok|
00001930  65 6e 4d 61 6b 65 24 0d  0e 38 2c 54 72 61 6e 73  |enMake$..8,Trans|
00001940  4d 61 6b 65 24 3d a4 6d  65 73 73 61 67 65 5f 6c  |Make$=.message_l|
00001950  6f 6f 6b 75 70 5f 30 28  54 6f 6b 65 6e 4d 61 6b  |ookup_0(TokenMak|
00001960  65 24 29 0d 0e 42 0d 4d  61 6b 65 73 25 2b 3d 31  |e$)..B.Makes%+=1|
00001970  0d 0e 4c 3b f2 6d 65 73  73 61 67 65 5f 70 72 69  |..L;.message_pri|
00001980  6e 74 5f 32 28 22 4d 61  6b 65 4d 65 6e 75 22 2c  |nt_2("MakeMenu",|
00001990  c2 22 20 22 2b c3 4d 61  6b 65 73 25 2c 32 29 2c  |." "+.Makes%,2),|
000019a0  54 72 61 6e 73 4d 61 6b  65 24 29 0d 0e 56 15 e3  |TransMake$)..V..|
000019b0  49 25 3d 31 b8 4d 61 6b  65 50 61 72 61 6d 73 25  |I%=1.MakeParams%|
000019c0  0d 0e 60 07 f3 41 24 0d  0e 6a 07 ed 49 25 0d 0e  |..`..A$..j..I%..|
000019d0  74 19 fd 45 6e 67 6c 69  73 68 4d 61 6b 65 24 3d  |t..EnglishMake$=|
000019e0  22 4f 54 48 45 52 22 0d  0e 7e 05 f1 0d 0e 88 2f  |"OTHER"..~...../|
000019f0  4d 61 6b 65 25 3d a4 49  6e 70 75 74 44 65 63 28  |Make%=.InputDec(|
00001a00  22 4d 61 6e 75 66 61 63  74 75 72 65 72 44 65 63  |"ManufacturerDec|
00001a10  22 2c 31 2c 4d 61 6b 65  73 25 29 0d 0e 92 18 f2  |",1,Makes%).....|
00001a20  72 65 73 74 6f 72 65 70  61 72 61 6d 73 28 49 44  |restoreparams(ID|
00001a30  45 25 29 0d 0e 9c 05 cd  0d 0e a6 20 49 25 3d 28  |E%)........ I%=(|
00001a40  4d 61 6b 65 25 2d 31 29  2a 28 4d 61 6b 65 50 61  |Make%-1)*(MakePa|
00001a50  72 61 6d 73 25 2b 32 29  0d 0e b0 0a c8 95 49 25  |rams%+2)......I%|
00001a60  3e 30 0d 0e ba 07 f3 41  24 0d 0e c4 09 49 25 2d  |>0.....A$....I%-|
00001a70  3d 31 0d 0e ce 05 ce 0d  0e d8 0a e7 49 44 45 25  |=1..........IDE%|
00001a80  8c 0d 0e e2 58 f3 45 6e  67 6c 69 73 68 4d 61 6b  |....X.EnglishMak|
00001a90  65 24 2c 54 6f 6b 65 6e  4d 61 6b 65 24 2c 53 65  |e$,TokenMake$,Se|
00001aa0  63 73 50 65 72 54 72 6b  25 2c 48 65 61 64 73 25  |csPerTrk%,Heads%|
00001ab0  2c 43 79 6c 73 25 2c 49  6e 69 74 46 6c 61 67 25  |,Cyls%,InitFlag%|
00001ac0  2c 44 75 6d 6d 79 25 2c  50 61 72 6b 43 79 6c 25  |,Dummy%,ParkCyl%|
00001ad0  2c 4c 42 41 66 6c 61 67  25 0d 0e ec 05 cc 0d 0e  |,LBAflag%.......|
00001ae0  f6 59 f3 45 6e 67 6c 69  73 68 4d 61 6b 65 24 2c  |.Y.EnglishMake$,|
00001af0  54 6f 6b 65 6e 4d 61 6b  65 24 2c 53 65 63 73 50  |TokenMake$,SecsP|
00001b00  65 72 54 72 6b 25 2c 48  65 61 64 73 25 2c 43 79  |erTrk%,Heads%,Cy|
00001b10  6c 73 25 2c 4c 6f 77 43  75 72 72 65 6e 74 43 79  |ls%,LowCurrentCy|
00001b20  6c 25 2c 50 72 65 43 6f  6d 70 43 79 6c 25 2c 50  |l%,PreCompCyl%,P|
00001b30  61 72 6b 43 79 6c 25 0d  0f 00 05 cd 0d 0f 0a 2c  |arkCyl%........,|
00001b40  54 72 61 6e 73 4d 61 6b  65 24 3d a4 6d 65 73 73  |TransMake$=.mess|
00001b50  61 67 65 5f 6c 6f 6f 6b  75 70 5f 30 28 54 6f 6b  |age_lookup_0(Tok|
00001b60  65 6e 4d 61 6b 65 24 29  0d 0f 1e 0a e7 49 44 45  |enMake$).....IDE|
00001b70  25 8c 0d 0f 28 2a e7 28  45 6e 67 6c 69 73 68 4d  |%...(*.(EnglishM|
00001b80  61 6b 65 24 3d 22 4f 54  48 45 52 22 29 80 28 49  |ake$="OTHER").(I|
00001b90  44 45 63 79 6c 73 25 3c  3e 30 29 8c 0d 0f 32 18  |DEcyls%<>0)...2.|
00001ba0  53 65 63 73 50 65 72 54  72 6b 25 3d 49 44 45 73  |SecsPerTrk%=IDEs|
00001bb0  65 63 73 25 0d 0f 3c 14  48 65 61 64 73 25 3d 49  |ecs%..<.Heads%=I|
00001bc0  44 45 68 65 61 64 73 25  0d 0f 46 12 43 79 6c 73  |DEheads%..F.Cyls|
00001bd0  25 3d 49 44 45 63 79 6c  73 25 0d 0f 50 0f 49 6e  |%=IDEcyls%..P.In|
00001be0  69 74 46 6c 61 67 25 3d  31 0d 0f 5a 0e 4c 42 41  |itFlag%=1..Z.LBA|
00001bf0  46 6c 61 67 25 3d 31 0d  0f 64 1e e7 a7 61 75 74  |Flag%=1..d...aut|
00001c00  6f 72 65 70 6c 79 24 2c  22 4c 42 41 3a 4f 6e 22  |oreply$,"LBA:On"|
00001c10  29 3c 3e 30 8c 0d 0f 6e  0e 4c 42 41 46 6c 61 67  |)<>0...n.LBAFlag|
00001c20  25 3d 31 0d 0f 78 05 cc  0d 0f 82 1f e7 a7 61 75  |%=1..x........au|
00001c30  74 6f 72 65 70 6c 79 24  2c 22 4c 42 41 3a 4f 66  |toreply$,"LBA:Of|
00001c40  66 22 29 3c 3e 30 8c 0d  0f 8c 0e 4c 42 41 46 6c  |f")<>0.....LBAFl|
00001c50  61 67 25 3d 30 0d 0f 96  05 cd 0d 0f a0 05 cd 0d  |ag%=0...........|
00001c60  0f aa 17 50 61 72 6b 43  79 6c 25 3d 49 44 45 63  |...ParkCyl%=IDEc|
00001c70  79 6c 73 25 2d 31 0d 0f  b4 05 cd 0d 0f be 05 cd  |yls%-1..........|
00001c80  0d 0f c8 05 e1 0d 0f e6  11 dd a4 43 6f 6e 66 69  |...........Confi|
00001c90  72 6d 4d 61 6b 65 0d 0f  f0 0d ea 6d 61 74 63 68  |rmMake.....match|
00001ca0  65 64 25 0d 0f fa 18 f2  72 65 73 74 6f 72 65 70  |ed%.....restorep|
00001cb0  61 72 61 6d 73 28 49 44  45 25 29 0d 10 04 05 f5  |arams(IDE%).....|
00001cc0  0d 10 0e 38 f3 45 6e 67  6c 69 73 68 4d 61 6b 65  |...8.EnglishMake|
00001cd0  24 2c 54 6f 6b 65 6e 4d  61 6b 65 24 2c 50 31 25  |$,TokenMake$,P1%|
00001ce0  2c 50 32 25 2c 50 33 25  2c 50 34 25 2c 50 35 25  |,P2%,P3%,P4%,P5%|
00001cf0  2c 50 36 25 2c 50 37 25  0d 10 18 2c 54 72 61 6e  |,P6%,P7%...,Tran|
00001d00  73 4d 61 6b 65 24 3d a4  6d 65 73 73 61 67 65 5f  |sMake$=.message_|
00001d10  6c 6f 6f 6b 75 70 5f 30  28 54 6f 6b 65 6e 4d 61  |lookup_0(TokenMa|
00001d20  6b 65 24 29 0d 10 22 1a  e7 45 6e 67 6c 69 73 68  |ke$).."..English|
00001d30  4d 61 6b 65 24 3d 22 4f  54 48 45 52 22 8c 0d 10  |Make$="OTHER"...|
00001d40  2c 28 f2 6d 65 73 73 61  67 65 5f 70 72 69 6e 74  |,(.message_print|
00001d50  5f 30 28 22 4e 6f 6e 53  74 61 6e 64 61 72 64 53  |_0("NonStandardS|
00001d60  68 61 70 65 22 29 0d 10  36 15 f2 70 72 69 6e 74  |hape")..6..print|
00001d70  73 68 61 70 65 28 49 44  45 25 29 0d 10 40 05 f1  |shape(IDE%)..@..|
00001d80  0d 10 4a 34 3d a4 43 68  6f 6f 73 65 28 22 51 30  |..J4=.Choose("Q0|
00001d90  34 3a 22 2c 22 52 65 74  61 69 6e 53 68 61 70 65  |4:","RetainShape|
00001da0  43 68 6f 6f 73 65 22 2c  22 59 4e 22 2c 22 22 29  |Choose","YN","")|
00001db0  3d 22 59 22 0d 10 54 05  cd 0d 10 5e 0e 6d 61 74  |="Y"..T....^.mat|
00001dc0  63 68 65 64 25 3d b9 0d  10 68 0a e7 49 44 45 25  |ched%=...h..IDE%|
00001dd0  8c 0d 10 72 63 e7 50 31  25 3c 3e 53 65 63 73 50  |...rc.P1%<>SecsP|
00001de0  65 72 54 72 6b 25 84 50  32 25 3c 3e 48 65 61 64  |erTrk%.P2%<>Head|
00001df0  73 25 84 50 33 25 3c 3e  43 79 6c 73 25 84 50 34  |s%.P3%<>Cyls%.P4|
00001e00  25 3c 3e 49 6e 69 74 46  6c 61 67 25 84 50 36 25  |%<>InitFlag%.P6%|
00001e10  3c 3e 50 61 72 6b 43 79  6c 25 84 50 37 25 3c 3e  |<>ParkCyl%.P7%<>|
00001e20  4c 42 41 66 6c 61 67 25  cd 3a 6d 61 74 63 68 65  |LBAflag%.:matche|
00001e30  64 25 3d a3 0d 10 7c 05  cc 0d 10 86 6b e7 50 31  |d%=...|.....k.P1|
00001e40  25 3c 3e 53 65 63 73 50  65 72 54 72 6b 25 84 50  |%<>SecsPerTrk%.P|
00001e50  32 25 3c 3e 48 65 61 64  73 25 84 50 33 25 3c 3e  |2%<>Heads%.P3%<>|
00001e60  43 79 6c 73 25 84 50 34  25 3c 3e 4c 6f 77 43 75  |Cyls%.P4%<>LowCu|
00001e70  72 72 65 6e 74 43 79 6c  25 84 50 35 25 3c 3e 50  |rrentCyl%.P5%<>P|
00001e80  72 65 43 6f 6d 70 43 79  6c 25 84 50 36 25 3c 3e  |reCompCyl%.P6%<>|
00001e90  50 61 72 6b 43 79 6c 25  cd 3a 6d 61 74 63 68 65  |ParkCyl%.:matche|
00001ea0  64 25 3d a3 0d 10 90 05  cd 0d 10 9a 0d fd 6d 61  |d%=...........ma|
00001eb0  74 63 68 65 64 25 0d 10  ae 30 f2 6d 65 73 73 61  |tched%...0.messa|
00001ec0  67 65 5f 70 72 69 6e 74  5f 31 28 22 53 74 61 6e  |ge_print_1("Stan|
00001ed0  64 61 72 64 53 68 61 70  65 22 2c 54 72 61 6e 73  |dardShape",Trans|
00001ee0  4d 61 6b 65 24 29 0d 10  b8 15 f2 70 72 69 6e 74  |Make$).....print|
00001ef0  73 68 61 70 65 28 49 44  45 25 29 0d 10 c2 05 f1  |shape(IDE%).....|
00001f00  0d 10 cc 31 3d a4 43 68  6f 6f 73 65 28 22 51 30  |...1=.Choose("Q0|
00001f10  35 3a 22 2c 22 55 73 65  53 68 61 70 65 43 68 6f  |5:","UseShapeCho|
00001f20  6f 73 65 22 2c 22 59 4e  22 2c 22 22 29 3d 22 59  |ose","YN","")="Y|
00001f30  22 0d 10 ea 18 dd f2 70  72 69 6e 74 73 68 61 70  |"......printshap|
00001f40  65 28 69 74 79 70 65 25  29 0d 10 f4 44 f2 6d 65  |e(itype%)...D.me|
00001f50  73 73 61 67 65 5f 70 72  69 6e 74 5f 33 28 22 50  |ssage_print_3("P|
00001f60  72 69 6e 74 53 68 61 70  65 22 2c c3 28 43 79 6c  |rintShape",.(Cyl|
00001f70  73 25 29 2c c3 28 48 65  61 64 73 25 29 2c c3 28  |s%),.(Heads%),.(|
00001f80  53 65 63 73 50 65 72 54  72 6b 25 29 29 0d 10 fe  |SecsPerTrk%))...|
00001f90  0c e7 69 74 79 70 65 25  8c 0d 11 08 4b f2 6d 65  |..itype%....K.me|
00001fa0  73 73 61 67 65 5f 70 72  69 6e 74 5f 33 28 22 50  |ssage_print_3("P|
00001fb0  72 69 6e 74 53 68 61 70  65 33 49 44 45 22 2c c3  |rintShape3IDE",.|
00001fc0  28 50 61 72 6b 43 79 6c  25 29 2c c3 28 49 6e 69  |(ParkCyl%),.(Ini|
00001fd0  74 46 6c 61 67 25 29 2c  c3 28 4c 42 41 66 6c 61  |tFlag%),.(LBAfla|
00001fe0  67 25 29 29 0d 11 12 05  cc 0d 11 1c 55 f2 6d 65  |g%))........U.me|
00001ff0  73 73 61 67 65 5f 70 72  69 6e 74 5f 33 28 22 50  |ssage_print_3("P|
00002000  72 69 6e 74 53 68 61 70  65 32 53 54 35 30 36 22  |rintShape2ST506"|
00002010  2c c3 28 50 61 72 6b 43  79 6c 25 29 2c c3 28 4c  |,.(ParkCyl%),.(L|
00002020  6f 77 43 75 72 72 65 6e  74 43 79 6c 25 29 2c c3  |owCurrentCyl%),.|
00002030  28 50 72 65 43 6f 6d 70  43 79 6c 25 29 29 0d 11  |(PreCompCyl%))..|
00002040  26 05 cd 0d 11 30 05 e1  0d 11 58 11 dd a4 43 6f  |&....0....X...Co|
00002050  6d 70 61 72 65 4d 61 6b  65 0d 11 62 10 f2 72 65  |mpareMake..b..re|
00002060  73 74 6f 72 65 50 52 4f  44 0d 11 6c 05 f5 0d 11  |storePROD..l....|
00002070  76 58 f3 45 6e 67 6c 69  73 68 4d 61 6b 65 24 2c  |vX.EnglishMake$,|
00002080  54 6f 6b 65 6e 4d 61 6b  65 24 2c 53 65 63 73 50  |TokenMake$,SecsP|
00002090  65 72 54 72 6b 25 2c 48  65 61 64 73 25 2c 43 79  |erTrk%,Heads%,Cy|
000020a0  6c 73 25 2c 49 6e 69 74  46 6c 61 67 25 2c 44 75  |ls%,InitFlag%,Du|
000020b0  6d 6d 79 25 2c 50 61 72  6b 43 79 6c 25 2c 4c 42  |mmy%,ParkCyl%,LB|
000020c0  41 66 6c 61 67 25 0d 11  80 2c 54 72 61 6e 73 4d  |Aflag%...,TransM|
000020d0  61 6b 65 24 3d a4 6d 65  73 73 61 67 65 5f 6c 6f  |ake$=.message_lo|
000020e0  6f 6b 75 70 5f 30 28 54  6f 6b 65 6e 4d 61 6b 65  |okup_0(TokenMake|
000020f0  24 29 0d 11 8a 1a e7 45  6e 67 6c 69 73 68 4d 61  |$).....EnglishMa|
00002100  6b 65 24 3d 22 4f 54 48  45 52 22 8c 0d 11 94 28  |ke$="OTHER"....(|
00002110  f2 6d 65 73 73 61 67 65  5f 70 72 69 6e 74 5f 30  |.message_print_0|
00002120  28 22 55 6e 6b 6e 6f 77  6e 44 72 69 76 65 4d 61  |("UnknownDriveMa|
00002130  6b 65 22 29 0d 11 9e 06  3d a3 0d 11 a8 05 cd 0d  |ke")....=.......|
00002140  11 b2 29 fd a4 6d 61 74  63 68 73 74 72 69 6e 67  |..)..matchstring|
00002150  73 28 45 6e 67 6c 69 73  68 4d 61 6b 65 24 2c 49  |s(EnglishMake$,I|
00002160  44 45 6e 61 6d 65 24 29  0d 11 bc 36 3d a4 43 68  |DEname$)...6=.Ch|
00002170  6f 6f 73 65 28 22 51 30  36 3a 22 2c 22 53 74 61  |oose("Q06:","Sta|
00002180  6e 64 61 72 64 53 68 61  70 65 43 68 6f 6f 73 65  |ndardShapeChoose|
00002190  22 2c 22 59 4e 22 2c 22  22 29 3d 22 59 22 0d 11  |","YN","")="Y"..|
000021a0  e4 19 dd f2 41 73 6b 53  68 61 70 65 28 74 61 69  |....AskShape(tai|
000021b0  6c 6f 72 65 64 25 29 0d  11 f8 25 e7 49 44 45 25  |lored%)...%.IDE%|
000021c0  84 28 a7 61 75 74 6f 72  65 70 6c 79 24 2c 22 4e  |.(.autoreply$,"N|
000021d0  65 77 4d 61 70 22 29 3c  3e 30 29 8c 0d 12 02 0d  |ewMap")<>0).....|
000021e0  4e 65 77 4d 61 70 25 3d  b9 0d 12 0c 05 cc 0d 12  |NewMap%=........|
000021f0  16 44 4e 65 77 4d 61 70  25 3d 28 a4 43 68 6f 6f  |.DNewMap%=(.Choo|
00002200  73 65 28 22 4f 6c 64 4f  72 4e 65 77 4d 61 70 3a  |se("OldOrNewMap:|
00002210  22 2c 22 4f 6c 64 4e 65  77 4d 61 70 43 68 6f 6f  |","OldNewMapChoo|
00002220  73 65 22 2c 22 4f 4e 22  2c 22 4e 22 29 3d 22 4e  |se","ON","N")="N|
00002230  22 29 0d 12 20 05 cd 0d  12 34 0f e7 74 61 69 6c  |").. ....4..tail|
00002240  6f 72 65 64 25 8c 0d 12  3e 30 53 65 63 73 50 65  |ored%...>0SecsPe|
00002250  72 54 72 6b 25 3d a4 41  73 6b 28 22 53 65 63 74  |rTrk%=.Ask("Sect|
00002260  6f 72 73 41 73 6b 22 2c  53 65 63 73 50 65 72 54  |orsAsk",SecsPerT|
00002270  72 6b 25 2c 31 29 0d 12  48 0a e7 49 44 45 25 8c  |rk%,1)..H..IDE%.|
00002280  0d 12 52 05 f5 0d 12 5c  27 48 65 61 64 73 25 3d  |..R....\'Heads%=|
00002290  a4 41 73 6b 28 22 49 44  45 48 65 61 64 73 41 73  |.Ask("IDEHeadsAs|
000022a0  6b 22 2c 48 65 61 64 73  25 2c 31 29 0d 12 66 2c  |k",Heads%,1)..f,|
000022b0  e7 48 65 61 64 73 25 3e  31 36 f2 6d 65 73 73 61  |.Heads%>16.messa|
000022c0  67 65 5f 70 72 69 6e 74  5f 30 28 22 49 44 45 48  |ge_print_0("IDEH|
000022d0  65 61 64 73 31 36 22 29  0d 12 70 0f fd 48 65 61  |eads16")..p..Hea|
000022e0  64 73 25 3c 3d 31 36 0d  12 7a 05 cc 0d 12 84 29  |ds%<=16..z.....)|
000022f0  48 65 61 64 73 25 3d a4  41 73 6b 28 22 53 54 35  |Heads%=.Ask("ST5|
00002300  30 36 48 65 61 64 73 41  73 6b 22 2c 48 65 61 64  |06HeadsAsk",Head|
00002310  73 25 2c 31 29 0d 12 8e  2c e7 48 65 61 64 73 25  |s%,1)...,.Heads%|
00002320  3e 38 f2 6d 65 73 73 61  67 65 5f 70 72 69 6e 74  |>8.message_print|
00002330  5f 30 28 22 53 54 35 30  36 48 65 61 64 73 38 22  |_0("ST506Heads8"|
00002340  29 0d 12 98 05 cd 0d 12  a2 26 43 79 6c 73 25 3d  |)........&Cyls%=|
00002350  a4 41 73 6b 28 22 43 79  6c 69 6e 64 65 72 73 41  |.Ask("CylindersA|
00002360  73 6b 22 2c 43 79 6c 73  25 2c 31 29 0d 12 b6 0a  |sk",Cyls%,1)....|
00002370  e7 49 44 45 25 8c 0d 12  c0 29 49 6e 69 74 46 6c  |.IDE%....)InitFl|
00002380  61 67 25 3d a4 41 73 6b  28 22 49 6e 69 74 41 73  |ag%=.Ask("InitAs|
00002390  6b 22 2c 49 6e 69 74 46  6c 61 67 25 2c 30 29 0d  |k",InitFlag%,0).|
000023a0  12 ca 10 e7 49 44 45 48  61 73 4c 42 41 25 8c 0d  |....IDEHasLBA%..|
000023b0  12 d4 0e 4c 42 41 46 6c  61 67 25 3d 31 0d 12 de  |...LBAFlag%=1...|
000023c0  1e e7 a7 61 75 74 6f 72  65 70 6c 79 24 2c 22 4c  |...autoreply$,"L|
000023d0  42 41 3a 4f 6e 22 29 3c  3e 30 8c 0d 12 e8 0e 4c  |BA:On")<>0.....L|
000023e0  42 41 46 6c 61 67 25 3d  31 0d 12 f2 05 cc 0d 12  |BAFlag%=1.......|
000023f0  fc 1f e7 a7 61 75 74 6f  72 65 70 6c 79 24 2c 22  |....autoreply$,"|
00002400  4c 42 41 3a 4f 66 66 22  29 3c 3e 30 8c 0d 13 06  |LBA:Off")<>0....|
00002410  0e 4c 42 41 46 6c 61 67  25 3d 30 0d 13 10 05 cc  |.LBAFlag%=0.....|
00002420  0d 13 1a 26 4c 42 41 66  6c 61 67 25 3d a4 41 73  |...&LBAflag%=.As|
00002430  6b 28 22 4c 42 41 41 73  6b 22 2c 4c 42 41 66 6c  |k("LBAAsk",LBAfl|
00002440  61 67 25 2c 31 29 0d 13  24 05 cd 0d 13 2e 05 cd  |ag%,1)..$.......|
00002450  0d 13 38 05 cc 0d 13 42  0e 4c 42 41 66 6c 61 67  |..8....B.LBAflag|
00002460  25 3d 30 0d 13 4c 05 cd  0d 13 56 05 cc 0d 13 60  |%=0..L....V....`|
00002470  3a 4c 6f 77 43 75 72 72  65 6e 74 43 79 6c 25 3d  |:LowCurrentCyl%=|
00002480  a4 41 73 6b 28 22 4c 6f  77 43 79 6c 69 6e 64 65  |.Ask("LowCylinde|
00002490  72 41 73 6b 22 2c 4c 6f  77 43 75 72 72 65 6e 74  |rAsk",LowCurrent|
000024a0  43 79 6c 25 2c 30 29 0d  13 6a 38 50 72 65 43 6f  |Cyl%,0)..j8PreCo|
000024b0  6d 70 43 79 6c 25 3d a4  41 73 6b 28 22 50 72 65  |mpCyl%=.Ask("Pre|
000024c0  63 6f 6d 70 43 79 6c 69  6e 64 65 72 41 73 6b 22  |compCylinderAsk"|
000024d0  2c 50 72 65 43 6f 6d 70  43 79 6c 25 2c 30 29 0d  |,PreCompCyl%,0).|
000024e0  13 74 05 cd 0d 13 7e 2f  50 61 72 6b 43 79 6c 25  |.t....~/ParkCyl%|
000024f0  3d a4 41 73 6b 28 22 50  61 72 6b 43 79 6c 69 6e  |=.Ask("ParkCylin|
00002500  64 65 72 41 73 6b 22 2c  50 61 72 6b 43 79 6c 25  |derAsk",ParkCyl%|
00002510  2c 30 29 0d 13 88 05 cd  0d 13 9c 1a 44 69 73 63  |,0).........Disc|
00002520  52 65 63 25 3f 31 3d 53  65 63 73 50 65 72 54 72  |Rec%?1=SecsPerTr|
00002530  6b 25 0d 13 a6 15 44 69  73 63 52 65 63 25 3f 32  |k%....DiscRec%?2|
00002540  3d 48 65 61 64 73 25 0d  13 c4 2c 53 65 63 74 6f  |=Heads%...,Secto|
00002550  72 73 50 65 72 44 69 73  63 25 3d 53 65 63 73 50  |rsPerDisc%=SecsP|
00002560  65 72 54 72 6b 25 2a 48  65 61 64 73 25 2a 43 79  |erTrk%*Heads%*Cy|
00002570  6c 73 25 0d 13 ce 10 e7  49 44 45 48 61 73 4c 42  |ls%.....IDEHasLB|
00002580  41 25 8c 0d 13 d8 46 e7  53 65 63 74 6f 72 73 50  |A%....F.SectorsP|
00002590  65 72 44 69 73 63 25 3e  49 44 45 41 64 64 72 65  |erDisc%>IDEAddre|
000025a0  73 73 53 70 61 63 65 25  8c 53 65 63 74 6f 72 73  |ssSpace%.Sectors|
000025b0  50 65 72 44 69 73 63 25  3d 49 44 45 41 64 64 72  |PerDisc%=IDEAddr|
000025c0  65 73 73 53 70 61 63 65  25 0d 13 e2 05 cc 0d 13  |essSpace%.......|
000025d0  ec 3e e7 53 65 63 74 6f  72 73 50 65 72 44 69 73  |.>.SectorsPerDis|
000025e0  63 25 3e 49 44 45 43 61  70 61 63 69 74 79 25 8c  |c%>IDECapacity%.|
000025f0  53 65 63 74 6f 72 73 50  65 72 44 69 73 63 25 3d  |SectorsPerDisc%=|
00002600  49 44 45 43 61 70 61 63  69 74 79 25 0d 13 f6 05  |IDECapacity%....|
00002610  cd 0d 14 0a 48 44 69 73  63 53 69 7a 65 25 3d 28  |....HDiscSize%=(|
00002620  53 65 63 74 6f 72 73 50  65 72 44 69 73 63 25 80  |SectorsPerDisc%.|
00002630  28 28 31 3c 3c 28 33 32  2d 4c 6f 67 32 53 65 63  |((1<<(32-Log2Sec|
00002640  53 69 7a 65 25 29 29 2d  31 29 29 3c 3c 4c 6f 67  |Size%))-1))<<Log|
00002650  32 53 65 63 53 69 7a 65  25 0d 14 14 33 44 69 73  |2SecSize%...3Dis|
00002660  63 53 69 7a 65 32 25 3d  28 53 65 63 74 6f 72 73  |cSize2%=(Sectors|
00002670  50 65 72 44 69 73 63 25  3e 3e 28 33 32 2d 4c 6f  |PerDisc%>>(32-Lo|
00002680  67 32 53 65 63 53 69 7a  65 25 29 29 0d 14 28 32  |g2SecSize%))..(2|
00002690  e7 28 44 69 73 63 53 69  7a 65 25 3e 3d 28 35 31  |.(DiscSize%>=(51|
000026a0  32 2a 31 30 32 34 2a 31  30 32 34 29 29 84 28 44  |2*1024*1024)).(D|
000026b0  69 73 63 53 69 7a 65 32  25 3c 3e 30 29 8c 0d 14  |iscSize2%<>0)...|
000026c0  32 0e 42 69 67 44 69 73  63 25 3d b9 0d 14 3c 05  |2.BigDisc%=...<.|
000026d0  cc 0d 14 46 0e 42 69 67  44 69 73 63 25 3d a3 0d  |...F.BigDisc%=..|
000026e0  14 50 05 cd 0d 14 64 1a  44 69 73 63 52 65 63 25  |.P....d.DiscRec%|
000026f0  21 26 31 30 3d 44 69 73  63 53 69 7a 65 25 0d 14  |!&10=DiscSize%..|
00002700  6e 1b 44 69 73 63 52 65  63 25 21 26 32 34 3d 44  |n.DiscRec%!&24=D|
00002710  69 73 63 53 69 7a 65 32  25 0d 14 78 1f 44 69 73  |iscSize2%..x.Dis|
00002720  63 52 65 63 25 3f 26 32  38 3d 4c 6f 67 32 53 68  |cRec%?&28=Log2Sh|
00002730  61 72 65 53 69 7a 65 25  0d 14 96 30 e7 28 28 44  |areSize%...0.((D|
00002740  69 73 63 53 69 7a 65 25  80 26 45 30 30 30 30 30  |iscSize%.&E00000|
00002750  30 30 29 3c 3e 30 84 28  44 69 73 63 53 69 7a 65  |00)<>0.(DiscSize|
00002760  32 25 3c 3e 30 29 29 8c  0d 14 a0 12 44 69 73 63  |2%<>0)).....Disc|
00002770  52 65 63 25 3f 26 32 39  3d 31 0d 14 aa 05 cc 0d  |Rec%?&29=1......|
00002780  14 b4 12 44 69 73 63 52  65 63 25 3f 26 32 39 3d  |...DiscRec%?&29=|
00002790  30 0d 14 be 05 cd 0d 14  d2 17 e3 49 25 3d 30 b8  |0..........I%=0.|
000027a0  42 6f 6f 74 53 69 7a 65  25 2d 34 88 34 0d 14 dc  |BootSize%-4.4...|
000027b0  17 44 65 66 65 63 74 25  21 49 25 3d 42 6f 6f 74  |.Defect%!I%=Boot|
000027c0  25 21 49 25 0d 14 e6 07  ed 49 25 0d 14 f0 16 42  |%!I%.....I%....B|
000027d0  6f 6f 74 25 21 30 3d 45  6e 64 44 65 66 65 63 74  |oot%!0=EndDefect|
000027e0  25 0d 14 fa 05 f5 0d 15  04 0a 70 74 72 25 3d 30  |%.........ptr%=0|
000027f0  0d 15 0e 11 64 65 66 65  63 74 6c 69 73 74 25 3d  |....defectlist%=|
00002800  30 0d 15 18 0e e7 42 69  67 44 69 73 63 25 8c 0d  |0.....BigDisc%..|
00002810  15 22 1e e7 44 65 66 65  63 74 25 21 70 74 72 25  |."..Defect%!ptr%|
00002820  3e 3d 45 6e 64 44 65 66  65 63 74 25 8c 0d 15 2c  |>=EndDefect%...,|
00002830  43 e7 44 65 66 65 63 74  25 21 28 70 74 72 25 2b  |C.Defect%!(ptr%+|
00002840  34 29 3c 45 6e 64 44 65  66 65 63 74 32 25 f2 6d  |4)<EndDefect2%.m|
00002850  65 73 73 61 67 65 5f 70  72 69 6e 74 5f 30 28 22  |essage_print_0("|
00002860  43 75 72 72 65 6e 74 44  65 66 65 63 74 73 22 29  |CurrentDefects")|
00002870  0d 15 36 05 cc 0d 15 40  26 f2 6d 65 73 73 61 67  |..6....@&.messag|
00002880  65 5f 70 72 69 6e 74 5f  30 28 22 43 75 72 72 65  |e_print_0("Curre|
00002890  6e 74 44 65 66 65 63 74  73 22 29 0d 15 4a 05 cd  |ntDefects")..J..|
000028a0  0d 15 54 05 cc 0d 15 5e  40 e7 44 65 66 65 63 74  |..T....^@.Defect|
000028b0  25 21 28 70 74 72 25 29  3c 45 6e 64 44 65 66 65  |%!(ptr%)<EndDefe|
000028c0  63 74 25 f2 6d 65 73 73  61 67 65 5f 70 72 69 6e  |ct%.message_prin|
000028d0  74 5f 30 28 22 43 75 72  72 65 6e 74 44 65 66 65  |t_0("CurrentDefe|
000028e0  63 74 73 22 29 0d 15 68  05 cd 0d 15 72 50 c8 95  |cts")..h....rP..|
000028f0  28 28 44 65 66 65 63 74  25 21 70 74 72 25 3c 45  |((Defect%!ptr%<E|
00002900  6e 64 44 65 66 65 63 74  25 29 80 ac 42 69 67 44  |ndDefect%)..BigD|
00002910  69 73 63 25 29 84 28 44  65 66 65 63 74 25 21 70  |isc%).(Defect%!p|
00002920  74 72 25 3c 45 6e 64 44  65 66 65 63 74 32 25 80  |tr%<EndDefect2%.|
00002930  20 42 69 67 44 69 73 63  25 29 0d 15 7c 2b e7 28  | BigDisc%)..|+.(|
00002940  28 44 65 66 65 63 74 25  21 70 74 72 25 80 26 45  |(Defect%!ptr%.&E|
00002950  30 30 30 30 30 30 30 29  3d 45 6e 64 44 65 66 65  |0000000)=EndDefe|
00002960  63 74 25 29 8c 0d 15 86  0b 70 74 72 25 2b 3d 34  |ct%).....ptr%+=4|
00002970  0d 15 90 11 64 65 66 65  63 74 6c 69 73 74 25 3d  |....defectlist%=|
00002980  31 0d 15 9a 05 cc 0d 15  a4 13 e7 64 65 66 65 63  |1..........defec|
00002990  74 6c 69 73 74 25 3d 30  8c 0d 15 ae 18 64 65 66  |tlist%=0.....def|
000029a0  65 63 74 25 3d 44 65 66  65 63 74 25 21 70 74 72  |ect%=Defect%!ptr|
000029b0  25 0d 15 b8 1c 64 65 66  65 63 74 25 3d 64 65 66  |%....defect%=def|
000029c0  65 63 74 25 81 53 65 63  53 69 7a 65 25 0d 15 c2  |ect%.SecSize%...|
000029d0  2c 73 65 63 74 6f 72 25  3d 28 64 65 66 65 63 74  |,sector%=(defect|
000029e0  25 83 53 65 63 73 50 65  72 54 72 6b 25 29 2b 4c  |%.SecsPerTrk%)+L|
000029f0  6f 77 53 65 63 74 6f 72  25 0d 15 cc 1f 64 65 66  |owSector%....def|
00002a00  65 63 74 25 3d 64 65 66  65 63 74 25 81 53 65 63  |ect%=defect%.Sec|
00002a10  73 50 65 72 54 72 6b 25  0d 15 d6 4d f1 8a 28 28  |sPerTrk%...M..((|
00002a20  70 74 72 25 81 34 29 83  36 29 2a 31 33 29 3b 22  |ptr%.4).6)*13);"|
00002a30  28 22 3b 64 65 66 65 63  74 25 81 48 65 61 64 73  |(";defect%.Heads|
00002a40  25 3b 22 2c 22 3b 64 65  66 65 63 74 25 83 48 65  |%;",";defect%.He|
00002a50  61 64 73 25 3b 22 2c 22  3b 73 65 63 74 6f 72 25  |ads%;",";sector%|
00002a60  3b 22 29 22 3b 0d 15 e0  0f 70 74 72 25 3d 70 74  |;")";....ptr%=pt|
00002a70  72 25 2b 34 0d 15 ea 05  cc 0d 15 f4 18 64 65 66  |r%+4.........def|
00002a80  65 63 74 25 3d 44 65 66  65 63 74 25 21 70 74 72  |ect%=Defect%!ptr|
00002a90  25 0d 15 fe 2c 73 65 63  74 6f 72 25 3d 28 64 65  |%...,sector%=(de|
00002aa0  66 65 63 74 25 83 53 65  63 73 50 65 72 54 72 6b  |fect%.SecsPerTrk|
00002ab0  25 29 2b 4c 6f 77 53 65  63 74 6f 72 25 0d 16 08  |%)+LowSector%...|
00002ac0  1f 64 65 66 65 63 74 25  3d 64 65 66 65 63 74 25  |.defect%=defect%|
00002ad0  81 53 65 63 73 50 65 72  54 72 6b 25 0d 16 12 51  |.SecsPerTrk%...Q|
00002ae0  f1 8a 28 28 28 70 74 72  25 2d 34 29 81 34 29 83  |..(((ptr%-4).4).|
00002af0  36 29 2a 31 33 29 3b 22  28 22 3b 64 65 66 65 63  |6)*13);"(";defec|
00002b00  74 25 81 48 65 61 64 73  25 3b 22 2c 22 3b 64 65  |t%.Heads%;",";de|
00002b10  66 65 63 74 25 83 48 65  61 64 73 25 3b 22 2c 22  |fect%.Heads%;","|
00002b20  3b 73 65 63 74 6f 72 25  3b 22 29 22 3b 0d 16 1c  |;sector%;")";...|
00002b30  0f 70 74 72 25 3d 70 74  72 25 2b 34 0d 16 26 05  |.ptr%=ptr%+4..&.|
00002b40  cd 0d 16 30 05 cd 0d 16  3a 05 ce 0d 16 44 0e e7  |...0....:....D..|
00002b50  42 69 67 44 69 73 63 25  8c 0d 16 4e 17 44 65 66  |BigDisc%...N.Def|
00002b60  65 63 74 73 25 3d 28 70  74 72 25 81 34 29 2d 31  |ects%=(ptr%.4)-1|
00002b70  0d 16 58 05 cc 0d 16 62  13 44 65 66 65 63 74 73  |..X....b.Defects|
00002b80  25 3d 70 74 72 25 81 34  0d 16 6c 05 cd 0d 16 76  |%=ptr%.4..l....v|
00002b90  23 e7 a7 61 75 74 6f 72  65 70 6c 79 24 2c 22 4e  |#..autoreply$,"N|
00002ba0  4f 61 64 64 64 65 66 65  63 74 73 22 29 3d 30 8c  |Oadddefects")=0.|
00002bb0  0d 16 80 07 f1 3a f1 0d  16 8a 24 f2 6d 65 73 73  |.....:....$.mess|
00002bc0  61 67 65 5f 70 72 69 6e  74 5f 30 28 22 44 65 66  |age_print_0("Def|
00002bd0  65 63 74 4e 6f 4d 6f 72  65 22 29 0d 16 94 21 f2  |ectNoMore")...!.|
00002be0  6d 65 73 73 61 67 65 5f  70 72 69 6e 74 5f 30 28  |message_print_0(|
00002bf0  22 44 65 66 65 63 74 41  64 64 22 29 0d 16 9e 0d  |"DefectAdd")....|
00002c00  e7 4e 65 77 4d 61 70 25  8c 0d 16 a8 25 f2 6d 65  |.NewMap%....%.me|
00002c10  73 73 61 67 65 5f 70 72  69 6e 74 5f 30 28 22 44  |ssage_print_0("D|
00002c20  65 66 65 63 74 41 64 64  44 69 73 63 22 29 0d 16  |efectAddDisc")..|
00002c30  b2 05 cc 0d 16 bc 28 f2  6d 65 73 73 61 67 65 5f  |......(.message_|
00002c40  70 72 69 6e 74 5f 30 28  22 44 65 66 65 63 74 41  |print_0("DefectA|
00002c50  64 64 4c 6f 67 69 63 61  6c 22 29 0d 16 c6 05 cd  |ddLogical").....|
00002c60  0d 16 d0 24 f2 6d 65 73  73 61 67 65 5f 70 72 69  |...$.message_pri|
00002c70  6e 74 5f 30 28 22 44 65  66 65 63 74 52 65 6d 6f  |nt_0("DefectRemo|
00002c80  76 65 22 29 0d 16 da 05  cd 0d 16 e4 2f 6f 70 74  |ve")......../opt|
00002c90  24 3d a4 43 68 6f 6f 73  65 28 22 51 30 37 3a 22  |$=.Choose("Q07:"|
00002ca0  2c 22 41 42 43 44 43 68  6f 6f 73 65 22 2c 22 41  |,"ABCDChoose","A|
00002cb0  42 43 44 22 2c 22 22 29  0d 16 ee 05 f1 0d 16 f8  |BCD","")........|
00002cc0  0b c8 8e 6f 70 74 24 ca  0d 17 02 0c c9 22 42 22  |...opt$......"B"|
00002cd0  2c 22 44 22 0d 17 0c 2b  63 79 6c 25 3d a4 49 6e  |,"D"...+cyl%=.In|
00002ce0  70 75 74 44 65 63 28 22  43 79 6c 69 6e 64 65 72  |putDec("Cylinder|
00002cf0  44 65 63 22 2c 30 2c 43  79 6c 73 25 2d 31 29 0d  |Dec",0,Cyls%-1).|
00002d00  17 16 29 68 65 61 64 25  3d a4 49 6e 70 75 74 44  |..)head%=.InputD|
00002d10  65 63 28 22 48 65 61 64  44 65 63 22 2c 30 2c 48  |ec("HeadDec",0,H|
00002d20  65 61 64 73 25 2d 31 29  0d 17 20 0a e7 49 44 45  |eads%-1).. ..IDE|
00002d30  25 8c 0d 17 2a 30 73 65  63 74 6f 72 25 3d a4 49  |%...*0sector%=.I|
00002d40  6e 70 75 74 44 65 63 28  22 53 65 63 74 6f 72 44  |nputDec("SectorD|
00002d50  65 63 22 2c 31 2c 53 65  63 73 50 65 72 54 72 6b  |ec",1,SecsPerTrk|
00002d60  25 29 0d 17 34 05 cc 0d  17 3e 39 73 65 63 74 6f  |%)..4....>9secto|
00002d70  72 25 3d a4 49 6e 70 75  74 44 65 63 28 22 49 6e  |r%=.InputDec("In|
00002d80  64 65 78 4d 46 4d 44 65  63 22 2c 31 2d 53 65 63  |dexMFMDec",1-Sec|
00002d90  73 50 65 72 54 72 6b 25  2c 26 31 30 30 30 30 29  |sPerTrk%,&10000)|
00002da0  0d 17 48 10 e7 73 65 63  74 6f 72 25 3e 3d 30 8c  |..H..sector%>=0.|
00002db0  0d 17 52 17 73 65 63 74  6f 72 25 3d 73 65 63 74  |..R.sector%=sect|
00002dc0  6f 72 25 81 33 32 30 0d  17 5c 05 cc 0d 17 66 14  |or%.320..\....f.|
00002dd0  73 65 63 74 6f 72 25 3d  2d 73 65 63 74 6f 72 25  |sector%=-sector%|
00002de0  0d 17 70 05 cd 0d 17 7a  05 cd 0d 17 84 42 64 65  |..p....z.....Bde|
00002df0  66 65 63 74 25 3d 28 28  63 79 6c 25 2a 48 65 61  |fect%=((cyl%*Hea|
00002e00  64 73 25 2b 68 65 61 64  25 29 2a 53 65 63 73 50  |ds%+head%)*SecsP|
00002e10  65 72 54 72 6b 25 2b 28  73 65 63 74 6f 72 25 2d  |erTrk%+(sector%-|
00002e20  4c 6f 77 53 65 63 74 6f  72 25 29 29 0d 17 8e 0e  |LowSector%))....|
00002e30  e7 6f 70 74 24 3d 22 42  22 8c 0d 17 98 1b f2 41  |.opt$="B"......A|
00002e40  64 64 50 68 79 73 44 65  66 65 63 74 28 64 65 66  |ddPhysDefect(def|
00002e50  65 63 74 25 29 0d 17 a2  05 cc 0d 17 ac 1e f2 52  |ect%)..........R|
00002e60  65 6d 6f 76 65 50 68 79  73 44 65 66 65 63 74 28  |emovePhysDefect(|
00002e70  64 65 66 65 63 74 25 29  0d 17 b6 05 cd 0d 17 c0  |defect%)........|
00002e80  08 c9 22 43 22 0d 17 ca  0d e7 4e 65 77 4d 61 70  |.."C".....NewMap|
00002e90  25 8c 0d 17 d4 2f f2 41  64 64 50 68 79 73 44 65  |%..../.AddPhysDe|
00002ea0  66 65 63 74 28 28 a4 49  6e 70 75 74 48 65 78 32  |fect((.InputHex2|
00002eb0  28 22 44 69 73 63 41 64  64 72 48 65 78 22 29 29  |("DiscAddrHex"))|
00002ec0  29 0d 17 de 05 cc 0d 17  e8 26 f2 6d 65 73 73 61  |)........&.messa|
00002ed0  67 65 5f 70 72 69 6e 74  5f 30 28 22 44 46 6f 72  |ge_print_0("DFor|
00002ee0  6d 61 74 44 65 66 65 63  74 31 22 29 0d 17 f2 26  |matDefect1")...&|
00002ef0  f2 6d 65 73 73 61 67 65  5f 70 72 69 6e 74 5f 30  |.message_print_0|
00002f00  28 22 44 46 6f 72 6d 61  74 44 65 66 65 63 74 32  |("DFormatDefect2|
00002f10  22 29 0d 17 fc 26 f2 6d  65 73 73 61 67 65 5f 70  |")...&.message_p|
00002f20  72 69 6e 74 5f 30 28 22  44 46 6f 72 6d 61 74 44  |rint_0("DFormatD|
00002f30  65 66 65 63 74 33 22 29  0d 18 06 32 64 65 66 65  |efect3")...2defe|
00002f40  63 74 25 3d 28 a4 49 6e  70 75 74 48 65 78 28 22  |ct%=(.InputHex("|
00002f50  4c 6f 67 69 63 61 6c 41  64 64 72 48 65 78 22 29  |LogicalAddrHex")|
00002f60  81 53 65 63 53 69 7a 65  25 29 0d 18 10 27 f2 41  |.SecSize%)...'.A|
00002f70  64 64 50 68 79 73 44 65  66 65 63 74 28 a4 4c 6f  |ddPhysDefect(.Lo|
00002f80  67 54 6f 50 68 79 73 28  64 65 66 65 63 74 25 29  |gToPhys(defect%)|
00002f90  29 0d 18 1a 05 cd 0d 18  24 05 cb 0d 18 2e 11 fd  |).......$.......|
00002fa0  c0 6f 70 74 24 2c 31 29  3d 22 41 22 0d 18 38 18  |.opt$,1)="A"..8.|
00002fb0  e3 49 25 3d 30 b8 44 69  73 63 53 74 72 75 63 25  |.I%=0.DiscStruc%|
00002fc0  2d 34 88 34 0d 18 42 1b  42 6f 6f 74 52 65 63 25  |-4.4..B.BootRec%|
00002fd0  21 49 25 3d 44 69 73 63  52 65 63 25 21 49 25 0d  |!I%=DiscRec%!I%.|
00002fe0  18 4c 07 ed 49 25 0d 18  56 11 f2 49 6e 69 74 48  |.L..I%..V..InitH|
00002ff0  61 72 64 44 65 73 63 0d  18 60 05 e1 0d 18 74 0c  |ardDesc..`....t.|
00003000  dd f2 46 6f 72 6d 61 74  0d 18 7e 07 d1 3d 30 0d  |..Format..~..=0.|
00003010  18 88 15 ea 49 25 2c 4a  25 2c 63 79 6c 25 2c 68  |....I%,J%,cyl%,h|
00003020  65 61 64 25 0d 18 92 1b  f2 4d 6f 61 6e 4f 70 28  |ead%.....MoanOp(|
00003030  53 70 65 63 69 66 79 25  2c 30 2c 30 2c 30 29 0d  |Specify%,0,0,0).|
00003040  18 9c 1b f2 4d 6f 61 6e  4f 70 28 52 65 73 74 6f  |....MoanOp(Resto|
00003050  72 65 25 2c 30 2c 30 2c  30 29 0d 18 b0 22 f2 6d  |re%,0,0,0)...".m|
00003060  65 73 73 61 67 65 5f 70  72 69 6e 74 5f 30 28 22  |essage_print_0("|
00003070  46 6f 72 6d 61 74 74 69  6e 67 22 29 0d 18 ba 0a  |Formatting")....|
00003080  e7 49 44 45 25 8c 0d 18  c4 1d e3 49 25 3d 30 b8  |.IDE%......I%=0.|
00003090  35 31 32 2d 34 88 34 3a  42 75 66 25 21 49 25 3d  |512-4.4:Buf%!I%=|
000030a0  30 3a ed 0d 18 ce 17 e3  49 25 3d 30 b8 53 65 63  |0:......I%=0.Sec|
000030b0  73 50 65 72 54 72 6b 25  2d 31 0d 18 d8 15 42 75  |sPerTrk%-1....Bu|
000030c0  66 25 3f 28 32 2a 49 25  2b 30 29 3d 26 30 30 0d  |f%?(2*I%+0)=&00.|
000030d0  18 e2 16 42 75 66 25 3f  28 32 2a 49 25 2b 31 29  |...Buf%?(2*I%+1)|
000030e0  3d 49 25 2b 31 0d 18 ec  05 ed 0d 18 f6 05 cc 0d  |=I%+1...........|
000030f0  19 00 25 e3 49 25 3d 30  b8 35 31 32 2d 34 88 34  |..%.I%=0.512-4.4|
00003100  3a 42 75 66 25 21 49 25  3d 26 30 37 37 46 30 33  |:Buf%!I%=&077F03|
00003110  46 46 3a ed 0d 19 0a 05  cd 0d 19 14 13 e3 63 79  |FF:...........cy|
00003120  6c 25 3d 30 b8 43 79 6c  73 25 2d 31 0d 19 1e 0e  |l%=0.Cyls%-1....|
00003130  ef 31 33 3a f1 63 79 6c  25 3b 0d 19 28 15 e3 68  |.13:.cyl%;..(..h|
00003140  65 61 64 25 3d 30 b8 48  65 61 64 73 25 2d 31 0d  |ead%=0.Heads%-1.|
00003150  19 32 22 e7 63 79 6c 25  3c 3e 30 84 68 65 61 64  |.2".cyl%<>0.head|
00003160  25 3c 3e 30 84 ac 46 6f  72 6d 61 74 74 65 64 25  |%<>0..Formatted%|
00003170  8c 0d 19 3c 0b e7 ac 49  44 45 25 8c 0d 19 46 17  |...<...IDE%...F.|
00003180  4a 25 3d 63 79 6c 25 84  28 68 65 61 64 25 3c 3c  |J%=cyl%.(head%<<|
00003190  32 34 29 0d 19 50 33 e3  49 25 3d 30 b8 28 53 65  |24)..P3.I%=0.(Se|
000031a0  63 73 50 65 72 54 72 6b  25 2d 31 29 2a 34 88 34  |csPerTrk%-1)*4.4|
000031b0  3a 42 75 66 25 21 49 25  3d 4a 25 84 28 49 25 3c  |:Buf%!I%=J%.(I%<|
000031c0  3c 31 34 29 3a ed 0d 19  5a 05 cd 0d 19 6e 3d f2  |<14):...Z....n=.|
000031d0  4f 70 28 57 72 69 74 65  54 72 61 63 6b 25 2c 28  |Op(WriteTrack%,(|
000031e0  63 79 6c 25 2a 48 65 61  64 73 25 2b 68 65 61 64  |cyl%*Heads%+head|
000031f0  25 29 2a 53 65 63 73 50  65 72 54 72 6b 25 2c 42  |%)*SecsPerTrk%,B|
00003200  75 66 25 2c 35 31 32 29  0d 19 78 2b e7 52 65 73  |uf%,512)..x+.Res|
00003210  75 6c 74 25 f2 6d 65 73  73 61 67 65 5f 70 72 69  |ult%.message_pri|
00003220  6e 74 5f 30 28 22 46 6f  72 6d 61 74 45 72 72 6f  |nt_0("FormatErro|
00003230  72 22 29 0d 19 82 05 cd  0d 19 8c 05 ed 0d 19 96  |r").............|
00003240  05 ed 0d 19 a0 05 e1 0d  19 b4 0c dd f2 56 65 72  |.............Ver|
00003250  69 66 79 0d 19 be 2c e7  53 6f 61 6b 46 6c 61 67  |ify...,.SoakFlag|
00003260  25 f2 6d 65 73 73 61 67  65 5f 70 72 69 6e 74 5f  |%.message_print_|
00003270  30 28 22 53 6f 61 6b 50  72 6f 6d 70 74 22 29 0d  |0("SoakPrompt").|
00003280  19 c8 2d ea 61 64 64 25  2c 70 74 72 25 2c 73 65  |..-.add%,ptr%,se|
00003290  63 74 6f 72 25 2c 68 65  61 64 25 2c 63 79 6c 25  |ctor%,head%,cyl%|
000032a0  2c 64 65 66 65 63 74 6c  69 73 74 25 0d 19 d2 1d  |,defectlist%....|
000032b0  43 79 63 6c 65 25 3d 31  3a 45 72 72 6f 72 43 79  |Cycle%=1:ErrorCy|
000032c0  63 6c 65 25 3d 2d 31 30  30 0d 19 dc 1f 43 79 6c  |cle%=-100....Cyl|
000032d0  53 69 7a 65 25 3d 53 65  63 73 50 65 72 54 72 6b  |Size%=SecsPerTrk|
000032e0  25 2a 48 65 61 64 73 25  0d 19 e6 21 73 75 73 70  |%*Heads%...!susp|
000032f0  65 63 74 73 25 3d 30 3a  4d 61 78 53 75 73 70 65  |ects%=0:MaxSuspe|
00003300  63 74 73 25 3d 31 30 30  30 0d 19 f0 42 de 43 79  |cts%=1000...B.Cy|
00003310  6c 42 75 66 25 43 79 6c  53 69 7a 65 25 2b 34 2c  |lBuf%CylSize%+4,|
00003320  53 75 73 41 64 64 25 28  4d 61 78 53 75 73 70 65  |SusAdd%(MaxSuspe|
00003330  63 74 73 25 29 2c 53 75  73 43 6f 75 6e 74 25 4d  |cts%),SusCount%M|
00003340  61 78 53 75 73 70 65 63  74 73 25 0d 19 fa 25 ef  |axSuspects%...%.|
00003350  31 33 3a f2 6d 65 73 73  61 67 65 5f 70 72 69 6e  |13:.message_prin|
00003360  74 5f 30 28 22 56 65 72  69 66 79 69 6e 67 22 29  |t_0("Verifying")|
00003370  0d 1a 04 05 f5 0d 1a 0e  0e e7 43 79 63 6c 65 25  |..........Cycle%|
00003380  3e 31 8c 0d 1a 18 17 49  25 3d 43 79 63 6c 65 25  |>1.....I%=Cycle%|
00003390  83 50 61 74 74 65 72 6e  73 25 0d 1a 22 0a e7 49  |.Patterns%.."..I|
000033a0  25 3e 31 8c 0d 1a 2c 13  4a 25 3d 50 61 74 74 65  |%>1...,.J%=Patte|
000033b0  72 6e 25 28 49 25 29 0d  1a 36 1d 4a 25 3d 28 4a  |rn%(I%)..6.J%=(J|
000033c0  25 3e 3e 3e 31 29 84 28  28 4a 25 80 20 31 29 3c  |%>>>1).((J%. 1)<|
000033d0  3c 32 33 29 0d 1a 40 13  50 61 74 74 65 72 6e 25  |<23)..@.Pattern%|
000033e0  28 49 25 29 3d 4a 25 0d  1a 4a 05 cc 0d 1a 54 14  |(I%)=J%..J....T.|
000033f0  4a 25 3d b3 28 26 31 30  30 30 30 30 30 29 2d 31  |J%=.(&1000000)-1|
00003400  0d 1a 5e 05 cd 0d 1a 68  10 e7 ac 53 6f 61 6b 46  |..^....h...SoakF|
00003410  6c 61 67 25 8c 0d 1a 72  07 ef 31 33 0d 1a 7c 26  |lag%...r..13..|&|
00003420  f2 6d 65 73 73 61 67 65  5f 70 72 69 6e 74 5f 31  |.message_print_1|
00003430  28 22 50 61 74 74 65 72  6e 22 2c c3 7e 28 4a 25  |("Pattern",.~(J%|
00003440  29 29 0d 1a 86 05 cd 0d  1a 90 2b e3 49 25 3d 43  |))........+.I%=C|
00003450  79 6c 42 75 66 25 b8 43  79 6c 42 75 66 25 2b 43  |ylBuf%.CylBuf%+C|
00003460  79 6c 53 69 7a 65 25 88  33 3a 21 49 25 3d 4a 25  |ylSize%.3:!I%=J%|
00003470  3a ed 0d 1a 9a 0a 70 74  72 25 3d 30 0d 1a a4 11  |:.....ptr%=0....|
00003480  64 65 66 65 63 74 6c 69  73 74 25 3d 30 0d 1a ae  |defectlist%=0...|
00003490  0e e7 42 69 67 41 44 46  53 25 8c 0d 1a b8 26 e7  |..BigADFS%....&.|
000034a0  46 6f 72 6d 61 74 74 65  64 25 61 64 64 25 3d 53  |Formatted%add%=S|
000034b0  65 63 73 50 65 72 54 72  6b 25 8b 61 64 64 25 3d  |ecsPerTrk%.add%=|
000034c0  30 0d 1a c2 05 cc 0d 1a  cc 2f e7 46 6f 72 6d 61  |0......../.Forma|
000034d0  74 74 65 64 25 61 64 64  25 3d 53 65 63 53 69 7a  |tted%add%=SecSiz|
000034e0  65 25 2a 53 65 63 73 50  65 72 54 72 6b 25 8b 61  |e%*SecsPerTrk%.a|
000034f0  64 64 25 3d 30 0d 1a d6  05 cd 0d 1a e0 05 f5 0d  |dd%=0...........|
00003500  1a ea 5a e7 44 65 66 65  63 74 25 21 70 74 72 25  |..Z.Defect%!ptr%|
00003510  3e 45 6e 64 44 65 66 65  63 74 25 80 20 44 65 66  |>EndDefect%. Def|
00003520  65 63 74 25 21 70 74 72  25 3c 45 6e 64 44 65 66  |ect%!ptr%<EndDef|
00003530  65 63 74 32 25 80 20 42  69 67 41 44 46 53 25 80  |ect2%. BigADFS%.|
00003540  20 42 69 67 44 69 73 63  25 80 20 64 65 66 65 63  | BigDisc%. defec|
00003550  74 6c 69 73 74 25 3d 30  8c 0d 1a f4 0b 70 74 72  |tlist%=0.....ptr|
00003560  25 2b 3d 34 0d 1a fe 11  64 65 66 65 63 74 6c 69  |%+=4....defectli|
00003570  73 74 25 3d 31 0d 1b 08  05 cd 0d 1b 1c 29 43 79  |st%=1........)Cy|
00003580  6c 45 6e 64 25 3d 61 64  64 25 2d 28 61 64 64 25  |lEnd%=add%-(add%|
00003590  83 43 79 6c 53 69 7a 65  25 29 2b 43 79 6c 53 69  |.CylSize%)+CylSi|
000035a0  7a 65 25 0d 1b 30 15 e7  28 64 65 66 65 63 74 6c  |ze%..0..(defectl|
000035b0  69 73 74 25 3d 31 29 8c  0d 1b 44 18 64 65 66 65  |ist%=1)...D.defe|
000035c0  63 74 25 3d 44 65 66 65  63 74 25 21 70 74 72 25  |ct%=Defect%!ptr%|
000035d0  0d 1b 4e 05 cc 0d 1b 62  23 64 65 66 65 63 74 25  |..N....b#defect%|
000035e0  3d 28 44 65 66 65 63 74  25 21 70 74 72 25 29 81  |=(Defect%!ptr%).|
000035f0  53 65 63 53 69 7a 65 25  0d 1b 6c 05 cd 0d 1b 80  |SecSize%..l.....|
00003600  22 e7 64 65 66 65 63 74  25 3e 43 79 6c 45 6e 64  |".defect%>CylEnd|
00003610  25 84 64 65 66 65 63 74  25 3c 61 64 64 25 8c 0d  |%.defect%<add%..|
00003620  1b 8a 23 6c 65 6e 67 74  68 25 3d 28 43 79 6c 45  |..#length%=(CylE|
00003630  6e 64 25 2d 61 64 64 25  29 2a 53 65 63 53 69 7a  |nd%-add%)*SecSiz|
00003640  65 25 0d 1b 94 05 cc 0d  1b 9e 23 6c 65 6e 67 74  |e%........#lengt|
00003650  68 25 3d 28 64 65 66 65  63 74 25 2d 61 64 64 25  |h%=(defect%-add%|
00003660  29 2a 53 65 63 53 69 7a  65 25 0d 1b a8 05 cd 0d  |)*SecSize%......|
00003670  1b bc 1e f2 4f 70 28 57  72 69 74 65 25 2c 61 64  |....Op(Write%,ad|
00003680  64 25 2c 30 2c 6c 65 6e  67 74 68 25 29 0d 1b d0  |d%,0,length%)...|
00003690  0d e7 52 65 73 75 6c 74  25 8c 0d 1b da 0e e7 42  |..Result%......B|
000036a0  69 67 41 44 46 53 25 8c  0d 1b e4 22 61 64 64 25  |igADFS%...."add%|
000036b0  3d 28 45 72 72 44 69 73  63 41 64 64 25 80 26 31  |=(ErrDiscAdd%.&1|
000036c0  46 46 46 46 46 46 46 29  2b 31 0d 1b ee 05 cc 0d  |FFFFFFF)+1......|
000036d0  1b f8 2d 61 64 64 25 3d  28 28 45 72 72 44 69 73  |..-add%=((ErrDis|
000036e0  63 41 64 64 25 80 26 31  46 46 46 46 46 30 30 29  |cAdd%.&1FFFFF00)|
000036f0  81 53 65 63 53 69 7a 65  25 29 2b 31 0d 1c 02 05  |.SecSize%)+1....|
00003700  cd 0d 1c 0c 05 cc 0d 1c  16 11 61 64 64 25 2b 3d  |..........add%+=|
00003710  6c 65 6e 67 74 68 25 0d  1c 20 05 cd 0d 1c 2a 21  |length%.. ....*!|
00003720  e7 61 64 64 25 3d 64 65  66 65 63 74 25 8c 61 64  |.add%=defect%.ad|
00003730  64 25 2b 3d 31 3a 70 74  72 25 2b 3d 34 0d 1c 34  |d%+=1:ptr%+=4..4|
00003740  1a fd 61 64 64 25 3e 3d  53 65 63 74 6f 72 73 50  |..add%>=SectorsP|
00003750  65 72 44 69 73 63 25 0d  1c 3e 05 cd 0d 1c 48 13  |erDisc%..>....H.|
00003760  e7 53 6f 61 6b 46 6c 61  67 25 f1 22 2e 22 3b 0d  |.SoakFlag%.".";.|
00003770  1c 66 0a 61 64 64 25 3d  30 0d 1c 70 0a 70 74 72  |.f.add%=0..p.ptr|
00003780  25 3d 30 0d 1c 7a 11 64  65 66 65 63 74 6c 69 73  |%=0..z.defectlis|
00003790  74 25 3d 30 0d 1c 84 1b  f2 4d 6f 61 6e 4f 70 28  |t%=0.....MoanOp(|
000037a0  52 65 73 74 6f 72 65 25  2c 30 2c 30 2c 30 29 0d  |Restore%,0,0,0).|
000037b0  1c 8e 05 f5 0d 1c 98 13  e7 64 65 66 65 63 74 6c  |.........defectl|
000037c0  69 73 74 25 3d 30 8c 0d  1c a2 05 f5 0d 1c ac 2a  |ist%=0.........*|
000037d0  e7 28 44 65 66 65 63 74  25 21 70 74 72 25 80 26  |.(Defect%!ptr%.&|
000037e0  45 30 30 30 30 30 30 30  29 3c 3e 45 6e 64 44 65  |E0000000)<>EndDe|
000037f0  66 65 63 74 25 8c 0d 1c  b6 24 e7 28 28 44 65 66  |fect%....$.((Def|
00003800  65 63 74 25 21 70 74 72  25 29 81 53 65 63 53 69  |ect%!ptr%).SecSi|
00003810  7a 65 25 29 3c 61 64 64  25 8c 0d 1c c0 0b 70 74  |ze%)<add%.....pt|
00003820  72 25 2b 3d 34 0d 1c ca  05 cd 0d 1c d4 05 cc 0d  |r%+=4...........|
00003830  1c de 0e e7 42 69 67 44  69 73 63 25 8c 0d 1c e8  |....BigDisc%....|
00003840  11 64 65 66 65 63 74 6c  69 73 74 25 3d 31 0d 1c  |.defectlist%=1..|
00003850  f2 0b 70 74 72 25 2b 3d  34 0d 1c fc 05 cd 0d 1d  |..ptr%+=4.......|
00003860  06 05 cd 0d 1d 10 32 fd  64 65 66 65 63 74 6c 69  |......2.defectli|
00003870  73 74 25 3d 31 84 28 28  44 65 66 65 63 74 25 21  |st%=1.((Defect%!|
00003880  70 74 72 25 29 81 53 65  63 53 69 7a 65 25 29 3e  |ptr%).SecSize%)>|
00003890  3d 61 64 64 25 0d 1d 1a  05 cd 0d 1d 24 13 e7 64  |=add%.......$..d|
000038a0  65 66 65 63 74 6c 69 73  74 25 3d 31 8c 0d 1d 2e  |efectlist%=1....|
000038b0  17 c8 95 44 65 66 65 63  74 25 21 70 74 72 25 3c  |...Defect%!ptr%<|
000038c0  61 64 64 25 0d 1d 38 0b  70 74 72 25 2b 3d 34 0d  |add%..8.ptr%+=4.|
000038d0  1d 42 05 ce 0d 1d 4c 05  cd 0d 1d 56 13 e7 64 65  |.B....L....V..de|
000038e0  66 65 63 74 6c 69 73 74  25 3d 30 8c 0d 1d 60 23  |fectlist%=0...`#|
000038f0  64 65 66 65 63 74 25 3d  28 44 65 66 65 63 74 25  |defect%=(Defect%|
00003900  21 70 74 72 25 29 81 53  65 63 53 69 7a 65 25 0d  |!ptr%).SecSize%.|
00003910  1d 6a 05 cc 0d 1d 74 18  64 65 66 65 63 74 25 3d  |.j....t.defect%=|
00003920  44 65 66 65 63 74 25 21  70 74 72 25 0d 1d 7e 05  |Defect%!ptr%..~.|
00003930  cd 0d 1d 92 1d e7 64 65  66 65 63 74 25 3e 53 65  |......defect%>Se|
00003940  63 74 6f 72 73 50 65 72  44 69 73 63 25 8c 0d 1d  |ctorsPerDisc%...|
00003950  9c 20 6c 65 6e 67 74 68  25 3d 53 65 63 74 6f 72  |. length%=Sector|
00003960  73 50 65 72 44 69 73 63  25 2d 61 64 64 25 0d 1d  |sPerDisc%-add%..|
00003970  a6 05 cc 0d 1d b0 18 6c  65 6e 67 74 68 25 3d 64  |.......length%=d|
00003980  65 66 65 63 74 25 2d 61  64 64 25 0d 1d ba 05 cd  |efect%-add%.....|
00003990  0d 1d ce 28 f2 4f 70 28  56 65 72 69 66 79 25 2c  |...(.Op(Verify%,|
000039a0  61 64 64 25 2c 30 2c 6c  65 6e 67 74 68 25 2a 53  |add%,0,length%*S|
000039b0  65 63 53 69 7a 65 25 29  0d 1d e2 0d e7 52 65 73  |ecSize%).....Res|
000039c0  75 6c 74 25 8c 0d 1d ec  0e e7 42 69 67 41 44 46  |ult%......BigADF|
000039d0  53 25 8c 0d 1d f6 1e 61  64 64 25 3d 45 72 72 44  |S%.....add%=ErrD|
000039e0  69 73 63 41 64 64 25 80  26 31 46 46 46 46 46 46  |iscAdd%.&1FFFFFF|
000039f0  46 0d 1e 00 05 cc 0d 1e  0a 29 61 64 64 25 3d 28  |F........)add%=(|
00003a00  45 72 72 44 69 73 63 41  64 64 25 80 26 31 46 46  |ErrDiscAdd%.&1FF|
00003a10  46 46 46 30 30 29 81 53  65 63 53 69 7a 65 25 0d  |FFF00).SecSize%.|
00003a20  1e 14 05 cd 0d 1e 1e 0a  54 72 79 25 3d 30 0d 1e  |........Try%=0..|
00003a30  28 05 f5 0d 1e 32 0b 54  72 79 25 2b 3d 31 0d 1e  |(....2.Try%+=1..|
00003a40  3c 1b f2 4d 6f 61 6e 4f  70 28 52 65 73 74 6f 72  |<..MoanOp(Restor|
00003a50  65 25 2c 30 2c 30 2c 30  29 0d 1e 46 20 f2 4f 70  |e%,0,0,0)..F .Op|
00003a60  28 56 65 72 69 66 79 25  2c 61 64 64 25 2c 30 2c  |(Verify%,add%,0,|
00003a70  53 65 63 53 69 7a 65 25  29 0d 1e 5a 15 fd 52 65  |SecSize%)..Z..Re|
00003a80  73 75 6c 74 25 3d 30 84  54 72 79 25 3d 35 0d 1e  |sult%=0.Try%=5..|
00003a90  64 13 e7 52 65 73 75 6c  74 25 54 72 79 25 2b 3d  |d..Result%Try%+=|
00003aa0  31 0d 1e 6e 10 73 65 63  74 6f 72 25 3d 61 64 64  |1..n.sector%=add|
00003ab0  25 0d 1e 78 1d 68 65 61  64 25 3d 73 65 63 74 6f  |%..x.head%=secto|
00003ac0  72 25 81 53 65 63 73 50  65 72 54 72 6b 25 0d 1e  |r%.SecsPerTrk%..|
00003ad0  82 1f 73 65 63 74 6f 72  25 3d 73 65 63 74 6f 72  |..sector%=sector|
00003ae0  25 83 53 65 63 73 50 65  72 54 72 6b 25 0d 1e 8c  |%.SecsPerTrk%...|
00003af0  15 63 79 6c 25 3d 68 65  61 64 25 81 48 65 61 64  |.cyl%=head%.Head|
00003b00  73 25 0d 1e 96 16 68 65  61 64 25 3d 68 65 61 64  |s%....head%=head|
00003b10  25 83 48 65 61 64 73 25  0d 1e a0 49 f2 6d 65 73  |%.Heads%...I.mes|
00003b20  73 61 67 65 5f 70 72 69  6e 74 5f 33 28 22 56 65  |sage_print_3("Ve|
00003b30  72 69 66 79 44 61 74 61  22 2c c3 28 63 79 6c 25  |rifyData",.(cyl%|
00003b40  29 2c c3 28 68 65 61 64  25 29 2c c3 28 73 65 63  |),.(head%),.(sec|
00003b50  74 6f 72 25 2b 4c 6f 77  53 65 63 74 6f 72 25 29  |tor%+LowSector%)|
00003b60  29 0d 1e aa 0a 73 75 73  25 3d 30 0d 1e b4 33 c8  |)....sus%=0...3.|
00003b70  95 73 75 73 25 3c 73 75  73 70 65 63 74 73 25 80  |.sus%<suspects%.|
00003b80  20 53 75 73 41 64 64 25  28 73 75 73 25 29 3c 3e  | SusAdd%(sus%)<>|
00003b90  61 64 64 25 3a 73 75 73  25 2b 3d 31 3a ce 0d 1e  |add%:sus%+=1:...|
00003ba0  be 14 e7 73 75 73 25 3d  73 75 73 70 65 63 74 73  |...sus%=suspects|
00003bb0  25 8c 0d 1e c8 1c e7 73  75 73 70 65 63 74 73 25  |%......suspects%|
00003bc0  3d 4d 61 78 53 75 73 70  65 63 74 73 25 8c 0d 1e  |=MaxSuspects%...|
00003bd0  d2 1a 73 75 73 25 3d b3  28 4d 61 78 53 75 73 70  |..sus%=.(MaxSusp|
00003be0  65 63 74 73 25 29 2d 31  0d 1e dc 05 cc 0d 1e e6  |ects%)-1........|
00003bf0  10 73 75 73 70 65 63 74  73 25 2b 3d 31 0d 1e f0  |.suspects%+=1...|
00003c00  05 cd 0d 1e fa 16 53 75  73 41 64 64 25 28 73 75  |......SusAdd%(su|
00003c10  73 25 29 3d 61 64 64 25  0d 1f 04 14 53 75 73 43  |s%)=add%....SusC|
00003c20  6f 75 6e 74 25 3f 73 75  73 25 3d 30 0d 1f 0e 05  |ount%?sus%=0....|
00003c30  cd 0d 1f 18 17 73 63 6f  72 65 25 3d 32 5e 28 54  |.....score%=2^(T|
00003c40  72 79 25 2d 31 29 2d 31  0d 1f 22 1e e7 ac 53 6f  |ry%-1)-1.."...So|
00003c50  61 6b 46 6c 61 67 25 73  63 6f 72 65 25 3d 73 63  |akFlag%score%=sc|
00003c60  6f 72 65 25 2a 34 0d 1f  2c 1a 53 75 73 43 6f 75  |ore%*4..,.SusCou|
00003c70  6e 74 25 3f 73 75 73 25  2b 3d 73 63 6f 72 65 25  |nt%?sus%+=score%|
00003c80  0d 1f 36 1e e7 28 53 75  73 43 6f 75 6e 74 25 3f  |..6..(SusCount%?|
00003c90  73 75 73 25 3e 33 30 29  84 64 65 76 25 8c 0d 1f  |sus%>30).dev%...|
00003ca0  40 0f e7 53 6f 61 6b 46  6c 61 67 25 8c 0d 1f 4a  |@..SoakFlag%...J|
00003cb0  25 f2 6d 65 73 73 61 67  65 5f 70 72 69 6e 74 5f  |%.message_print_|
00003cc0  31 28 22 44 65 66 65 63  74 54 49 4d 45 22 2c 91  |1("DefectTIME",.|
00003cd0  24 29 0d 1f 54 05 cc 0d  1f 5e 1e f2 6d 65 73 73  |$)..T....^..mess|
00003ce0  61 67 65 5f 70 72 69 6e  74 5f 30 28 22 44 65 66  |age_print_0("Def|
00003cf0  65 63 74 22 29 0d 1f 68  05 cd 0d 1f 72 18 f2 41  |ect")..h....r..A|
00003d00  64 64 50 68 79 73 44 65  66 65 63 74 28 61 64 64  |ddPhysDefect(add|
00003d10  25 29 0d 1f 7c 16 45 72  72 6f 72 43 79 63 6c 65  |%)..|.ErrorCycle|
00003d20  25 3d 43 79 63 6c 65 25  0d 1f 86 05 cc 0d 1f 90  |%=Cycle%........|
00003d30  0f e7 53 6f 61 6b 46 6c  61 67 25 8c 0d 1f 9a 1f  |..SoakFlag%.....|
00003d40  d1 3d 30 3a f5 fd 91 3e  35 30 30 3a ef 31 33 3a  |.=0:...>500:.13:|
00003d50  f1 89 28 37 38 29 3b 3a  ef 31 33 0d 1f a4 05 cc  |..(78);:.13.....|
00003d60  0d 1f ae 27 f2 6d 65 73  73 61 67 65 5f 70 72 69  |...'.message_pri|
00003d70  6e 74 5f 31 28 22 52 65  74 72 69 65 73 22 2c c3  |nt_1("Retries",.|
00003d80  28 54 72 79 25 29 29 0d  1f b8 05 cd 0d 1f c2 05  |(Try%)).........|
00003d90  cd 0d 1f cc 0f 61 64 64  25 3d 61 64 64 25 2b 31  |.....add%=add%+1|
00003da0  0d 1f d6 05 cc 0d 1f e0  17 61 64 64 25 3d 61 64  |.........add%=ad|
00003db0  64 25 2b 6c 65 6e 67 74  68 25 2b 31 0d 1f ea 05  |d%+length%+1....|
00003dc0  cd 0d 1f f4 12 e7 61 64  64 25 3e 64 65 66 65 63  |......add%>defec|
00003dd0  74 25 8c 0d 1f fe 0b 70  74 72 25 2b 3d 34 0d 20  |t%.....ptr%+=4. |
00003de0  08 05 cd 0d 20 12 1a fd  61 64 64 25 3e 3d 53 65  |.... ...add%>=Se|
00003df0  63 74 6f 72 73 50 65 72  44 69 73 63 25 0d 20 1c  |ctorsPerDisc%. .|
00003e00  0f e7 53 6f 61 6b 46 6c  61 67 25 8c 0d 20 26 05  |..SoakFlag%.. &.|
00003e10  f5 0d 20 30 0d 4b 65 79  25 3d a6 28 30 29 0d 20  |.. 0.Key%=.(0). |
00003e20  3a 14 fd 4b 65 79 25 3d  2d 31 84 4b 65 79 25 3d  |:..Key%=-1.Key%=|
00003e30  33 32 0d 20 44 13 64 6f  6e 65 25 3d 28 4b 65 79  |32. D.done%=(Key|
00003e40  25 3d 33 32 29 0d 20 4e  05 cc 0d 20 58 1e 64 6f  |%=32). N... X.do|
00003e50  6e 65 25 3d 43 79 63 6c  65 25 3e 45 72 72 6f 72  |ne%=Cycle%>Error|
00003e60  43 79 63 6c 65 25 2b 32  0d 20 62 05 cd 0d 20 6c  |Cycle%+2. b... l|
00003e70  0d 43 79 63 6c 65 25 2b  3d 31 0d 20 76 12 e7 53  |.Cycle%+=1. v..S|
00003e80  6f 61 6b 46 6c 61 67 25  ef 26 32 45 0d 20 80 0a  |oakFlag%.&2E. ..|
00003e90  fd 64 6f 6e 65 25 0d 20  8a 05 e1 0d 20 a8 0f dd  |.done%. .... ...|
00003ea0  f2 53 74 72 75 63 74 75  72 65 0d 20 b2 0d e7 4e  |.Structure. ...N|
00003eb0  65 77 4d 61 70 25 8c 0d  20 bc 11 f2 4e 65 77 53  |ewMap%.. ...NewS|
00003ec0  74 72 75 63 74 75 72 65  0d 20 c6 05 cc 0d 20 d0  |tructure. .... .|
00003ed0  11 f2 4f 6c 64 53 74 72  75 63 74 75 72 65 0d 20  |..OldStructure. |
00003ee0  da 05 cd 0d 20 e4 05 e1  0d 21 02 12 dd f2 4f 6c  |.... ....!....Ol|
00003ef0  64 53 74 72 75 63 74 75  72 65 0d 21 0c 14 f2 57  |dStructure.!...W|
00003f00  72 69 74 65 44 65 66 65  63 74 4c 69 73 74 0d 21  |riteDefectList.!|
00003f10  16 12 f2 57 72 69 74 65  4f 6c 64 46 73 4d 61 70  |...WriteOldFsMap|
00003f20  0d 21 20 11 f2 57 72 69  74 65 52 6f 6f 74 44 69  |.! ..WriteRootDi|
00003f30  72 0d 21 2a 05 e1 0d 21  48 19 dd a4 52 6f 75 6e  |r.!*...!H...Roun|
00003f40  64 55 70 53 68 61 72 65  28 53 65 63 73 25 29 0d  |dUpShare(Secs%).|
00003f50  21 52 1c e7 4c 6f 67 32  53 68 61 72 65 53 69 7a  |!R..Log2ShareSiz|
00003f60  65 25 3d 30 8c 3d 53 65  63 73 25 0d 21 5c 31 3d  |e%=0.=Secs%.!\1=|
00003f70  28 28 53 65 63 73 25 2b  53 68 61 72 65 53 69 7a  |((Secs%+ShareSiz|
00003f80  65 25 2d 31 29 81 53 68  61 72 65 53 69 7a 65 25  |e%-1).ShareSize%|
00003f90  29 2a 53 68 61 72 65 53  69 7a 65 25 0d 21 84 24  |)*ShareSize%.!.$|
00003fa0  dd a4 4d 61 70 42 69 74  73 28 53 65 63 73 25 2c  |..MapBits(Secs%,|
00003fb0  4c 67 25 2c 4c 67 32 53  65 63 53 69 7a 65 25 29  |Lg%,Lg2SecSize%)|
00003fc0  0d 21 8e 0b ea 53 68 69  66 74 25 0d 21 98 1a 53  |.!...Shift%.!..S|
00003fd0  68 69 66 74 25 3d 4c 67  32 53 65 63 53 69 7a 65  |hift%=Lg2SecSize|
00003fe0  25 2d 4c 67 25 0d 21 a2  10 e7 28 53 68 69 66 74  |%-Lg%.!...(Shift|
00003ff0  25 3e 30 29 8c 0d 21 ac  12 3d 53 65 63 73 25 3c  |%>0)..!..=Secs%<|
00004000  3c 53 68 69 66 74 25 0d  21 b6 05 cc 0d 21 c0 15  |<Shift%.!....!..|
00004010  3d 53 65 63 73 25 3e 3e  28 2d 53 68 69 66 74 25  |=Secs%>>(-Shift%|
00004020  29 0d 21 ca 05 cd 0d 21  de 29 dd a4 52 6f 75 6e  |).!....!.)..Roun|
00004030  64 53 65 63 74 6f 72 73  28 42 69 74 73 25 2c 4c  |dSectors(Bits%,L|
00004040  67 25 2c 4c 67 32 53 65  63 53 69 7a 65 25 29 0d  |g%,Lg2SecSize%).|
00004050  21 e8 0b ea 53 68 69 66  74 25 0d 21 f2 1a 53 68  |!...Shift%.!..Sh|
00004060  69 66 74 25 3d 4c 67 32  53 65 63 53 69 7a 65 25  |ift%=Lg2SecSize%|
00004070  2d 4c 67 25 0d 21 fc 10  e7 28 53 68 69 66 74 25  |-Lg%.!...(Shift%|
00004080  3e 30 29 8c 0d 22 06 14  3d 42 69 74 73 25 3e 3e  |>0).."..=Bits%>>|
00004090  28 53 68 69 66 74 25 29  0d 22 10 05 cc 0d 22 1a  |(Shift%)."....".|
000040a0  15 3d 42 69 74 73 25 3c  3c 28 2d 53 68 69 66 74  |.=Bits%<<(-Shift|
000040b0  25 29 0d 22 24 05 cd 0d  22 38 17 dd a4 64 6f 61  |%)."$..."8...doa|
000040c0  6c 6c 6f 63 28 56 65 72  62 6f 73 65 25 29 0d 22  |lloc(Verbose%)."|
000040d0  42 13 4c 6f 67 32 41 6c  6c 6f 63 25 3d 4c 6f 67  |B.Log2Alloc%=Log|
000040e0  25 0d 22 4c 0e f2 53 68  61 72 65 53 69 7a 65 0d  |%."L..ShareSize.|
000040f0  22 56 3e 4d 61 70 42 69  74 73 25 3d a4 4d 61 70  |"V>MapBits%=.Map|
00004100  42 69 74 73 28 53 65 63  74 6f 72 73 50 65 72 44  |Bits(SectorsPerD|
00004110  69 73 63 25 2c 4c 6f 67  32 41 6c 6c 6f 63 25 2c  |isc%,Log2Alloc%,|
00004120  4c 6f 67 32 53 65 63 53  69 7a 65 25 29 0d 22 60  |Log2SecSize%)."`|
00004130  41 52 6f 75 6e 64 53 65  63 74 6f 72 73 25 3d a4  |ARoundSectors%=.|
00004140  52 6f 75 6e 64 53 65 63  74 6f 72 73 28 4d 61 70  |RoundSectors(Map|
00004150  42 69 74 73 25 2c 4c 6f  67 32 41 6c 6c 6f 63 25  |Bits%,Log2Alloc%|
00004160  2c 4c 6f 67 32 53 65 63  53 69 7a 65 25 29 0d 22  |,Log2SecSize%)."|
00004170  6a 14 42 65 73 74 5a 6f  6e 65 73 25 3d 31 3c 3c  |j.BestZones%=1<<|
00004180  33 30 0d 22 74 15 42 65  73 74 43 79 6c 4f 66 66  |30."t.BestCylOff|
00004190  25 3d 31 3c 3c 33 30 0d  22 7e 14 e3 44 75 6d 6d  |%=1<<30."~..Dumm|
000041a0  79 53 70 61 72 65 25 3d  31 b8 31 0d 22 88 2c e3  |ySpare%=1.1.".,.|
000041b0  53 70 61 72 65 42 69 74  73 25 3d 34 2a 38 b8 5a  |SpareBits%=4*8.Z|
000041c0  6f 6e 65 42 69 74 73 25  2d 5a 6f 6e 65 30 42 69  |oneBits%-Zone0Bi|
000041d0  74 73 25 2d 38 2a 38 0d  22 92 0e f2 43 61 6c 63  |ts%-8*8."...Calc|
000041e0  5a 6f 6e 65 73 0d 22 9c  10 4c 69 6e 6b 42 69 74  |Zones."..LinkBit|
000041f0  73 25 3d 31 30 0d 22 a6  11 f5 4c 69 6e 6b 42 69  |s%=10."...LinkBi|
00004200  74 73 25 2b 3d 31 0d 22  b0 0c f2 43 61 6c 63 49  |ts%+=1."...CalcI|
00004210  64 73 0d 22 ba 33 fd 49  64 73 25 3c 3d 32 5e 4c  |ds.".3.Ids%<=2^L|
00004220  69 6e 6b 42 69 74 73 25  80 20 4c 69 6e 6b 42 69  |inkBits%. LinkBi|
00004230  74 73 25 3e 3d 28 4c 6f  67 32 53 65 63 53 69 7a  |ts%>=(Log2SecSiz|
00004240  65 25 2b 33 29 0d 22 c4  3b e7 53 70 61 72 65 42  |e%+3).".;.SpareB|
00004250  69 74 73 25 2d 34 2a 38  3e 30 80 20 53 70 61 72  |its%-4*8>0. Spar|
00004260  65 42 69 74 73 25 2d 34  2a 38 3c 3d 4c 69 6e 6b  |eBits%-4*8<=Link|
00004270  42 69 74 73 25 ed 53 70  61 72 65 42 69 74 73 25  |Bits%.SpareBits%|
00004280  0d 22 ce 2f e7 4f 64 64  42 69 74 73 25 3e 30 80  |."./.OddBits%>0.|
00004290  20 4f 64 64 42 69 74 73  25 3c 3d 4c 69 6e 6b 42  | OddBits%<=LinkB|
000042a0  69 74 73 25 ed 53 70 61  72 65 42 69 74 73 25 0d  |its%.SpareBits%.|
000042b0  22 d8 1d e7 4c 69 6e 6b  42 69 74 73 25 3e 31 35  |"...LinkBits%>15|
000042c0  84 5a 6f 6e 65 73 25 3e  31 32 37 8c 0d 22 e2 2f  |.Zones%>127.."./|
000042d0  e7 56 65 72 62 6f 73 65  25 8c f2 6d 65 73 73 61  |.Verbose%..messa|
000042e0  67 65 5f 70 72 69 6e 74  5f 30 28 22 54 6f 6f 53  |ge_print_0("TooS|
000042f0  6d 61 6c 6c 41 6c 6c 6f  63 22 29 0d 22 ec 11 4c  |mallAlloc")."..L|
00004300  6f 67 32 41 6c 6c 6f 63  25 2b 3d 31 0d 22 f6 10  |og2Alloc%+=1."..|
00004310  ed 44 75 6d 6d 79 53 70  61 72 65 25 0d 23 00 06  |.DummySpare%.#..|
00004320  3d a3 0d 23 0a 05 cd 0d  23 14 18 e7 5a 6f 6e 65  |=..#....#...Zone|
00004330  73 25 3c 3d 42 65 73 74  5a 6f 6e 65 73 25 8c 0d  |s%<=BestZones%..|
00004340  23 1e 36 43 72 75 63 69  61 6c 25 3d a4 52 6f 75  |#.6Crucial%=.Rou|
00004350  6e 64 55 70 53 68 61 72  65 28 5a 6f 6e 65 73 25  |ndUpShare(Zones%|
00004360  2a 32 29 2a 53 65 63 53  69 7a 65 25 2b 44 69 72  |*2)*SecSize%+Dir|
00004370  53 69 7a 65 25 0d 23 28  34 e7 4d 61 70 5a 6f 6e  |Size%.#(4.MapZon|
00004380  65 25 3d 30 20 43 72 75  63 69 61 6c 25 3d 42 6f  |e%=0 Crucial%=Bo|
00004390  6f 74 41 64 64 25 2a 53  65 63 53 69 7a 65 25 2b  |otAdd%*SecSize%+|
000043a0  42 6f 6f 74 53 69 7a 65  25 0d 23 32 3f e7 43 72  |BootSize%.#2?.Cr|
000043b0  75 63 69 61 6c 25 3c 41  6c 6c 6f 63 25 2a 28 4c  |ucial%<Alloc%*(L|
000043c0  69 6e 6b 42 69 74 73 25  2b 31 29 43 72 75 63 69  |inkBits%+1)Cruci|
000043d0  61 6c 25 3d 41 6c 6c 6f  63 25 2a 28 4c 69 6e 6b  |al%=Alloc%*(Link|
000043e0  42 69 74 73 25 2b 31 29  0d 23 3c 29 43 72 75 63  |Bits%+1).#<)Cruc|
000043f0  69 61 6c 45 6e 64 25 3d  4d 61 70 41 64 64 25 2b  |ialEnd%=MapAdd%+|
00004400  43 72 75 63 69 61 6c 25  2f 53 65 63 53 69 7a 65  |Crucial%/SecSize|
00004410  25 0d 23 46 11 64 65 66  65 63 74 6c 69 73 74 25  |%.#F.defectlist%|
00004420  3d 30 0d 23 50 13 44 65  66 50 74 72 25 3d 44 65  |=0.#P.DefPtr%=De|
00004430  66 65 63 74 25 0d 23 5a  05 f5 0d 23 64 14 64 65  |fect%.#Z...#d.de|
00004440  66 65 63 74 25 3d 21 44  65 66 50 74 72 25 0d 23  |fect%=!DefPtr%.#|
00004450  6e 0e 44 65 66 50 74 72  25 2b 3d 34 0d 23 78 32  |n.DefPtr%+=4.#x2|
00004460  e7 64 65 66 65 63 74 25  3e 3d 45 6e 64 44 65 66  |.defect%>=EndDef|
00004470  65 63 74 25 80 20 64 65  66 65 63 74 6c 69 73 74  |ect%. defectlist|
00004480  25 3d 30 80 20 42 69 67  44 69 73 63 25 8c 0d 23  |%=0. BigDisc%..#|
00004490  82 14 64 65 66 65 63 74  25 3d 21 44 65 66 50 74  |..defect%=!DefPt|
000044a0  72 25 0d 23 8c 0e 44 65  66 50 74 72 25 2b 3d 34  |r%.#..DefPtr%+=4|
000044b0  0d 23 96 11 64 65 66 65  63 74 6c 69 73 74 25 3d  |.#..defectlist%=|
000044c0  31 0d 23 a0 05 cd 0d 23  aa 3f e7 64 65 66 65 63  |1.#....#.?.defec|
000044d0  74 6c 69 73 74 25 3d 30  80 20 64 65 66 65 63 74  |tlist%=0. defect|
000044e0  25 3c 45 6e 64 44 65 66  65 63 74 25 8c 64 65 66  |%<EndDefect%.def|
000044f0  65 63 74 25 3d 64 65 66  65 63 74 25 2f 53 65 63  |ect%=defect%/Sec|
00004500  53 69 7a 65 25 0d 23 b4  40 fd 64 65 66 65 63 74  |Size%.#.@.defect|
00004510  25 3e 3d 45 6e 64 44 65  66 65 63 74 25 84 28 64  |%>=EndDefect%.(d|
00004520  65 66 65 63 74 25 3e 3d  4d 61 70 41 64 64 25 80  |efect%>=MapAdd%.|
00004530  20 64 65 66 65 63 74 25  3c 43 72 75 63 69 61 6c  | defect%<Crucial|
00004540  45 6e 64 25 29 0d 23 be  28 43 79 6c 4f 66 66 25  |End%).#.(CylOff%|
00004550  3d 4d 61 70 41 64 64 25  83 28 53 65 63 73 50 65  |=MapAdd%.(SecsPe|
00004560  72 54 72 6b 25 2a 48 65  61 64 73 25 29 0d 23 c8  |rTrk%*Heads%).#.|
00004570  2e e7 64 65 66 65 63 74  25 3e 3d 45 6e 64 44 65  |..defect%>=EndDe|
00004580  66 65 63 74 25 80 20 43  79 6c 4f 66 66 25 3c 42  |fect%. CylOff%<B|
00004590  65 73 74 43 79 6c 4f 66  66 25 8c 0d 23 d2 17 42  |estCylOff%..#..B|
000045a0  65 73 74 43 79 6c 4f 66  66 25 3d 43 79 6c 4f 66  |estCylOff%=CylOf|
000045b0  66 25 0d 23 dc 1b 42 65  73 74 4c 69 6e 6b 42 69  |f%.#..BestLinkBi|
000045c0  74 73 25 3d 4c 69 6e 6b  42 69 74 73 25 0d 23 e6  |ts%=LinkBits%.#.|
000045d0  19 42 65 73 74 53 70 61  72 65 25 3d 53 70 61 72  |.BestSpare%=Spar|
000045e0  65 42 69 74 73 25 0d 23  f0 15 42 65 73 74 5a 6f  |eBits%.#..BestZo|
000045f0  6e 65 73 25 3d 5a 6f 6e  65 73 25 0d 23 fa 05 cd  |nes%=Zones%.#...|
00004600  0d 24 04 1b e7 42 65 73  74 43 79 6c 4f 66 66 25  |.$...BestCylOff%|
00004610  ed 53 70 61 72 65 42 69  74 73 25 0d 24 0e 10 ed  |.SpareBits%.$...|
00004620  44 75 6d 6d 79 53 70 61  72 65 25 0d 24 18 05 cc  |DummySpare%.$...|
00004630  0d 24 22 10 ed 44 75 6d  6d 79 53 70 61 72 65 25  |.$"..DummySpare%|
00004640  0d 24 2c 05 cd 0d 24 36  4b e7 42 65 73 74 5a 6f  |.$,...$6K.BestZo|
00004650  6e 65 73 25 3d 28 31 3c  3c 33 30 29 80 20 56 65  |nes%=(1<<30). Ve|
00004660  72 62 6f 73 65 25 3d b9  8c f2 6d 65 73 73 61 67  |rbose%=...messag|
00004670  65 5f 70 72 69 6e 74 5f  30 28 22 49 6e 76 61 6c  |e_print_0("Inval|
00004680  69 64 41 6c 6c 6f 63 53  69 7a 65 22 29 3a 3d a3  |idAllocSize"):=.|
00004690  0d 24 40 06 3d b9 0d 24  54 12 dd f2 4e 65 77 53  |.$@.=..$T...NewS|
000046a0  74 72 75 63 74 75 72 65  0d 24 5e 13 5a 6f 6e 65  |tructure.$^.Zone|
000046b0  30 42 69 74 73 25 3d 36  30 2a 38 0d 24 68 18 5a  |0Bits%=60*8.$h.Z|
000046c0  6f 6e 65 42 69 74 73 25  3d 53 65 63 53 69 7a 65  |oneBits%=SecSize|
000046d0  25 2a 38 0d 24 72 10 4c  6f 67 32 41 6c 6c 6f 63  |%*8.$r.Log2Alloc|
000046e0  25 3d 39 0d 24 7c 0e f2  53 68 61 72 65 53 69 7a  |%=9.$|..ShareSiz|
000046f0  65 0d 24 86 2a e7 4c 6f  67 32 41 6c 6c 6f 63 25  |e.$.*.Log2Alloc%|
00004700  3c 38 8c 4c 6f 67 32 41  6c 6c 6f 63 25 3d 31 30  |<8.Log2Alloc%=10|
00004710  3a f2 53 68 61 72 65 53  69 7a 65 0d 24 a4 27 41  |:.ShareSize.$.'A|
00004720  6c 6c 6f 63 25 3d 32 5e  4c 6f 67 32 41 6c 6c 6f  |lloc%=2^Log2Allo|
00004730  63 25 3a 4c 6f 67 25 3d  4c 6f 67 32 41 6c 6c 6f  |c%:Log%=Log2Allo|
00004740  63 25 0d 24 ae 13 c8 95  a4 64 6f 61 6c 6c 6f 63  |c%.$.....doalloc|
00004750  28 a3 29 3d a3 0d 24 b8  27 41 6c 6c 6f 63 25 3d  |(.)=..$.'Alloc%=|
00004760  32 5e 4c 6f 67 32 41 6c  6c 6f 63 25 3a 4c 6f 67  |2^Log2Alloc%:Log|
00004770  25 3d 4c 6f 67 32 41 6c  6c 6f 63 25 0d 24 c2 05  |%=Log2Alloc%.$..|
00004780  ce 0d 24 d6 05 f1 0d 24  e0 05 f5 0d 24 ea 30 41  |..$....$....$.0A|
00004790  6c 6c 6f 63 25 3d a4 41  73 6b 28 22 41 6c 6c 6f  |lloc%=.Ask("Allo|
000047a0  63 55 6e 69 74 41 73 6b  22 2c 32 5e 4c 6f 67 32  |cUnitAsk",2^Log2|
000047b0  41 6c 6c 6f 63 25 2c 32  35 36 29 0d 24 f4 0a 4c  |Alloc%,256).$..L|
000047c0  6f 67 25 3d 37 0d 24 fe  05 f5 0d 25 08 0b 4c 6f  |og%=7.$....%..Lo|
000047d0  67 25 2b 3d 31 0d 25 12  12 fd 41 6c 6c 6f 63 25  |g%+=1.%...Alloc%|
000047e0  3d 32 5e 4c 6f 67 25 0d  25 26 10 fd a4 64 6f 61  |=2^Log%.%&...doa|
000047f0  6c 6c 6f 63 28 b9 29 0d  25 3a 05 f1 0d 25 44 1b  |lloc(.).%:...%D.|
00004800  4c 69 6e 6b 42 69 74 73  25 3d 42 65 73 74 4c 69  |LinkBits%=BestLi|
00004810  6e 6b 42 69 74 73 25 0d  25 4e 19 53 70 61 72 65  |nkBits%.%N.Spare|
00004820  42 69 74 73 25 3d 42 65  73 74 53 70 61 72 65 25  |Bits%=BestSpare%|
00004830  0d 25 58 0e f2 43 61 6c  63 5a 6f 6e 65 73 0d 25  |.%X..CalcZones.%|
00004840  62 0c f2 43 61 6c 63 49  64 73 0d 25 6c 36 43 72  |b..CalcIds.%l6Cr|
00004850  75 63 69 61 6c 25 3d a4  52 6f 75 6e 64 55 70 53  |ucial%=.RoundUpS|
00004860  68 61 72 65 28 5a 6f 6e  65 73 25 2a 32 29 2a 53  |hare(Zones%*2)*S|
00004870  65 63 53 69 7a 65 25 2b  44 69 72 53 69 7a 65 25  |ecSize%+DirSize%|
00004880  0d 25 76 34 e7 4d 61 70  5a 6f 6e 65 25 3d 30 20  |.%v4.MapZone%=0 |
00004890  43 72 75 63 69 61 6c 25  3d 42 6f 6f 74 41 64 64  |Crucial%=BootAdd|
000048a0  25 2a 53 65 63 53 69 7a  65 25 2b 42 6f 6f 74 53  |%*SecSize%+BootS|
000048b0  69 7a 65 25 0d 25 80 3f  e7 43 72 75 63 69 61 6c  |ize%.%.?.Crucial|
000048c0  25 3c 41 6c 6c 6f 63 25  2a 28 4c 69 6e 6b 42 69  |%<Alloc%*(LinkBi|
000048d0  74 73 25 2b 31 29 43 72  75 63 69 61 6c 25 3d 41  |ts%+1)Crucial%=A|
000048e0  6c 6c 6f 63 25 2a 28 4c  69 6e 6b 42 69 74 73 25  |lloc%*(LinkBits%|
000048f0  2b 31 29 0d 25 8a 38 e7  43 72 75 63 69 61 6c 25  |+1).%.8.Crucial%|
00004900  83 41 6c 6c 6f 63 25 3c  3e 30 20 43 72 75 63 69  |.Alloc%<>0 Cruci|
00004910  61 6c 25 2b 3d 41 6c 6c  6f 63 25 2d 43 72 75 63  |al%+=Alloc%-Cruc|
00004920  69 61 6c 25 83 41 6c 6c  6f 63 25 0d 25 94 10 e7  |ial%.Alloc%.%...|
00004930  4d 61 70 5a 6f 6e 65 25  3d 30 8c 0d 25 9e 2b 52  |MapZone%=0..%.+R|
00004940  6f 6f 74 44 69 72 41 64  64 25 3d 42 6f 6f 74 41  |ootDirAdd%=BootA|
00004950  64 64 25 2b 42 6f 6f 74  53 69 7a 65 25 2f 53 65  |dd%+BootSize%/Se|
00004960  63 53 69 7a 65 25 0d 25  a8 40 49 6e 64 52 6f 6f  |cSize%.%.@IndRoo|
00004970  74 44 69 72 41 64 64 25  3d 26 32 30 30 2b 28 42  |tDirAdd%=&200+(B|
00004980  6f 6f 74 41 64 64 25 2a  53 65 63 53 69 7a 65 25  |ootAdd%*SecSize%|
00004990  2b 42 6f 6f 74 53 69 7a  65 25 29 81 53 65 63 53  |+BootSize%).SecS|
000049a0  69 7a 65 25 2b 31 0d 25  b2 05 cc 0d 25 bc 3b 52  |ize%+1.%....%.;R|
000049b0  6f 6f 74 44 69 72 41 64  64 25 3d 4d 61 70 41 64  |ootDirAdd%=MapAd|
000049c0  64 25 2b a4 52 6f 75 6e  64 55 70 53 68 61 72 65  |d%+.RoundUpShare|
000049d0  28 28 4d 61 70 4c 65 6e  25 2a 32 29 2f 53 65 63  |((MapLen%*2)/Sec|
000049e0  53 69 7a 65 25 29 0d 25  c6 3c 49 6e 64 52 6f 6f  |Size%).%.<IndRoo|
000049f0  74 44 69 72 41 64 64 25  3d 26 32 30 30 2b a4 52  |tDirAdd%=&200+.R|
00004a00  6f 75 6e 64 55 70 53 68  61 72 65 28 5a 6f 6e 65  |oundUpShare(Zone|
00004a10  73 25 2a 32 29 2f 53 68  61 72 65 53 69 7a 65 25  |s%*2)/ShareSize%|
00004a20  2b 31 0d 25 d0 05 cd 0d  25 da 18 44 69 73 63 52  |+1.%....%..DiscR|
00004a30  65 63 25 3f 34 3d 4c 69  6e 6b 42 69 74 73 25 0d  |ec%?4=LinkBits%.|
00004a40  25 e4 19 44 69 73 63 52  65 63 25 3f 35 3d 4c 6f  |%..DiscRec%?5=Lo|
00004a50  67 32 41 6c 6c 6f 63 25  0d 25 ee 2b e7 42 6f 6f  |g2Alloc%.%.+.Boo|
00004a60  74 4f 70 74 24 3d 22 59  22 8c 44 69 73 63 52 65  |tOpt$="Y".DiscRe|
00004a70  63 25 21 37 3d 32 8b 44  69 73 63 52 65 63 25 21  |c%!7=2.DiscRec%!|
00004a80  37 3d 30 0d 25 f8 19 44  69 73 63 52 65 63 25 3f  |7=0.%..DiscRec%?|
00004a90  38 3d 4c 6f 77 53 65 63  74 6f 72 25 0d 26 02 15  |8=LowSector%.&..|
00004aa0  44 69 73 63 52 65 63 25  3f 39 3d 5a 6f 6e 65 73  |DiscRec%?9=Zones|
00004ab0  25 0d 26 0c 1e 44 69 73  63 52 65 63 25 3f 26 41  |%.&..DiscRec%?&A|
00004ac0  3d 53 70 61 72 65 42 69  74 73 25 83 32 35 36 0d  |=SpareBits%.256.|
00004ad0  26 16 1e 44 69 73 63 52  65 63 25 3f 26 42 3d 53  |&..DiscRec%?&B=S|
00004ae0  70 61 72 65 42 69 74 73  25 81 32 35 36 0d 26 20  |pareBits%.256.& |
00004af0  1e 44 69 73 63 52 65 63  25 21 26 43 3d 49 6e 64  |.DiscRec%!&C=Ind|
00004b00  52 6f 6f 74 44 69 72 41  64 64 25 0d 26 2a 1f 44  |RootDirAdd%.&*.D|
00004b10  69 73 63 52 65 63 25 3f  26 32 38 3d 4c 6f 67 32  |iscRec%?&28=Log2|
00004b20  53 68 61 72 65 53 69 7a  65 25 0d 26 34 19 42 6f  |ShareSize%.&4.Bo|
00004b30  6f 74 52 65 63 25 21 34  3d 44 69 73 63 52 65 63  |otRec%!4=DiscRec|
00004b40  25 21 34 0d 26 3e 19 42  6f 6f 74 52 65 63 25 21  |%!4.&>.BootRec%!|
00004b50  38 3d 44 69 73 63 52 65  63 25 21 38 0d 26 48 1b  |8=DiscRec%!8.&H.|
00004b60  42 6f 6f 74 52 65 63 25  21 26 43 3d 44 69 73 63  |BootRec%!&C=Disc|
00004b70  52 65 63 25 21 26 43 0d  26 52 1d 42 6f 6f 74 52  |Rec%!&C.&R.BootR|
00004b80  65 63 25 21 26 32 34 3d  44 69 73 63 52 65 63 25  |ec%!&24=DiscRec%|
00004b90  21 26 32 34 0d 26 5c 1d  42 6f 6f 74 52 65 63 25  |!&24.&\.BootRec%|
00004ba0  21 26 32 38 3d 44 69 73  63 52 65 63 25 21 26 32  |!&28=DiscRec%!&2|
00004bb0  38 0d 26 66 1d e3 49 25  3d 30 b8 5a 6f 6e 65 73  |8.&f..I%=0.Zones|
00004bc0  25 2a 53 65 63 53 69 7a  65 25 2d 34 88 34 0d 26  |%*SecSize%-4.4.&|
00004bd0  70 0d 42 75 66 25 21 49  25 3d 30 0d 26 7a 07 ed  |p.Buf%!I%=0.&z..|
00004be0  49 25 0d 26 84 10 e3 49  25 3d 30 b8 36 30 2d 34  |I%.&...I%=0.60-4|
00004bf0  88 34 0d 26 8e 1b 42 75  66 25 21 28 49 25 2b 34  |.4.&..Buf%!(I%+4|
00004c00  29 3d 44 69 73 63 52 65  63 25 21 49 25 0d 26 98  |)=DiscRec%!I%.&.|
00004c10  07 ed 49 25 0d 26 a2 14  f2 57 72 69 74 65 44 65  |..I%.&...WriteDe|
00004c20  66 65 63 74 4c 69 73 74  0d 26 ac 23 f2 6d 65 73  |fectList.&.#.mes|
00004c30  73 61 67 65 5f 70 72 69  6e 74 5f 30 28 22 43 72  |sage_print_0("Cr|
00004c40  65 61 74 69 6e 67 4d 61  70 22 29 0d 26 b6 0a 70  |eatingMap").&..p|
00004c50  74 72 25 3d 30 0d 26 c0  12 44 65 66 65 63 74 53  |tr%=0.&..DefectS|
00004c60  74 61 72 74 25 3d 30 0d  26 ca 11 64 65 66 65 63  |tart%=0.&..defec|
00004c70  74 6c 69 73 74 25 3d 30  0d 26 d4 2b 44 69 73 63  |tlist%=0.&.+Disc|
00004c80  45 6e 64 42 69 74 25 3d  a4 44 69 73 63 54 6f 4d  |EndBit%=.DiscToM|
00004c90  61 70 28 53 65 63 74 6f  72 73 50 65 72 44 69 73  |ap(SectorsPerDis|
00004ca0  63 25 29 0d 26 de 13 5a  6f 6e 65 53 74 61 72 74  |c%).&..ZoneStart|
00004cb0  25 3d 42 75 66 25 0d 26  e8 13 5a 6f 6e 65 53 74  |%=Buf%.&..ZoneSt|
00004cc0  61 72 74 42 69 74 25 3d  30 0d 26 f2 13 42 6f 6f  |artBit%=0.&..Boo|
00004cd0  74 53 74 61 72 74 42 69  74 25 3d 30 0d 26 fc 11  |tStartBit%=0.&..|
00004ce0  42 6f 6f 74 45 6e 64 42  69 74 25 3d 30 0d 27 06  |BootEndBit%=0.'.|
00004cf0  12 4d 61 70 53 74 61 72  74 42 69 74 25 3d 30 0d  |.MapStartBit%=0.|
00004d00  27 10 10 4d 61 70 45 6e  64 42 69 74 25 3d 30 0d  |'..MapEndBit%=0.|
00004d10  27 1a 15 e3 7a 6f 6e 65  25 3d 30 b8 5a 6f 6e 65  |'...zone%=0.Zone|
00004d20  73 25 2d 31 0d 27 24 23  21 5a 6f 6e 65 53 74 61  |s%-1.'$#!ZoneSta|
00004d30  72 74 25 3d 31 3c 3c 28  31 35 2b 46 72 65 65 4c  |rt%=1<<(15+FreeL|
00004d40  69 6e 6b 25 2a 38 29 0d  27 2e 27 5a 6f 6e 65 45  |ink%*8).'.'ZoneE|
00004d50  6e 64 42 69 74 25 3d 5a  6f 6e 65 53 74 61 72 74  |ndBit%=ZoneStart|
00004d60  42 69 74 25 2b 5a 6f 6e  65 42 69 74 73 25 0d 27  |Bit%+ZoneBits%.'|
00004d70  38 2e 55 73 65 64 5a 6f  6e 65 45 6e 64 42 69 74  |8.UsedZoneEndBit|
00004d80  25 3d 5a 6f 6e 65 45 6e  64 42 69 74 25 2d 53 70  |%=ZoneEndBit%-Sp|
00004d90  61 72 65 42 69 74 73 25  2b 34 2a 38 0d 27 42 21  |areBits%+4*8.'B!|
00004da0  e7 55 73 65 64 5a 6f 6e  65 45 6e 64 42 69 74 25  |.UsedZoneEndBit%|
00004db0  3e 44 69 73 63 45 6e 64  42 69 74 25 8c 0d 27 4c  |>DiscEndBit%..'L|
00004dc0  1f 55 73 65 64 5a 6f 6e  65 45 6e 64 42 69 74 25  |.UsedZoneEndBit%|
00004dd0  3d 44 69 73 63 45 6e 64  42 69 74 25 0d 27 56 05  |=DiscEndBit%.'V.|
00004de0  cd 0d 27 60 26 50 72 65  46 72 65 65 25 3d 5a 6f  |..'`&PreFree%=Zo|
00004df0  6e 65 53 74 61 72 74 42  69 74 25 2b 46 72 65 65  |neStartBit%+Free|
00004e00  4c 69 6e 6b 25 2a 38 0d  27 6a 1e 5a 6f 6e 65 42  |Link%*8.'j.ZoneB|
00004e10  69 74 25 3d 5a 6f 6e 65  53 74 61 72 74 42 69 74  |it%=ZoneStartBit|
00004e20  25 2b 34 2a 38 0d 27 74  0d e7 7a 6f 6e 65 25 3d  |%+4*8.'t..zone%=|
00004e30  30 8c 0d 27 7e 1a 42 6f  6f 74 53 74 61 72 74 42  |0..'~.BootStartB|
00004e40  69 74 25 3d 5a 6f 6e 65  42 69 74 25 0d 27 88 20  |it%=ZoneBit%.'. |
00004e50  5a 6f 6e 65 42 69 74 25  3d 5a 6f 6e 65 42 69 74  |ZoneBit%=ZoneBit|
00004e60  25 2b 5a 6f 6e 65 30 42  69 74 73 25 0d 27 92 30  |%+Zone0Bits%.'.0|
00004e70  6c 65 6e 67 74 68 25 3d  28 42 6f 6f 74 41 64 64  |length%=(BootAdd|
00004e80  25 2a 53 65 63 53 69 7a  65 25 2b 42 6f 6f 74 53  |%*SecSize%+BootS|
00004e90  69 7a 65 25 29 81 41 6c  6c 6f 63 25 0d 27 9c 2c  |ize%).Alloc%.'.,|
00004ea0  e7 6c 65 6e 67 74 68 25  3c 4c 69 6e 6b 42 69 74  |.length%<LinkBit|
00004eb0  73 25 2b 31 20 6c 65 6e  67 74 68 25 3d 4c 69 6e  |s%+1 length%=Lin|
00004ec0  6b 42 69 74 73 25 2b 31  0d 27 a6 1a f2 57 72 69  |kBits%+1.'...Wri|
00004ed0  74 65 4c 69 6e 6b 28 5a  6f 6e 65 42 69 74 25 2c  |teLink(ZoneBit%,|
00004ee0  32 29 0d 27 b0 22 f2 57  72 69 74 65 4c 65 6e 67  |2).'.".WriteLeng|
00004ef0  74 68 28 5a 6f 6e 65 42  69 74 25 2c 6c 65 6e 67  |th(ZoneBit%,leng|
00004f00  74 68 25 29 0d 27 ba 1d  5a 6f 6e 65 42 69 74 25  |th%).'..ZoneBit%|
00004f10  3d 5a 6f 6e 65 42 69 74  25 2b 6c 65 6e 67 74 68  |=ZoneBit%+length|
00004f20  25 0d 27 c4 18 42 6f 6f  74 45 6e 64 42 69 74 25  |%.'..BootEndBit%|
00004f30  3d 5a 6f 6e 65 42 69 74  25 0d 27 ce 05 cc 0d 27  |=ZoneBit%.'....'|
00004f40  d8 14 e7 7a 6f 6e 65 25  3d 4d 61 70 5a 6f 6e 65  |...zone%=MapZone|
00004f50  25 8c 0d 27 e2 19 4d 61  70 53 74 61 72 74 42 69  |%..'..MapStartBi|
00004f60  74 25 3d 5a 6f 6e 65 42  69 74 25 0d 27 ec 1b 6c  |t%=ZoneBit%.'..l|
00004f70  65 6e 67 74 68 25 3d 43  72 75 63 69 61 6c 25 81  |ength%=Crucial%.|
00004f80  41 6c 6c 6f 63 25 0d 27  f6 1a f2 57 72 69 74 65  |Alloc%.'...Write|
00004f90  4c 69 6e 6b 28 5a 6f 6e  65 42 69 74 25 2c 32 29  |Link(ZoneBit%,2)|
00004fa0  0d 28 00 22 f2 57 72 69  74 65 4c 65 6e 67 74 68  |.(.".WriteLength|
00004fb0  28 5a 6f 6e 65 42 69 74  25 2c 6c 65 6e 67 74 68  |(ZoneBit%,length|
00004fc0  25 29 0d 28 0a 1d 5a 6f  6e 65 42 69 74 25 3d 5a  |%).(..ZoneBit%=Z|
00004fd0  6f 6e 65 42 69 74 25 2b  6c 65 6e 67 74 68 25 0d  |oneBit%+length%.|
00004fe0  28 14 17 4d 61 70 45 6e  64 42 69 74 25 3d 5a 6f  |(..MapEndBit%=Zo|
00004ff0  6e 65 42 69 74 25 0d 28  1e 05 cd 0d 28 28 05 cd  |neBit%.(....((..|
00005000  0d 28 32 05 f5 0d 28 46  1b e7 5a 6f 6e 65 42 69  |.(2...(F..ZoneBi|
00005010  74 25 3e 44 65 66 65 63  74 53 74 61 72 74 25 8c  |t%>DefectStart%.|
00005020  0d 28 50 13 e7 64 65 66  65 63 74 6c 69 73 74 25  |.(P..defectlist%|
00005030  3d 30 8c 0d 28 5a 28 e7  44 65 66 65 63 74 25 21  |=0..(Z(.Defect%!|
00005040  70 74 72 25 3e 3d 45 6e  64 44 65 66 65 63 74 25  |ptr%>=EndDefect%|
00005050  80 20 42 69 67 44 69 73  63 25 8c 0d 28 64 0b 70  |. BigDisc%..(d.p|
00005060  74 72 25 2b 3d 34 0d 28  6e 11 64 65 66 65 63 74  |tr%+=4.(n.defect|
00005070  6c 69 73 74 25 3d 31 0d  28 78 29 44 65 66 65 63  |list%=1.(x)Defec|
00005080  74 53 74 61 72 74 25 3d  a4 44 69 73 63 54 6f 4d  |tStart%=.DiscToM|
00005090  61 70 28 44 65 66 65 63  74 25 21 70 74 72 25 29  |ap(Defect%!ptr%)|
000050a0  0d 28 82 05 cc 0d 28 8c  34 44 65 66 65 63 74 53  |.(....(.4DefectS|
000050b0  74 61 72 74 25 3d a4 44  69 73 63 54 6f 4d 61 70  |tart%=.DiscToMap|
000050c0  28 28 44 65 66 65 63 74  25 21 70 74 72 25 29 2f  |((Defect%!ptr%)/|
000050d0  53 65 63 53 69 7a 65 25  29 0d 28 96 05 cd 0d 28  |SecSize%).(....(|
000050e0  a0 05 cc 0d 28 aa 29 44  65 66 65 63 74 53 74 61  |....(.)DefectSta|
000050f0  72 74 25 3d a4 44 69 73  63 54 6f 4d 61 70 28 44  |rt%=.DiscToMap(D|
00005100  65 66 65 63 74 25 21 70  74 72 25 29 0d 28 b4 05  |efect%!ptr%).(..|
00005110  cd 0d 28 be 92 c8 95 28  28 7a 6f 6e 65 25 3d 30  |..(....((zone%=0|
00005120  80 28 44 65 66 65 63 74  53 74 61 72 74 25 3e 3d  |.(DefectStart%>=|
00005130  42 6f 6f 74 53 74 61 72  74 42 69 74 25 80 20 44  |BootStartBit%. D|
00005140  65 66 65 63 74 53 74 61  72 74 25 3c 42 6f 6f 74  |efectStart%<Boot|
00005150  45 6e 64 42 69 74 25 29  29 29 84 28 28 7a 6f 6e  |EndBit%))).((zon|
00005160  65 25 3d 4d 61 70 5a 6f  6e 65 25 80 28 44 65 66  |e%=MapZone%.(Def|
00005170  65 63 74 53 74 61 72 74  25 3e 3d 4d 61 70 53 74  |ectStart%>=MapSt|
00005180  61 72 74 42 69 74 25 80  20 44 65 66 65 63 74 53  |artBit%. DefectS|
00005190  74 61 72 74 25 3c 4d 61  70 45 6e 64 42 69 74 25  |tart%<MapEndBit%|
000051a0  29 29 29 0d 28 c8 13 e7  64 65 66 65 63 74 6c 69  |))).(...defectli|
000051b0  73 74 25 3d 30 8c 0d 28  d2 31 64 65 66 65 63 74  |st%=0..(.1defect|
000051c0  61 64 64 72 24 3d a4 68  65 78 61 64 64 72 28 28  |addr$=.hexaddr((|
000051d0  44 65 66 65 63 74 25 21  70 74 72 25 29 2f 53 65  |Defect%!ptr%)/Se|
000051e0  63 53 69 7a 65 25 29 0d  28 dc 05 cc 0d 28 e6 26  |cSize%).(....(.&|
000051f0  64 65 66 65 63 74 61 64  64 72 24 3d a4 68 65 78  |defectaddr$=.hex|
00005200  61 64 64 72 28 44 65 66  65 63 74 25 21 70 74 72  |addr(Defect%!ptr|
00005210  25 29 0d 28 f0 05 cd 0d  28 fa 0d e7 7a 6f 6e 65  |%).(....(...zone|
00005220  25 3d 30 8c 0d 29 04 33  f2 6d 65 73 73 61 67 65  |%=0..).3.message|
00005230  5f 70 72 69 6e 74 5f 31  28 22 42 6f 6f 74 44 65  |_print_1("BootDe|
00005240  66 65 63 74 45 72 72 6f  72 22 2c 64 65 66 65 63  |fectError",defec|
00005250  74 61 64 64 72 24 29 0d  29 0e 05 cc 0d 29 18 32  |taddr$).)....).2|
00005260  f2 6d 65 73 73 61 67 65  5f 70 72 69 6e 74 5f 31  |.message_print_1|
00005270  28 22 4d 61 70 44 65 66  65 63 74 45 72 72 6f 72  |("MapDefectError|
00005280  22 2c 64 65 66 65 63 74  61 64 64 72 24 29 0d 29  |",defectaddr$).)|
00005290  22 05 cd 0d 29 2c 0b 70  74 72 25 2b 3d 34 0d 29  |"...),.ptr%+=4.)|
000052a0  36 13 e7 64 65 66 65 63  74 6c 69 73 74 25 3d 30  |6..defectlist%=0|
000052b0  8c 0d 29 40 1e e7 44 65  66 65 63 74 25 21 70 74  |..)@..Defect%!pt|
000052c0  72 25 3e 3d 45 6e 64 44  65 66 65 63 74 25 8c 0d  |r%>=EndDefect%..|
000052d0  29 4a 0b 70 74 72 25 2b  3d 34 0d 29 54 11 64 65  |)J.ptr%+=4.)T.de|
000052e0  66 65 63 74 6c 69 73 74  25 3d 31 0d 29 5e 29 44  |fectlist%=1.)^)D|
000052f0  65 66 65 63 74 53 74 61  72 74 25 3d a4 44 69 73  |efectStart%=.Dis|
00005300  63 54 6f 4d 61 70 28 44  65 66 65 63 74 25 21 70  |cToMap(Defect%!p|
00005310  74 72 25 29 0d 29 68 05  cc 0d 29 72 34 44 65 66  |tr%).)h...)r4Def|
00005320  65 63 74 53 74 61 72 74  25 3d a4 44 69 73 63 54  |ectStart%=.DiscT|
00005330  6f 4d 61 70 28 28 44 65  66 65 63 74 25 21 70 74  |oMap((Defect%!pt|
00005340  72 25 29 2f 53 65 63 53  69 7a 65 25 29 0d 29 7c  |r%)/SecSize%).)||
00005350  05 cd 0d 29 86 05 cc 0d  29 90 29 44 65 66 65 63  |...)....).)Defec|
00005360  74 53 74 61 72 74 25 3d  a4 44 69 73 63 54 6f 4d  |tStart%=.DiscToM|
00005370  61 70 28 44 65 66 65 63  74 25 21 70 74 72 25 29  |ap(Defect%!ptr%)|
00005380  0d 29 9a 05 cd 0d 29 a4  05 ce 0d 29 ae 23 e7 44  |.)....)....).#.D|
00005390  65 66 65 63 74 53 74 61  72 74 25 3e 3d 55 73 65  |efectStart%>=Use|
000053a0  64 5a 6f 6e 65 45 6e 64  42 69 74 25 8c 0d 29 b8  |dZoneEndBit%..).|
000053b0  1c 44 65 66 65 63 74 53  74 61 72 74 25 3d 5a 6f  |.DefectStart%=Zo|
000053c0  6e 65 45 6e 64 42 69 74  25 0d 29 c2 05 cc 0d 29  |neEndBit%.)....)|
000053d0  cc 1d 44 65 66 65 63 74  45 6e 64 25 3d 44 65 66  |..DefectEnd%=Def|
000053e0  65 63 74 53 74 61 72 74  25 2b 31 0d 29 d6 0b 70  |ectStart%+1.)..p|
000053f0  74 72 25 2b 3d 34 0d 29  e0 05 f5 0d 29 ea 0c 64  |tr%+=4.)....)..d|
00005400  6f 6e 65 31 25 3d b9 0d  29 f4 05 f5 0d 29 fe 0c  |one1%=..)....)..|
00005410  64 6f 6e 65 32 25 3d b9  0d 2a 08 13 e7 64 65 66  |done2%=..*...def|
00005420  65 63 74 6c 69 73 74 25  3d 31 8c 0d 2a 12 28 4e  |ectlist%=1..*.(N|
00005430  65 78 74 44 65 66 65 63  74 25 3d a4 44 69 73 63  |extDefect%=.Disc|
00005440  54 6f 4d 61 70 28 44 65  66 65 63 74 25 21 70 74  |ToMap(Defect%!pt|
00005450  72 25 29 0d 2a 1c 05 cc  0d 2a 26 33 4e 65 78 74  |r%).*....*&3Next|
00005460  44 65 66 65 63 74 25 3d  a4 44 69 73 63 54 6f 4d  |Defect%=.DiscToM|
00005470  61 70 28 28 44 65 66 65  63 74 25 21 70 74 72 25  |ap((Defect%!ptr%|
00005480  29 2f 53 65 63 53 69 7a  65 25 29 0d 2a 30 05 cd  |)/SecSize%).*0..|
00005490  0d 2a 3a 21 e7 4e 65 78  74 44 65 66 65 63 74 25  |.*:!.NextDefect%|
000054a0  3c 55 73 65 64 5a 6f 6e  65 45 6e 64 42 69 74 25  |<UsedZoneEndBit%|
000054b0  8c 0d 2a 44 2b e7 4e 65  78 74 44 65 66 65 63 74  |..*D+.NextDefect|
000054c0  25 3e 5a 6f 6e 65 45 6e  64 42 69 74 25 2d 28 4c  |%>ZoneEndBit%-(L|
000054d0  69 6e 6b 42 69 74 73 25  2b 31 29 8c 0d 2a 4e 26  |inkBits%+1)..*N&|
000054e0  4e 65 78 74 44 65 66 25  3d 5a 6f 6e 65 45 6e 64  |NextDef%=ZoneEnd|
000054f0  42 69 74 25 2d 28 4c 69  6e 6b 42 69 74 73 25 2b  |Bit%-(LinkBits%+|
00005500  31 29 0d 2a 58 05 cc 0d  2a 62 18 4e 65 78 74 44  |1).*X...*b.NextD|
00005510  65 66 25 3d 4e 65 78 74  44 65 66 65 63 74 25 0d  |ef%=NextDefect%.|
00005520  2a 6c 05 cd 0d 2a 76 25  e7 4e 65 78 74 44 65 66  |*l...*v%.NextDef|
00005530  25 2d 44 65 66 65 63 74  45 6e 64 25 3c 4c 69 6e  |%-DefectEnd%<Lin|
00005540  6b 42 69 74 73 25 2b 31  8c 0d 2a 80 1e e7 4e 65  |kBits%+1..*...Ne|
00005550  78 74 44 65 66 65 63 74  25 2b 31 3e 44 65 66 65  |xtDefect%+1>Defe|
00005560  63 74 45 6e 64 25 8c 0d  2a 8a 1c 44 65 66 65 63  |ctEnd%..*..Defec|
00005570  74 45 6e 64 25 3d 4e 65  78 74 44 65 66 65 63 74  |tEnd%=NextDefect|
00005580  25 2b 31 0d 2a 94 05 cd  0d 2a 9e 0b 70 74 72 25  |%+1.*....*..ptr%|
00005590  2b 3d 34 0d 2a a8 0c 64  6f 6e 65 32 25 3d a3 0d  |+=4.*..done2%=..|
000055a0  2a b2 05 cd 0d 2a bc 05  cd 0d 2a c6 0b fd 64 6f  |*....*....*...do|
000055b0  6e 65 32 25 0d 2a d0 29  e7 44 65 66 65 63 74 45  |ne2%.*.).DefectE|
000055c0  6e 64 25 2d 44 65 66 65  63 74 53 74 61 72 74 25  |nd%-DefectStart%|
000055d0  3c 4c 69 6e 6b 42 69 74  73 25 2b 31 8c 0d 2a da  |<LinkBits%+1..*.|
000055e0  27 44 65 66 65 63 74 45  6e 64 25 3d 44 65 66 65  |'DefectEnd%=Defe|
000055f0  63 74 53 74 61 72 74 25  2b 4c 69 6e 6b 42 69 74  |ctStart%+LinkBit|
00005600  73 25 2b 31 0d 2a e4 1c  e7 44 65 66 65 63 74 45  |s%+1.*...DefectE|
00005610  6e 64 25 3e 5a 6f 6e 65  45 6e 64 42 69 74 25 8c  |nd%>ZoneEndBit%.|
00005620  0d 2a ee 1a 44 65 66 65  63 74 45 6e 64 25 3d 5a  |.*..DefectEnd%=Z|
00005630  6f 6e 65 45 6e 64 42 69  74 25 0d 2a f8 05 cd 0d  |oneEndBit%.*....|
00005640  2b 02 0c 64 6f 6e 65 31  25 3d a3 0d 2b 0c 05 cd  |+..done1%=..+...|
00005650  0d 2b 16 43 e7 44 65 66  65 63 74 45 6e 64 25 3e  |.+.C.DefectEnd%>|
00005660  5a 6f 6e 65 45 6e 64 42  69 74 25 2d 28 4c 69 6e  |ZoneEndBit%-(Lin|
00005670  6b 42 69 74 73 25 2b 31  29 80 20 44 65 66 65 63  |kBits%+1). Defec|
00005680  74 45 6e 64 25 3c 3e 5a  6f 6e 65 45 6e 64 42 69  |tEnd%<>ZoneEndBi|
00005690  74 25 8c 0d 2b 20 1a 44  65 66 65 63 74 45 6e 64  |t%..+ .DefectEnd|
000056a0  25 3d 5a 6f 6e 65 45 6e  64 42 69 74 25 0d 2b 2a  |%=ZoneEndBit%.+*|
000056b0  0c 64 6f 6e 65 31 25 3d  a3 0d 2b 34 05 cd 0d 2b  |.done1%=..+4...+|
000056c0  3e 29 e7 44 65 66 65 63  74 45 6e 64 25 2d 44 65  |>).DefectEnd%-De|
000056d0  66 65 63 74 53 74 61 72  74 25 3c 4c 69 6e 6b 42  |fectStart%<LinkB|
000056e0  69 74 73 25 2b 31 8c 0d  2b 48 29 44 65 66 65 63  |its%+1..+H)Defec|
000056f0  74 53 74 61 72 74 25 3d  44 65 66 65 63 74 45 6e  |tStart%=DefectEn|
00005700  64 25 2d 28 4c 69 6e 6b  42 69 74 73 25 2b 31 29  |d%-(LinkBits%+1)|
00005710  0d 2b 52 05 cd 0d 2b 5c  0b fd 64 6f 6e 65 31 25  |.+R...+\..done1%|
00005720  0d 2b 66 05 cd 0d 2b 70  05 cd 0d 2b 7a 3c e7 5a  |.+f...+p...+z<.Z|
00005730  6f 6e 65 42 69 74 25 3e  44 65 66 65 63 74 53 74  |oneBit%>DefectSt|
00005740  61 72 74 25 f2 6d 65 73  73 61 67 65 5f 70 72 69  |art%.message_pri|
00005750  6e 74 5f 30 28 22 45 52  52 4f 52 31 22 29 3a f2  |nt_0("ERROR1"):.|
00005760  66 69 6e 69 73 68 0d 2b  84 3b e7 44 65 66 65 63  |finish.+.;.Defec|
00005770  74 53 74 61 72 74 25 2d  5a 6f 6e 65 42 69 74 25  |tStart%-ZoneBit%|
00005780  3c 3d 4c 69 6e 6b 42 69  74 73 25 8c 44 65 66 65  |<=LinkBits%.Defe|
00005790  63 74 53 74 61 72 74 25  3d 5a 6f 6e 65 42 69 74  |ctStart%=ZoneBit|
000057a0  25 0d 2b 8e 1b e7 44 65  66 65 63 74 53 74 61 72  |%.+...DefectStar|
000057b0  74 25 3e 5a 6f 6e 65 42  69 74 25 8c 0d 2b 98 2a  |t%>ZoneBit%..+.*|
000057c0  f2 57 72 69 74 65 4c 69  6e 6b 28 50 72 65 46 72  |.WriteLink(PreFr|
000057d0  65 65 25 2c 5a 6f 6e 65  42 69 74 25 2d 50 72 65  |ee%,ZoneBit%-Pre|
000057e0  46 72 65 65 25 29 0d 2b  a2 23 e7 44 65 66 65 63  |Free%).+.#.Defec|
000057f0  74 53 74 61 72 74 25 3e  3d 55 73 65 64 5a 6f 6e  |tStart%>=UsedZon|
00005800  65 45 6e 64 42 69 74 25  8c 0d 2b ac 33 f2 57 72  |eEndBit%..+.3.Wr|
00005810  69 74 65 4c 65 6e 67 74  68 28 5a 6f 6e 65 42 69  |iteLength(ZoneBi|
00005820  74 25 2c 55 73 65 64 5a  6f 6e 65 45 6e 64 42 69  |t%,UsedZoneEndBi|
00005830  74 25 2d 5a 6f 6e 65 42  69 74 25 29 0d 2b b6 21  |t%-ZoneBit%).+.!|
00005840  e7 5a 6f 6e 65 45 6e 64  42 69 74 25 3e 55 73 65  |.ZoneEndBit%>Use|
00005850  64 5a 6f 6e 65 45 6e 64  42 69 74 25 8c 0d 2b c0  |dZoneEndBit%..+.|
00005860  21 f2 57 72 69 74 65 4c  69 6e 6b 28 55 73 65 64  |!.WriteLink(Used|
00005870  5a 6f 6e 65 45 6e 64 42  69 74 25 2c 31 29 0d 2b  |ZoneEndBit%,1).+|
00005880  ca 3d f2 57 72 69 74 65  4c 65 6e 67 74 68 28 55  |.=.WriteLength(U|
00005890  73 65 64 5a 6f 6e 65 45  6e 64 42 69 74 25 2c 5a  |sedZoneEndBit%,Z|
000058a0  6f 6e 65 45 6e 64 42 69  74 25 2d 55 73 65 64 5a  |oneEndBit%-UsedZ|
000058b0  6f 6e 65 45 6e 64 42 69  74 25 29 0d 2b d4 05 cd  |oneEndBit%).+...|
000058c0  0d 2b de 05 cc 0d 2b e8  30 f2 57 72 69 74 65 4c  |.+....+.0.WriteL|
000058d0  65 6e 67 74 68 28 5a 6f  6e 65 42 69 74 25 2c 44  |ength(ZoneBit%,D|
000058e0  65 66 65 63 74 53 74 61  72 74 25 2d 5a 6f 6e 65  |efectStart%-Zone|
000058f0  42 69 74 25 29 0d 2b f2  05 cd 0d 2b fc 15 50 72  |Bit%).+....+..Pr|
00005900  65 46 72 65 65 25 3d 5a  6f 6e 65 42 69 74 25 0d  |eFree%=ZoneBit%.|
00005910  2c 06 05 cd 0d 2c 10 1e  e7 44 65 66 65 63 74 53  |,....,...DefectS|
00005920  74 61 72 74 25 3c 5a 6f  6e 65 45 6e 64 42 69 74  |tart%<ZoneEndBit|
00005930  25 8c 0d 2c 1a 2e e7 44  65 66 65 63 74 45 6e 64  |%..,...DefectEnd|
00005940  25 3e 55 73 65 64 5a 6f  6e 65 45 6e 64 42 69 74  |%>UsedZoneEndBit|
00005950  25 2d 28 4c 69 6e 6b 42  69 74 73 25 2b 31 29 8c  |%-(LinkBits%+1).|
00005960  0d 2c 24 1a 44 65 66 65  63 74 45 6e 64 25 3d 5a  |.,$.DefectEnd%=Z|
00005970  6f 6e 65 45 6e 64 42 69  74 25 0d 2c 2e 05 cd 0d  |oneEndBit%.,....|
00005980  2c 38 1e f2 57 72 69 74  65 4c 69 6e 6b 28 44 65  |,8..WriteLink(De|
00005990  66 65 63 74 53 74 61 72  74 25 2c 31 29 0d 2c 42  |fectStart%,1).,B|
000059a0  36 f2 57 72 69 74 65 4c  65 6e 67 74 68 28 44 65  |6.WriteLength(De|
000059b0  66 65 63 74 53 74 61 72  74 25 2c 44 65 66 65 63  |fectStart%,Defec|
000059c0  74 45 6e 64 25 2d 44 65  66 65 63 74 53 74 61 72  |tEnd%-DefectStar|
000059d0  74 25 29 0d 2c 4c 17 5a  6f 6e 65 42 69 74 25 3d  |t%).,L.ZoneBit%=|
000059e0  44 65 66 65 63 74 45 6e  64 25 0d 2c 56 05 cc 0d  |DefectEnd%.,V...|
000059f0  2c 60 18 5a 6f 6e 65 42  69 74 25 3d 5a 6f 6e 65  |,`.ZoneBit%=Zone|
00005a00  45 6e 64 42 69 74 25 0d  2c 6a 05 cd 0d 2c 74 19  |EndBit%.,j...,t.|
00005a10  fd 5a 6f 6e 65 42 69 74  25 3d 5a 6f 6e 65 45 6e  |.ZoneBit%=ZoneEn|
00005a20  64 42 69 74 25 0d 2c 7e  1a f2 57 72 69 74 65 4c  |dBit%.,~..WriteL|
00005a30  69 6e 6b 28 50 72 65 46  72 65 65 25 2c 30 29 0d  |ink(PreFree%,0).|
00005a40  2c 88 0d e7 7a 6f 6e 65  25 3d 30 8c 0d 2c 92 1e  |,...zone%=0..,..|
00005a50  5a 6f 6e 65 53 74 61 72  74 25 3f 43 72 6f 73 73  |ZoneStart%?Cross|
00005a60  43 68 65 63 6b 25 3d 26  46 46 0d 2c 9c 05 cc 0d  |Check%=&FF.,....|
00005a70  2c a6 1c 5a 6f 6e 65 53  74 61 72 74 25 3f 43 72  |,..ZoneStart%?Cr|
00005a80  6f 73 73 43 68 65 63 6b  25 3d 30 0d 2c b0 05 cd  |ossCheck%=0.,...|
00005a90  0d 2c ba 31 3f 5a 6f 6e  65 53 74 61 72 74 25 3d  |.,.1?ZoneStart%=|
00005aa0  a4 4e 65 77 4d 61 70 43  68 65 63 6b 28 5a 6f 6e  |.NewMapCheck(Zon|
00005ab0  65 53 74 61 72 74 25 2c  53 65 63 53 69 7a 65 25  |eStart%,SecSize%|
00005ac0  29 0d 2c c4 22 5a 6f 6e  65 53 74 61 72 74 25 3d  |).,."ZoneStart%=|
00005ad0  5a 6f 6e 65 53 74 61 72  74 25 2b 53 65 63 53 69  |ZoneStart%+SecSi|
00005ae0  7a 65 25 0d 2c ce 1d 5a  6f 6e 65 53 74 61 72 74  |ze%.,..ZoneStart|
00005af0  42 69 74 25 3d 5a 6f 6e  65 45 6e 64 42 69 74 25  |Bit%=ZoneEndBit%|
00005b00  0d 2c d8 0a ed 7a 6f 6e  65 25 0d 2c e2 22 f2 6d  |.,...zone%.,.".m|
00005b10  65 73 73 61 67 65 5f 70  72 69 6e 74 5f 30 28 22  |essage_print_0("|
00005b20  57 72 69 74 69 6e 67 4d  61 70 22 29 0d 2c ec 28  |WritingMap").,.(|
00005b30  f2 4d 6f 61 6e 4f 70 28  57 72 69 74 65 25 2c 4d  |.MoanOp(Write%,M|
00005b40  61 70 41 64 64 25 2c 42  75 66 25 2c 4d 61 70 4c  |apAdd%,Buf%,MapL|
00005b50  65 6e 25 29 0d 2c f6 39  f2 4d 6f 61 6e 4f 70 28  |en%).,.9.MoanOp(|
00005b60  57 72 69 74 65 25 2c 4d  61 70 41 64 64 25 2b 4d  |Write%,MapAdd%+M|
00005b70  61 70 4c 65 6e 25 2f 53  65 63 53 69 7a 65 25 2c  |apLen%/SecSize%,|
00005b80  42 75 66 25 2c 4d 61 70  4c 65 6e 25 29 0d 2d 00  |Buf%,MapLen%).-.|
00005b90  11 f2 57 72 69 74 65 52  6f 6f 74 44 69 72 0d 2d  |..WriteRootDir.-|
00005ba0  0a 05 e1 0d 2d 1e 0f dd  f2 43 61 6c 63 5a 6f 6e  |....-....CalcZon|
00005bb0  65 73 0d 2d 28 23 55 73  65 64 42 69 74 73 25 3d  |es.-(#UsedBits%=|
00005bc0  53 65 63 53 69 7a 65 25  2a 38 2d 53 70 61 72 65  |SecSize%*8-Spare|
00005bd0  42 69 74 73 25 0d 2d 32  2f 57 68 6f 6c 65 5a 6f  |Bits%.-2/WholeZo|
00005be0  6e 65 73 25 3d 28 4d 61  70 42 69 74 73 25 2b 5a  |nes%=(MapBits%+Z|
00005bf0  6f 6e 65 30 42 69 74 73  25 29 81 55 73 65 64 42  |one0Bits%).UsedB|
00005c00  69 74 73 25 0d 2d 3c 2c  4f 64 64 42 69 74 73 25  |its%.-<,OddBits%|
00005c10  3d 28 4d 61 70 42 69 74  73 25 2b 5a 6f 6e 65 30  |=(MapBits%+Zone0|
00005c20  42 69 74 73 25 29 83 55  73 65 64 42 69 74 73 25  |Bits%).UsedBits%|
00005c30  0d 2d 46 34 e7 4f 64 64  42 69 74 73 25 5a 6f 6e  |.-F4.OddBits%Zon|
00005c40  65 73 25 3d 57 68 6f 6c  65 5a 6f 6e 65 73 25 2b  |es%=WholeZones%+|
00005c50  31 8b 5a 6f 6e 65 73 25  3d 57 68 6f 6c 65 5a 6f  |1.Zones%=WholeZo|
00005c60  6e 65 73 25 0d 2d 50 15  4d 61 70 5a 6f 6e 65 25  |nes%.-P.MapZone%|
00005c70  3d 5a 6f 6e 65 73 25 81  32 0d 2d 5a 10 e7 4d 61  |=Zones%.2.-Z..Ma|
00005c80  70 5a 6f 6e 65 25 3d 30  8c 0d 2d 64 0d 4d 61 70  |pZone%=0..-d.Map|
00005c90  41 64 64 25 3d 30 0d 2d  6e 05 cc 0d 2d 78 17 e7  |Add%=0.-n...-x..|
00005ca0  28 41 6c 6c 6f 63 25 3e  53 65 63 53 69 7a 65 25  |(Alloc%>SecSize%|
00005cb0  29 8c 0d 2d 82 3d 4d 61  70 41 64 64 25 3d 28 55  |)..-.=MapAdd%=(U|
00005cc0  73 65 64 42 69 74 73 25  2a 4d 61 70 5a 6f 6e 65  |sedBits%*MapZone|
00005cd0  25 2d 5a 6f 6e 65 30 42  69 74 73 25 29 2a 28 41  |%-Zone0Bits%)*(A|
00005ce0  6c 6c 6f 63 25 81 53 65  63 53 69 7a 65 25 29 0d  |lloc%.SecSize%).|
00005cf0  2d 8c 05 cc 0d 2d 96 3d  4d 61 70 41 64 64 25 3d  |-....-.=MapAdd%=|
00005d00  28 55 73 65 64 42 69 74  73 25 2a 4d 61 70 5a 6f  |(UsedBits%*MapZo|
00005d10  6e 65 25 2d 5a 6f 6e 65  30 42 69 74 73 25 29 81  |ne%-Zone0Bits%).|
00005d20  28 53 65 63 53 69 7a 65  25 81 41 6c 6c 6f 63 25  |(SecSize%.Alloc%|
00005d30  29 0d 2d a0 05 cd 0d 2d  aa 05 cd 0d 2d b4 1b 4d  |).-....-....-..M|
00005d40  61 70 4c 65 6e 25 3d 5a  6f 6e 65 73 25 2a 53 65  |apLen%=Zones%*Se|
00005d50  63 53 69 7a 65 25 0d 2d  be 05 e1 0d 2d d2 0d dd  |cSize%.-....-...|
00005d60  f2 43 61 6c 63 49 64 73  0d 2d dc 27 49 64 73 50  |.CalcIds.-.'IdsP|
00005d70  65 72 5a 6f 6e 65 25 3d  55 73 65 64 42 69 74 73  |erZone%=UsedBits|
00005d80  25 81 28 4c 69 6e 6b 42  69 74 73 25 2b 31 29 0d  |%.(LinkBits%+1).|
00005d90  2d e6 37 49 64 73 25 3d  49 64 73 50 65 72 5a 6f  |-.7Ids%=IdsPerZo|
00005da0  6e 65 25 2a 57 68 6f 6c  65 5a 6f 6e 65 73 25 2b  |ne%*WholeZones%+|
00005db0  4f 64 64 42 69 74 73 25  81 28 4c 69 6e 6b 42 69  |OddBits%.(LinkBi|
00005dc0  74 73 25 2b 31 29 0d 2d  f0 05 e1 0d 2e 22 19 dd  |ts%+1).-....."..|
00005dd0  a4 44 69 73 63 54 6f 4d  61 70 28 64 69 73 63 61  |.DiscToMap(disca|
00005de0  64 64 25 29 0d 2e 2c 0f  ea 62 69 74 25 2c 7a 6f  |dd%)..,..bit%,zo|
00005df0  6e 65 25 0d 2e 36 16 e7  28 41 6c 6c 6f 63 25 3e  |ne%..6..(Alloc%>|
00005e00  53 65 63 53 69 7a 65 25  29 0d 2e 40 30 62 69 74  |SecSize%)..@0bit|
00005e10  25 3d 28 64 69 73 63 61  64 64 25 81 28 41 6c 6c  |%=(discadd%.(All|
00005e20  6f 63 25 81 53 65 63 53  69 7a 65 25 29 29 2b 5a  |oc%.SecSize%))+Z|
00005e30  6f 6e 65 30 42 69 74 73  25 0d 2e 4a 05 cc 0d 2e  |one0Bits%..J....|
00005e40  54 30 62 69 74 25 3d 28  64 69 73 63 61 64 64 25  |T0bit%=(discadd%|
00005e50  2a 28 53 65 63 53 69 7a  65 25 81 41 6c 6c 6f 63  |*(SecSize%.Alloc|
00005e60  25 29 29 2b 5a 6f 6e 65  30 42 69 74 73 25 0d 2e  |%))+Zone0Bits%..|
00005e70  5e 05 cd 0d 2e 68 18 7a  6f 6e 65 25 3d 62 69 74  |^....h.zone%=bit|
00005e80  25 81 55 73 65 64 42 69  74 73 25 0d 2e 72 2d 62  |%.UsedBits%..r-b|
00005e90  69 74 25 3d 62 69 74 25  2b 28 62 69 74 25 81 55  |it%=bit%+(bit%.U|
00005ea0  73 65 64 42 69 74 73 25  29 2a 53 70 61 72 65 42  |sedBits%)*SpareB|
00005eb0  69 74 73 25 2b 34 2a 38  0d 2e 7c 09 3d 62 69 74  |its%+4*8..|.=bit|
00005ec0  25 0d 2e 9a 1b dd f2 57  72 69 74 65 4c 69 6e 6b  |%......WriteLink|
00005ed0  28 6f 66 66 25 2c 6c 69  6e 6b 25 29 0d 2e a4 39  |(off%,link%)...9|
00005ee0  e7 6c 69 6e 6b 25 3e 3d  32 5e 4c 69 6e 6b 42 69  |.link%>=2^LinkBi|
00005ef0  74 73 25 f2 6d 65 73 73  61 67 65 5f 70 72 69 6e  |ts%.message_prin|
00005f00  74 5f 30 28 22 45 52 52  4f 52 32 22 29 3a f2 66  |t_0("ERROR2"):.f|
00005f10  69 6e 69 73 68 0d 2e ae  14 ea 62 69 74 25 2c 61  |inish.....bit%,a|
00005f20  64 64 25 2c 6d 61 73 6b  25 0d 2e b8 0f 62 69 74  |dd%,mask%....bit|
00005f30  25 3d 6f 66 66 25 83 38  0d 2e c2 14 61 64 64 25  |%=off%.8....add%|
00005f40  3d 42 75 66 25 2b 6f 66  66 25 81 38 0d 2e cc 17  |=Buf%+off%.8....|
00005f50  6d 61 73 6b 25 3d 32 5e  4c 69 6e 6b 42 69 74 73  |mask%=2^LinkBits|
00005f60  25 2d 31 0d 2e d6 2c 21  61 64 64 25 3d 28 21 61  |%-1...,!add%=(!a|
00005f70  64 64 25 80 ac 28 6d 61  73 6b 25 3c 3c 62 69 74  |dd%..(mask%<<bit|
00005f80  25 29 29 84 6c 69 6e 6b  25 3c 3c 62 69 74 25 0d  |%)).link%<<bit%.|
00005f90  2e e0 05 e1 0d 2e f4 1c  dd f2 57 72 69 74 65 4c  |..........WriteL|
00005fa0  65 6e 67 74 68 28 6f 66  66 25 2c 6c 65 6e 25 29  |ength(off%,len%)|
00005fb0  0d 2e fe 36 e7 6c 65 6e  25 3c 3d 4c 69 6e 6b 42  |...6.len%<=LinkB|
00005fc0  69 74 73 25 f2 6d 65 73  73 61 67 65 5f 70 72 69  |its%.message_pri|
00005fd0  6e 74 5f 30 28 22 45 52  52 4f 52 33 22 29 3a f2  |nt_0("ERROR3"):.|
00005fe0  66 69 6e 69 73 68 0d 2f  08 14 6f 66 66 25 3d 6f  |finish./..off%=o|
00005ff0  66 66 25 2b 6c 65 6e 25  2d 31 0d 2f 12 1d 42 75  |ff%+len%-1./..Bu|
00006000  66 25 3f 28 6f 66 66 25  81 38 29 2b 3d 32 5e 28  |f%?(off%.8)+=2^(|
00006010  6f 66 66 25 83 38 29 0d  2f 1c 05 e1 0d 2f 30 15  |off%.8)./..../0.|
00006020  dd f2 57 72 69 74 65 44  65 66 65 63 74 4c 69 73  |..WriteDefectLis|
00006030  74 0d 2f 3a 26 f2 6d 65  73 73 61 67 65 5f 70 72  |t./:&.message_pr|
00006040  69 6e 74 5f 30 28 22 57  72 69 74 69 6e 67 44 65  |int_0("WritingDe|
00006050  66 65 63 74 73 22 29 0d  2f 44 0a 70 74 72 25 3d  |fects")./D.ptr%=|
00006060  30 0d 2f 4e 0c 63 68 65  63 6b 25 3d 30 0d 2f 58  |0./N.check%=0./X|
00006070  1d c8 95 44 65 66 65 63  74 25 21 70 74 72 25 3c  |...Defect%!ptr%<|
00006080  45 6e 64 44 65 66 65 63  74 25 0d 2f 62 1b 42 6f  |EndDefect%./b.Bo|
00006090  6f 74 25 21 70 74 72 25  3d 44 65 66 65 63 74 25  |ot%!ptr%=Defect%|
000060a0  21 70 74 72 25 0d 2f 6c  19 f2 43 68 65 63 6b 50  |!ptr%./l..CheckP|
000060b0  75 74 28 42 6f 6f 74 25  21 70 74 72 25 29 0d 2f  |ut(Boot%!ptr%)./|
000060c0  76 0f 70 74 72 25 3d 70  74 72 25 2b 34 0d 2f 80  |v.ptr%=ptr%+4./.|
000060d0  05 ce 0d 2f 8a 1f 63 68  65 63 6b 25 3d 63 68 65  |.../..check%=che|
000060e0  63 6b 25 82 28 63 68 65  63 6b 25 3e 3e 3e 31 36  |ck%.(check%>>>16|
000060f0  29 0d 2f 94 24 63 68 65  63 6b 25 3d 28 63 68 65  |)./.$check%=(che|
00006100  63 6b 25 82 28 63 68 65  63 6b 25 3e 3e 3e 38 29  |ck%.(check%>>>8)|
00006110  29 80 26 46 46 0d 2f 9e  20 42 6f 6f 74 25 21 70  |).&FF./. Boot%!p|
00006120  74 72 25 3d 45 6e 64 44  65 66 65 63 74 25 84 63  |tr%=EndDefect%.c|
00006130  68 65 63 6b 25 0d 2f bc  0e e7 42 69 67 44 69 73  |heck%./...BigDis|
00006140  63 25 8c 0d 2f c6 0b 70  74 72 25 2b 3d 34 0d 2f  |c%../..ptr%+=4./|
00006150  d0 0c 63 68 65 63 6b 25  3d 30 0d 2f da 1d c8 95  |..check%=0./....|
00006160  44 65 66 65 63 74 25 21  70 74 72 25 3c 45 6e 64  |Defect%!ptr%<End|
00006170  44 65 66 65 63 74 25 0d  2f e4 1b 42 6f 6f 74 25  |Defect%./..Boot%|
00006180  21 70 74 72 25 3d 44 65  66 65 63 74 25 21 70 74  |!ptr%=Defect%!pt|
00006190  72 25 0d 2f ee 19 f2 43  68 65 63 6b 50 75 74 28  |r%./...CheckPut(|
000061a0  42 6f 6f 74 25 21 70 74  72 25 29 0d 2f f8 0f 70  |Boot%!ptr%)./..p|
000061b0  74 72 25 3d 70 74 72 25  2b 34 0d 30 02 05 ce 0d  |tr%=ptr%+4.0....|
000061c0  30 0c 1f 63 68 65 63 6b  25 3d 63 68 65 63 6b 25  |0..check%=check%|
000061d0  82 28 63 68 65 63 6b 25  3e 3e 3e 31 36 29 0d 30  |.(check%>>>16).0|
000061e0  16 24 63 68 65 63 6b 25  3d 28 63 68 65 63 6b 25  |.$check%=(check%|
000061f0  82 28 63 68 65 63 6b 25  3e 3e 3e 38 29 29 80 26  |.(check%>>>8)).&|
00006200  46 46 0d 30 20 21 42 6f  6f 74 25 21 70 74 72 25  |FF.0 !Boot%!ptr%|
00006210  3d 45 6e 64 44 65 66 65  63 74 32 25 84 63 68 65  |=EndDefect2%.che|
00006220  63 6b 25 0d 30 2a 05 cd  0d 30 48 1a c8 95 70 74  |ck%.0*...0H...pt|
00006230  72 25 3c 28 4d 61 78 44  65 66 65 63 74 73 25 2a  |r%<(MaxDefects%*|
00006240  34 29 0d 30 52 0f 70 74  72 25 3d 70 74 72 25 2b  |4).0R.ptr%=ptr%+|
00006250  34 0d 30 5c 10 42 6f 6f  74 25 21 70 74 72 25 3d  |4.0\.Boot%!ptr%=|
00006260  30 0d 30 66 05 ce 0d 30  70 19 f2 53 75 6d 28 42  |0.0f...0p..Sum(B|
00006270  6f 6f 74 25 2c 42 6f 6f  74 53 69 7a 65 25 29 0d  |oot%,BootSize%).|
00006280  30 7a 2c f2 4d 6f 61 6e  4f 70 28 57 72 69 74 65  |0z,.MoanOp(Write|
00006290  25 2c 42 6f 6f 74 41 64  64 25 2c 42 6f 6f 74 25  |%,BootAdd%,Boot%|
000062a0  2c 42 6f 6f 74 53 69 7a  65 25 29 0d 30 84 05 e1  |,BootSize%).0...|
000062b0  0d 30 98 13 dd f2 57 72  69 74 65 4f 6c 64 46 73  |.0....WriteOldFs|
000062c0  4d 61 70 0d 30 a2 28 f2  6d 65 73 73 61 67 65 5f  |Map.0.(.message_|
000062d0  70 72 69 6e 74 5f 30 28  22 57 72 69 74 69 6e 67  |print_0("Writing|
000062e0  46 72 65 65 53 70 61 63  65 22 29 0d 30 ac 0a ea  |FreeSpace").0...|
000062f0  73 25 2c 49 25 0d 30 b6  14 73 25 3d 4f 6c 64 4d  |s%,I%.0..s%=OldM|
00006300  61 70 53 69 7a 65 25 81  32 0d 30 c0 25 e3 49 25  |apSize%.2.0.%.I%|
00006310  3d 30 b8 4f 6c 64 4d 61  70 53 69 7a 65 25 2d 34  |=0.OldMapSize%-4|
00006320  88 34 3a 42 75 66 25 21  49 25 3d 30 3a ed 0d 30  |.4:Buf%!I%=0:..0|
00006330  ca 16 21 42 75 66 25 3d  4f 6c 64 4c 57 4d 25 81  |..!Buf%=OldLWM%.|
00006340  26 31 30 30 0d 30 d4 36  42 75 66 25 21 73 25 3d  |&100.0.6Buf%!s%=|
00006350  28 44 69 73 63 53 69 7a  65 25 2d 4f 6c 64 4c 57  |(DiscSize%-OldLW|
00006360  4d 25 2d 44 65 66 65 63  74 73 25 2a 53 65 63 53  |M%-Defects%*SecS|
00006370  69 7a 65 25 29 81 26 31  30 30 0d 30 de 1f 21 28  |ize%).&100.0..!(|
00006380  42 75 66 25 2b 73 25 2d  34 29 3d 44 69 73 63 53  |Buf%+s%-4)=DiscS|
00006390  69 7a 65 25 81 26 31 30  30 0d 30 e8 25 21 28 42  |ize%.&100.0.%!(B|
000063a0  75 66 25 2b 4f 6c 64 4d  61 70 53 69 7a 65 25 2d  |uf%+OldMapSize%-|
000063b0  35 29 3d b3 28 26 31 30  30 30 30 29 2d 31 0d 30  |5)=.(&10000)-1.0|
000063c0  f2 1b 21 28 42 75 66 25  2b 4f 6c 64 4d 61 70 53  |..!(Buf%+OldMapS|
000063d0  69 7a 65 25 2d 32 29 3d  33 0d 30 fc 11 f2 53 75  |ize%-2)=3.0...Su|
000063e0  6d 28 42 75 66 25 2c 73  25 29 0d 31 06 14 f2 53  |m(Buf%,s%).1...S|
000063f0  75 6d 28 42 75 66 25 2b  73 25 2c 73 25 29 0d 31  |um(Buf%+s%,s%).1|
00006400  10 30 f2 4d 6f 61 6e 4f  70 28 57 72 69 74 65 25  |.0.MoanOp(Write%|
00006410  2c 4f 6c 64 4d 61 70 41  64 64 25 70 2c 42 75 66  |,OldMapAdd%p,Buf|
00006420  25 2c 4f 6c 64 4d 61 70  53 69 7a 65 25 29 0d 31  |%,OldMapSize%).1|
00006430  1a 05 e1 0d 31 2e 12 dd  f2 57 72 69 74 65 52 6f  |....1....WriteRo|
00006440  6f 74 44 69 72 0d 31 38  26 f2 6d 65 73 73 61 67  |otDir.18&.messag|
00006450  65 5f 70 72 69 6e 74 5f  30 28 22 57 72 69 74 69  |e_print_0("Writi|
00006460  6e 67 52 6f 6f 74 44 69  72 22 29 0d 31 42 08 ea  |ngRootDir").1B..|
00006470  42 46 25 0d 31 4c 22 e3  49 25 3d 30 b8 44 69 72  |BF%.1L".I%=0.Dir|
00006480  53 69 7a 65 25 2d 34 88  34 3a 42 75 66 25 21 49  |Size%-4.4:Buf%!I|
00006490  25 3d 30 3a ed 0d 31 56  0d e7 4e 65 77 4d 61 70  |%=0:..1V..NewMap|
000064a0  25 8c 0d 31 60 14 24 44  69 72 4d 61 72 6b 25 3d  |%..1`.$DirMark%=|
000064b0  22 48 75 67 6f 22 0d 31  6a 05 cc 0d 31 74 14 24  |"Hugo".1j...1t.$|
000064c0  44 69 72 4d 61 72 6b 25  3d 22 48 75 67 6f 22 0d  |DirMark%="Hugo".|
000064d0  31 7e 05 cd 0d 31 88 14  42 75 66 25 21 31 3d 21  |1~...1..Buf%!1=!|
000064e0  44 69 72 4d 61 72 6b 25  0d 31 92 15 42 46 25 3d  |DirMark%.1..BF%=|
000064f0  42 75 66 25 2b 44 69 72  53 69 7a 65 25 0d 31 9c  |Buf%+DirSize%.1.|
00006500  0d e7 4e 65 77 4d 61 70  25 8c 0d 31 a6 1a 42 46  |..NewMap%..1..BF|
00006510  25 21 2d 33 38 3d 49 6e  64 52 6f 6f 74 44 69 72  |%!-38=IndRootDir|
00006520  41 64 64 25 0d 31 b0 05  cc 0d 31 ba 1f 42 46 25  |Add%.1....1..BF%|
00006530  21 2d 33 38 3d 49 6e 64  52 6f 6f 74 44 69 72 41  |!-38=IndRootDirA|
00006540  64 64 25 81 26 31 30 30  0d 31 c4 05 cd 0d 31 ce  |dd%.&100.1....1.|
00006550  10 42 46 25 3f 2d 33 35  3d 97 22 24 22 0d 31 d8  |.BF%?-35=."$".1.|
00006560  10 42 46 25 3f 2d 31 36  3d 97 22 24 22 0d 31 e2  |.BF%?-16=."$".1.|
00006570  14 42 46 25 21 2d 35 3d  21 44 69 72 4d 61 72 6b  |.BF%!-5=!DirMark|
00006580  25 0d 31 ec 0c 63 68 65  63 6b 25 3d 30 0d 31 f6  |%.1..check%=0.1.|
00006590  14 f2 43 68 65 63 6b 50  75 74 28 21 42 75 66 25  |..CheckPut(!Buf%|
000065a0  29 0d 32 00 15 f2 43 68  65 63 6b 50 75 74 28 42  |).2...CheckPut(B|
000065b0  75 66 25 3f 34 29 0d 32  0a 0d 49 25 3d 42 46 25  |uf%?4).2..I%=BF%|
000065c0  2d 34 30 0d 32 14 0a c8  95 49 25 80 33 0d 32 1e  |-40.2....I%.3.2.|
000065d0  12 f2 43 68 65 63 6b 50  75 74 28 3f 49 25 29 0d  |..CheckPut(?I%).|
000065e0  32 28 0b 49 25 3d 49 25  2b 31 0d 32 32 05 ce 0d  |2(.I%=I%+1.22...|
000065f0  32 3c 0e c8 95 49 25 3c  42 46 25 2d 34 0d 32 46  |2<...I%<BF%-4.2F|
00006600  12 f2 43 68 65 63 6b 50  75 74 28 21 49 25 29 0d  |..CheckPut(!I%).|
00006610  32 50 0b 49 25 3d 49 25  2b 34 0d 32 5a 05 ce 0d  |2P.I%=I%+4.2Z...|
00006620  32 64 1f 63 68 65 63 6b  25 3d 63 68 65 63 6b 25  |2d.check%=check%|
00006630  82 28 63 68 65 63 6b 25  3e 3e 3e 31 36 29 0d 32  |.(check%>>>16).2|
00006640  6e 24 63 68 65 63 6b 25  3d 28 63 68 65 63 6b 25  |n$check%=(check%|
00006650  82 28 63 68 65 63 6b 25  3e 3e 3e 38 29 29 80 26  |.(check%>>>8)).&|
00006660  46 46 0d 32 78 11 42 46  25 3f 2d 31 3d 63 68 65  |FF.2x.BF%?-1=che|
00006670  63 6b 25 0d 32 82 2d f2  4d 6f 61 6e 4f 70 28 57  |ck%.2.-.MoanOp(W|
00006680  72 69 74 65 25 2c 52 6f  6f 74 44 69 72 41 64 64  |rite%,RootDirAdd|
00006690  25 2c 42 75 66 25 2c 44  69 72 53 69 7a 65 25 29  |%,Buf%,DirSize%)|
000066a0  0d 32 8c 05 e1 0d 32 a0  15 dd a4 4c 6f 67 54 6f  |.2....2....LogTo|
000066b0  50 68 79 73 28 61 64 64  25 29 0d 32 aa 09 ea 70  |Phys(add%).2...p|
000066c0  74 72 25 0d 32 b4 0a 70  74 72 25 3d 30 0d 32 be  |tr%.2..ptr%=0.2.|
000066d0  23 c8 95 61 64 64 25 3e  3d 28 44 65 66 65 63 74  |#..add%>=(Defect|
000066e0  25 21 70 74 72 25 29 81  53 65 63 53 69 7a 65 25  |%!ptr%).SecSize%|
000066f0  0d 32 c8 0f 70 74 72 25  3d 70 74 72 25 2b 34 0d  |.2..ptr%=ptr%+4.|
00006700  32 d2 16 61 64 64 25 3d  61 64 64 25 2b 53 65 63  |2..add%=add%+Sec|
00006710  53 69 7a 65 25 0d 32 dc  05 ce 0d 32 e6 09 3d 61  |Size%.2....2..=a|
00006720  64 64 25 0d 33 22 19 dd  f2 41 64 64 50 68 79 73  |dd%.3"...AddPhys|
00006730  44 65 66 65 63 74 28 61  64 64 25 29 0d 33 2c 23  |Defect(add%).3,#|
00006740  ea 70 74 72 25 2c 70 74  72 32 25 2c 64 65 66 65  |.ptr%,ptr2%,defe|
00006750  63 74 25 2c 64 65 66 65  63 74 6c 69 73 74 25 0d  |ct%,defectlist%.|
00006760  33 40 1d e7 28 61 64 64  25 3e 3d 53 65 63 74 6f  |3@..(add%>=Secto|
00006770  72 73 50 65 72 44 69 73  63 25 29 8c 0d 33 4a 24  |rsPerDisc%)..3J$|
00006780  f2 6d 65 73 73 61 67 65  5f 70 72 69 6e 74 5f 30  |.message_print_0|
00006790  28 22 44 65 66 65 63 74  54 6f 6f 42 69 67 22 29  |("DefectTooBig")|
000067a0  0d 33 54 05 cc 0d 33 5e  0f e7 ac 42 69 67 44 69  |.3T...3^...BigDi|
000067b0  73 63 25 8c 0d 33 72 1a  e7 44 65 66 65 63 74 73  |sc%..3r..Defects|
000067c0  25 3c 4d 61 78 44 65 66  65 63 74 73 25 8c 0d 33  |%<MaxDefects%..3|
000067d0  7c 24 c8 95 28 28 44 65  66 65 63 74 25 21 70 74  ||$..((Defect%!pt|
000067e0  72 25 29 81 53 65 63 53  69 7a 65 25 29 3c 61 64  |r%).SecSize%)<ad|
000067f0  64 25 0d 33 86 0f 70 74  72 25 3d 70 74 72 25 2b  |d%.3..ptr%=ptr%+|
00006800  34 0d 33 90 05 ce 0d 33  9a 23 64 65 66 65 63 74  |4.3....3.#defect|
00006810  25 3d 28 44 65 66 65 63  74 25 21 70 74 72 25 29  |%=(Defect%!ptr%)|
00006820  2f 53 65 63 53 69 7a 65  25 0d 33 a4 12 e7 64 65  |/SecSize%.3...de|
00006830  66 65 63 74 25 3d 61 64  64 25 8c 0d 33 ae 26 f2  |fect%=add%..3.&.|
00006840  6d 65 73 73 61 67 65 5f  70 72 69 6e 74 5f 30 28  |message_print_0(|
00006850  22 45 78 69 73 74 69 6e  67 44 65 66 65 63 74 22  |"ExistingDefect"|
00006860  29 0d 33 b8 05 cc 0d 33  c2 14 70 74 72 32 25 3d  |).3....3..ptr2%=|
00006870  44 65 66 65 63 74 73 25  2a 34 0d 33 cc 11 c8 95  |Defects%*4.3....|
00006880  70 74 72 32 25 3e 3d 70  74 72 25 0d 33 d6 23 44  |ptr2%>=ptr%.3.#D|
00006890  65 66 65 63 74 25 21 28  70 74 72 32 25 2b 34 29  |efect%!(ptr2%+4)|
000068a0  3d 44 65 66 65 63 74 25  21 70 74 72 32 25 0d 33  |=Defect%!ptr2%.3|
000068b0  e0 11 70 74 72 32 25 3d  70 74 72 32 25 2d 34 0d  |..ptr2%=ptr2%-4.|
000068c0  33 ea 05 ce 0d 33 f4 1e  44 65 66 65 63 74 25 21  |3....3..Defect%!|
000068d0  70 74 72 25 3d 61 64 64  25 2a 53 65 63 53 69 7a  |ptr%=add%*SecSiz|
000068e0  65 25 0d 33 fe 17 44 65  66 65 63 74 73 25 3d 44  |e%.3..Defects%=D|
000068f0  65 66 65 63 74 73 25 2b  31 0d 34 08 05 cd 0d 34  |efects%+1.4....4|
00006900  12 05 cc 0d 34 1c 26 f2  6d 65 73 73 61 67 65 5f  |....4.&.message_|
00006910  70 72 69 6e 74 5f 30 28  22 46 75 6c 6c 44 65 66  |print_0("FullDef|
00006920  65 63 74 4c 69 73 74 22  29 0d 34 26 05 cd 0d 34  |ectList").4&...4|
00006930  30 05 cc 0d 34 44 1d e7  44 65 66 65 63 74 73 25  |0...4D..Defects%|
00006940  3c 42 69 67 4d 61 78 44  65 66 65 63 74 73 25 8c  |<BigMaxDefects%.|
00006950  0d 34 4e 40 e7 28 28 61  64 64 25 2a 53 65 63 53  |.4N@.((add%*SecS|
00006960  69 7a 65 25 29 80 26 45  30 30 30 30 30 30 30 29  |ize%).&E0000000)|
00006970  3d 30 80 28 61 64 64 25  3e 3e 3e 28 33 32 2d 4c  |=0.(add%>>>(32-L|
00006980  6f 67 32 53 65 63 53 69  7a 65 25 29 29 3d 30 8c  |og2SecSize%))=0.|
00006990  0d 34 62 11 64 65 66 65  63 74 6c 69 73 74 25 3d  |.4b.defectlist%=|
000069a0  30 0d 34 6c 05 cc 0d 34  80 11 64 65 66 65 63 74  |0.4l...4..defect|
000069b0  6c 69 73 74 25 3d 31 0d  34 8a 1f c8 95 28 44 65  |list%=1.4....(De|
000069c0  66 65 63 74 25 21 70 74  72 25 3c 45 6e 64 44 65  |fect%!ptr%<EndDe|
000069d0  66 65 63 74 25 29 0d 34  94 0b 70 74 72 25 2b 3d  |fect%).4..ptr%+=|
000069e0  34 0d 34 9e 05 ce 0d 34  a8 0b 70 74 72 25 2b 3d  |4.4....4..ptr%+=|
000069f0  34 0d 34 b2 05 cd 0d 34  bc 13 e7 64 65 66 65 63  |4.4....4...defec|
00006a00  74 6c 69 73 74 25 3d 31  8c 0d 34 c6 19 c8 95 28  |tlist%=1..4....(|
00006a10  44 65 66 65 63 74 25 21  70 74 72 25 29 3c 61 64  |Defect%!ptr%)<ad|
00006a20  64 25 0d 34 d0 0b 70 74  72 25 2b 3d 34 0d 34 da  |d%.4..ptr%+=4.4.|
00006a30  05 ce 0d 34 e4 05 cc 0d  34 ee 24 c8 95 28 28 44  |...4....4.$..((D|
00006a40  65 66 65 63 74 25 21 70  74 72 25 29 2f 53 65 63  |efect%!ptr%)/Sec|
00006a50  53 69 7a 65 25 29 3c 61  64 64 25 0d 34 f8 0b 70  |Size%)<add%.4..p|
00006a60  74 72 25 2b 3d 34 0d 35  02 05 ce 0d 35 0c 05 cd  |tr%+=4.5....5...|
00006a70  0d 35 16 13 e7 64 65 66  65 63 74 6c 69 73 74 25  |.5...defectlist%|
00006a80  3d 30 8c 0d 35 20 23 64  65 66 65 63 74 25 3d 28  |=0..5 #defect%=(|
00006a90  44 65 66 65 63 74 25 21  70 74 72 25 29 2f 53 65  |Defect%!ptr%)/Se|
00006aa0  63 53 69 7a 65 25 0d 35  2a 05 cc 0d 35 34 1a 64  |cSize%.5*...54.d|
00006ab0  65 66 65 63 74 25 3d 28  44 65 66 65 63 74 25 21  |efect%=(Defect%!|
00006ac0  70 74 72 25 29 0d 35 3e  05 cd 0d 35 48 12 e7 64  |ptr%).5>...5H..d|
00006ad0  65 66 65 63 74 25 3d 61  64 64 25 8c 0d 35 52 26  |efect%=add%..5R&|
00006ae0  f2 6d 65 73 73 61 67 65  5f 70 72 69 6e 74 5f 30  |.message_print_0|
00006af0  28 22 45 78 69 73 74 69  6e 67 44 65 66 65 63 74  |("ExistingDefect|
00006b00  22 29 0d 35 5c 05 cc 0d  35 66 16 70 74 72 32 25  |").5\...5f.ptr2%|
00006b10  3d 44 65 66 65 63 74 73  25 2a 34 2b 34 0d 35 70  |=Defects%*4+4.5p|
00006b20  11 c8 95 70 74 72 32 25  3e 3d 70 74 72 25 0d 35  |...ptr2%>=ptr%.5|
00006b30  7a 23 44 65 66 65 63 74  25 21 28 70 74 72 32 25  |z#Defect%!(ptr2%|
00006b40  2b 34 29 3d 44 65 66 65  63 74 25 21 70 74 72 32  |+4)=Defect%!ptr2|
00006b50  25 0d 35 84 11 70 74 72  32 25 3d 70 74 72 32 25  |%.5..ptr2%=ptr2%|
00006b60  2d 34 0d 35 8e 05 ce 0d  35 98 13 e7 64 65 66 65  |-4.5....5...defe|
00006b70  63 74 6c 69 73 74 25 3d  30 8c 0d 35 a2 1e 44 65  |ctlist%=0..5..De|
00006b80  66 65 63 74 25 21 70 74  72 25 3d 61 64 64 25 2a  |fect%!ptr%=add%*|
00006b90  53 65 63 53 69 7a 65 25  0d 35 ac 05 cc 0d 35 b6  |SecSize%.5....5.|
00006ba0  15 44 65 66 65 63 74 25  21 70 74 72 25 3d 61 64  |.Defect%!ptr%=ad|
00006bb0  64 25 0d 35 c0 05 cd 0d  35 ca 17 44 65 66 65 63  |d%.5....5..Defec|
00006bc0  74 73 25 3d 44 65 66 65  63 74 73 25 2b 31 0d 35  |ts%=Defects%+1.5|
00006bd0  d4 05 cd 0d 35 de 05 cc  0d 35 e8 26 f2 6d 65 73  |....5....5.&.mes|
00006be0  73 61 67 65 5f 70 72 69  6e 74 5f 30 28 22 46 75  |sage_print_0("Fu|
00006bf0  6c 6c 44 65 66 65 63 74  4c 69 73 74 22 29 0d 35  |llDefectList").5|
00006c00  f2 05 cd 0d 35 fc 05 cd  0d 36 06 05 cd 0d 36 10  |....5....6....6.|
00006c10  05 e1 0d 36 2e 1c dd f2  52 65 6d 6f 76 65 50 68  |...6....RemovePh|
00006c20  79 73 44 65 66 65 63 74  28 61 64 64 25 29 0d 36  |ysDefect(add%).6|
00006c30  38 23 ea 70 74 72 25 2c  70 74 72 32 25 2c 64 65  |8#.ptr%,ptr2%,de|
00006c40  66 65 63 74 25 2c 64 65  66 65 63 74 6c 69 73 74  |fect%,defectlist|
00006c50  25 0d 36 42 0a 70 74 72  25 3d 30 0d 36 4c 11 64  |%.6B.ptr%=0.6L.d|
00006c60  65 66 65 63 74 6c 69 73  74 25 3d 31 0d 36 56 3e  |efectlist%=1.6V>|
00006c70  c8 95 28 28 44 65 66 65  63 74 25 21 70 74 72 25  |..((Defect%!ptr%|
00006c80  29 2f 53 65 63 53 69 7a  65 25 29 3c 61 64 64 25  |)/SecSize%)<add%|
00006c90  80 28 44 65 66 65 63 74  25 21 70 74 72 25 3c 45  |.(Defect%!ptr%<E|
00006ca0  6e 64 44 65 66 65 63 74  25 29 0d 36 60 0f 70 74  |ndDefect%).6`.pt|
00006cb0  72 25 3d 70 74 72 25 2b  34 0d 36 6a 05 ce 0d 36  |r%=ptr%+4.6j...6|
00006cc0  74 1e e7 44 65 66 65 63  74 25 21 70 74 72 25 3e  |t..Defect%!ptr%>|
00006cd0  3d 45 6e 64 44 65 66 65  63 74 25 8c 0d 36 7e 11  |=EndDefect%..6~.|
00006ce0  64 65 66 65 63 74 6c 69  73 74 25 3d 32 0d 36 88  |defectlist%=2.6.|
00006cf0  0b 70 74 72 25 2b 3d 34  0d 36 92 33 c8 95 28 44  |.ptr%+=4.6.3..(D|
00006d00  65 66 65 63 74 25 21 70  74 72 25 29 3c 61 64 64  |efect%!ptr%)<add|
00006d10  25 80 28 44 65 66 65 63  74 25 21 70 74 72 25 29  |%.(Defect%!ptr%)|
00006d20  3c 45 6e 64 44 65 66 65  63 74 25 0d 36 9c 0f 70  |<EndDefect%.6..p|
00006d30  74 72 25 3d 70 74 72 25  2b 34 0d 36 a6 05 ce 0d  |tr%=ptr%+4.6....|
00006d40  36 b0 05 cd 0d 36 ba 13  e7 64 65 66 65 63 74 6c  |6....6...defectl|
00006d50  69 73 74 25 3d 31 8c 0d  36 c4 23 64 65 66 65 63  |ist%=1..6.#defec|
00006d60  74 25 3d 28 44 65 66 65  63 74 25 21 70 74 72 25  |t%=(Defect%!ptr%|
00006d70  29 2f 53 65 63 53 69 7a  65 25 0d 36 ce 05 cc 0d  |)/SecSize%.6....|
00006d80  36 d8 18 64 65 66 65 63  74 25 3d 44 65 66 65 63  |6..defect%=Defec|
00006d90  74 25 21 70 74 72 25 0d  36 e2 05 cd 0d 36 ec 12  |t%!ptr%.6....6..|
00006da0  e7 64 65 66 65 63 74 25  3d 61 64 64 25 8c 0d 36  |.defect%=add%..6|
00006db0  f6 0e e7 42 69 67 44 69  73 63 25 8c 0d 37 00 19  |...BigDisc%..7..|
00006dc0  c8 95 70 74 72 25 3c 28  44 65 66 65 63 74 73 25  |..ptr%<(Defects%|
00006dd0  2a 34 2b 34 29 0d 37 0a  21 44 65 66 65 63 74 25  |*4+4).7.!Defect%|
00006de0  21 70 74 72 25 3d 44 65  66 65 63 74 25 21 28 70  |!ptr%=Defect%!(p|
00006df0  74 72 25 2b 34 29 0d 37  14 0f 70 74 72 25 3d 70  |tr%+4).7..ptr%=p|
00006e00  74 72 25 2b 34 0d 37 1e  05 ce 0d 37 28 17 44 65  |tr%+4.7....7(.De|
00006e10  66 65 63 74 73 25 3d 44  65 66 65 63 74 73 25 2d  |fects%=Defects%-|
00006e20  31 0d 37 32 05 cc 0d 37  3c 15 c8 95 70 74 72 25  |1.72...7<...ptr%|
00006e30  3c 44 65 66 65 63 74 73  25 2a 34 0d 37 46 21 44  |<Defects%*4.7F!D|
00006e40  65 66 65 63 74 25 21 70  74 72 25 3d 44 65 66 65  |efect%!ptr%=Defe|
00006e50  63 74 25 21 28 70 74 72  25 2b 34 29 0d 37 50 0f  |ct%!(ptr%+4).7P.|
00006e60  70 74 72 25 3d 70 74 72  25 2b 34 0d 37 5a 05 ce  |ptr%=ptr%+4.7Z..|
00006e70  0d 37 64 17 44 65 66 65  63 74 73 25 3d 44 65 66  |.7d.Defects%=Def|
00006e80  65 63 74 73 25 2d 31 0d  37 6e 05 cd 0d 37 78 17  |ects%-1.7n...7x.|
00006e90  44 65 66 65 63 74 73 25  3d 44 65 66 65 63 74 73  |Defects%=Defects|
00006ea0  25 2d 31 0d 37 82 05 cc  0d 37 8c 25 f2 6d 65 73  |%-1.7....7.%.mes|
00006eb0  73 61 67 65 5f 70 72 69  6e 74 5f 30 28 22 4d 69  |sage_print_0("Mi|
00006ec0  73 73 69 6e 67 44 65 66  65 63 74 22 29 0d 37 96  |ssingDefect").7.|
00006ed0  05 cd 0d 37 a0 05 e1 0d  37 dc 17 dd a4 47 6f 6f  |...7....7....Goo|
00006ee0  64 4f 6c 64 44 65 66 65  63 74 4c 69 73 74 0d 37  |dOldDefectList.7|
00006ef0  e6 0b 70 74 72 25 3d 2d  34 0d 37 f0 0c 63 68 65  |..ptr%=-4.7..che|
00006f00  63 6b 25 3d 30 0d 37 fa  0c 6c 61 73 74 25 3d 2d  |ck%=0.7..last%=-|
00006f10  31 0d 38 04 0b 67 6f 6f  64 25 3d b9 0d 38 0e 05  |1.8..good%=..8..|
00006f20  f5 0d 38 18 0f 70 74 72  25 3d 70 74 72 25 2b 34  |..8..ptr%=ptr%+4|
00006f30  0d 38 22 16 64 65 66 65  63 74 25 3d 42 6f 6f 74  |.8".defect%=Boot|
00006f40  25 21 70 74 72 25 0d 38  2c 1a e7 64 65 66 65 63  |%!ptr%.8,..defec|
00006f50  74 25 3c 3d 6c 61 73 74  25 67 6f 6f 64 25 3d a3  |t%<=last%good%=.|
00006f60  0d 38 36 11 6c 61 73 74  25 3d 64 65 66 65 63 74  |.86.last%=defect|
00006f70  25 0d 38 40 29 e7 64 65  66 65 63 74 25 3c 45 6e  |%.8@).defect%<En|
00006f80  64 44 65 66 65 63 74 25  f2 43 68 65 63 6b 50 75  |dDefect%.CheckPu|
00006f90  74 28 64 65 66 65 63 74  25 29 0d 38 4a 21 fd 28  |t(defect%).8J!.(|
00006fa0  64 65 66 65 63 74 25 3e  3d 45 6e 64 44 65 66 65  |defect%>=EndDefe|
00006fb0  63 74 25 29 84 ac 67 6f  6f 64 25 0d 38 54 16 4f  |ct%)..good%.8T.O|
00006fc0  6c 64 44 65 66 65 63 74  73 25 3d 70 74 72 25 81  |ldDefects%=ptr%.|
00006fd0  34 0d 38 5e 1f 63 68 65  63 6b 25 3d 63 68 65 63  |4.8^.check%=chec|
00006fe0  6b 25 82 28 63 68 65 63  6b 25 3e 3e 3e 31 36 29  |k%.(check%>>>16)|
00006ff0  0d 38 68 24 63 68 65 63  6b 25 3d 28 63 68 65 63  |.8h$check%=(chec|
00007000  6b 25 82 28 63 68 65 63  6b 25 3e 3e 3e 38 29 29  |k%.(check%>>>8))|
00007010  80 26 46 46 0d 38 72 21  3d 67 6f 6f 64 25 80 28  |.&FF.8r!=good%.(|
00007020  28 64 65 66 65 63 74 25  80 26 46 46 29 3d 63 68  |(defect%.&FF)=ch|
00007030  65 63 6b 25 29 0d 38 86  17 dd a4 47 6f 6f 64 4e  |eck%).8....GoodN|
00007040  65 77 44 65 66 65 63 74  4c 69 73 74 0d 38 90 16  |ewDefectList.8..|
00007050  70 74 72 25 3d 34 2a 4f  6c 64 44 65 66 65 63 74  |ptr%=4*OldDefect|
00007060  73 25 0d 38 9a 0c 63 68  65 63 6b 25 3d 30 0d 38  |s%.8..check%=0.8|
00007070  a4 0c 6c 61 73 74 25 3d  2d 31 0d 38 ae 0b 67 6f  |..last%=-1.8..go|
00007080  6f 64 25 3d b9 0d 38 b8  05 f5 0d 38 c2 0f 70 74  |od%=..8....8..pt|
00007090  72 25 3d 70 74 72 25 2b  34 0d 38 cc 16 64 65 66  |r%=ptr%+4.8..def|
000070a0  65 63 74 25 3d 42 6f 6f  74 25 21 70 74 72 25 0d  |ect%=Boot%!ptr%.|
000070b0  38 d6 1a e7 64 65 66 65  63 74 25 3c 3d 6c 61 73  |8...defect%<=las|
000070c0  74 25 67 6f 6f 64 25 3d  a3 0d 38 e0 11 6c 61 73  |t%good%=..8..las|
000070d0  74 25 3d 64 65 66 65 63  74 25 0d 38 ea 2a e7 64  |t%=defect%.8.*.d|
000070e0  65 66 65 63 74 25 3c 45  6e 64 44 65 66 65 63 74  |efect%<EndDefect|
000070f0  32 25 f2 43 68 65 63 6b  50 75 74 28 64 65 66 65  |2%.CheckPut(defe|
00007100  63 74 25 29 0d 38 f4 22  fd 28 64 65 66 65 63 74  |ct%).8.".(defect|
00007110  25 3e 3d 45 6e 64 44 65  66 65 63 74 32 25 29 84  |%>=EndDefect2%).|
00007120  ac 67 6f 6f 64 25 0d 38  fe 24 4e 65 77 44 65 66  |.good%.8.$NewDef|
00007130  65 63 74 73 25 3d 70 74  72 25 81 34 2d 4f 6c 64  |ects%=ptr%.4-Old|
00007140  44 65 66 65 63 74 73 25  2d 31 0d 39 08 1f 63 68  |Defects%-1.9..ch|
00007150  65 63 6b 25 3d 63 68 65  63 6b 25 82 28 63 68 65  |eck%=check%.(che|
00007160  63 6b 25 3e 3e 3e 31 36  29 0d 39 12 24 63 68 65  |ck%>>>16).9.$che|
00007170  63 6b 25 3d 28 63 68 65  63 6b 25 82 28 63 68 65  |ck%=(check%.(che|
00007180  63 6b 25 3e 3e 3e 38 29  29 80 26 46 46 0d 39 1c  |ck%>>>8)).&FF.9.|
00007190  21 3d 67 6f 6f 64 25 80  28 28 64 65 66 65 63 74  |!=good%.((defect|
000071a0  25 80 26 46 46 29 3d 63  68 65 63 6b 25 29 0d 39  |%.&FF)=check%).9|
000071b0  3a 11 dd a4 47 6f 6f 64  44 65 66 65 63 74 73 0d  |:...GoodDefects.|
000071c0  39 44 20 62 6f 74 68 67  6f 6f 64 25 3d a4 47 6f  |9D bothgood%=.Go|
000071d0  6f 64 4f 6c 64 44 65 66  65 63 74 4c 69 73 74 0d  |odOldDefectList.|
000071e0  39 58 44 e7 28 28 42 6f  6f 74 52 65 63 25 21 26  |9XD.((BootRec%!&|
000071f0  31 30 29 3e 3d 28 35 31  32 2a 31 30 32 34 2a 31  |10)>=(512*1024*1|
00007200  30 32 34 29 84 28 42 6f  6f 74 52 65 63 25 21 26  |024).(BootRec%!&|
00007210  32 36 29 3c 3e 30 29 80  20 62 6f 74 68 67 6f 6f  |26)<>0). bothgoo|
00007220  64 25 8c 0d 39 62 2a 62  6f 74 68 67 6f 6f 64 25  |d%..9b*bothgood%|
00007230  3d 62 6f 74 68 67 6f 6f  64 25 80 a4 47 6f 6f 64  |=bothgood%..Good|
00007240  4e 65 77 44 65 66 65 63  74 4c 69 73 74 0d 39 6c  |NewDefectList.9l|
00007250  05 cd 0d 39 76 3a 3d 62  6f 74 68 67 6f 6f 64 25  |...9v:=bothgood%|
00007260  80 28 a4 73 75 6d 28 42  6f 6f 74 25 2c 42 6f 6f  |.(.sum(Boot%,Boo|
00007270  74 53 69 7a 65 25 29 3d  42 6f 6f 74 25 3f 28 42  |tSize%)=Boot%?(B|
00007280  6f 6f 74 53 69 7a 65 25  2d 31 29 29 0d 39 9e 11  |ootSize%-1)).9..|
00007290  dd f2 49 6e 69 74 44 69  73 63 52 65 63 0d 39 a8  |..InitDiscRec.9.|
000072a0  10 e3 49 25 3d 30 b8 36  34 2d 34 88 34 0d 39 b2  |..I%=0.64-4.4.9.|
000072b0  11 44 69 73 63 52 65 63  25 21 49 25 3d 30 0d 39  |.DiscRec%!I%=0.9|
000072c0  bc 07 ed 49 25 0d 39 c6  1a 3f 44 69 73 63 52 65  |...I%.9..?DiscRe|
000072d0  63 25 3d 4c 6f 67 32 53  65 63 53 69 7a 65 25 0d  |c%=Log2SecSize%.|
000072e0  39 d0 1a 44 69 73 63 52  65 63 25 3f 31 3d 53 65  |9..DiscRec%?1=Se|
000072f0  63 73 50 65 72 54 72 6b  25 0d 39 da 15 44 69 73  |csPerTrk%.9..Dis|
00007300  63 52 65 63 25 3f 32 3d  48 65 61 64 73 25 0d 39  |cRec%?2=Heads%.9|
00007310  e4 19 44 69 73 63 52 65  63 25 3f 38 3d 4c 6f 77  |..DiscRec%?8=Low|
00007320  53 65 63 74 6f 72 25 0d  39 ee 1e 44 69 73 63 52  |Sector%.9..DiscR|
00007330  65 63 25 21 26 43 3d 49  6e 64 52 6f 6f 74 44 69  |ec%!&C=IndRootDi|
00007340  72 41 64 64 25 0d 39 f8  1a 44 69 73 63 52 65 63  |rAdd%.9..DiscRec|
00007350  25 21 26 31 30 3d 44 69  73 63 53 69 7a 65 25 0d  |%!&10=DiscSize%.|
00007360  3a 02 1b 44 69 73 63 52  65 63 25 21 26 32 34 3d  |:..DiscRec%!&24=|
00007370  44 69 73 63 53 69 7a 65  32 25 0d 3a 0c 1f 44 69  |DiscSize2%.:..Di|
00007380  73 63 52 65 63 25 3f 26  32 38 3d 4c 6f 67 32 53  |scRec%?&28=Log2S|
00007390  68 61 72 65 53 69 7a 65  25 0d 3a 20 30 e7 28 28  |hareSize%.: 0.((|
000073a0  44 69 73 63 53 69 7a 65  25 80 26 45 30 30 30 30  |DiscSize%.&E0000|
000073b0  30 30 30 29 3c 3e 30 84  28 44 69 73 63 53 69 7a  |000)<>0.(DiscSiz|
000073c0  65 32 25 3c 3e 30 29 29  8c 0d 3a 2a 12 44 69 73  |e2%<>0))..:*.Dis|
000073d0  63 52 65 63 25 3f 26 32  39 3d 31 0d 3a 34 05 cc  |cRec%?&29=1.:4..|
000073e0  0d 3a 3e 12 44 69 73 63  52 65 63 25 3f 26 32 39  |.:>.DiscRec%?&29|
000073f0  3d 30 0d 3a 48 05 cd 0d  3a 52 1c 44 69 73 63 52  |=0.:H...:R.DiscR|
00007400  65 63 25 21 26 31 34 3d  b3 28 26 31 30 30 30 30  |ec%!&14=.(&10000|
00007410  29 2d 31 0d 3a 66 26 24  28 44 69 73 63 52 65 63  |)-1.:f&$(DiscRec|
00007420  25 2b 26 31 36 29 3d 22  48 61 72 64 44 69 73 63  |%+&16)="HardDisc|
00007430  22 2b c3 44 72 69 76 65  25 0d 3a 7a 17 44 69 73  |"+.Drive%.:z.Dis|
00007440  63 52 65 63 25 3f 26 32  32 3d 44 72 69 76 65 25  |cRec%?&22=Drive%|
00007450  0d 3a 84 05 e1 0d 3a c0  15 dd f2 49 6e 69 74 42  |.:....:....InitB|
00007460  6f 6f 74 44 65 66 65 63  74 73 0d 3a ca 15 21 42  |ootDefects.:..!B|
00007470  6f 6f 74 25 3d 45 6e 64  44 65 66 65 63 74 25 0d  |oot%=EndDefect%.|
00007480  3a d4 17 42 6f 6f 74 25  21 34 3d 45 6e 64 44 65  |:..Boot%!4=EndDe|
00007490  66 65 63 74 32 25 0d 3b  06 11 4f 6c 64 44 65 66  |fect2%.;..OldDef|
000074a0  65 63 74 73 25 3d 30 0d  3b 10 11 4e 65 77 44 65  |ects%=0.;..NewDe|
000074b0  66 65 63 74 73 25 3d 30  0d 3b 1a 11 f2 49 6e 69  |fects%=0.;...Ini|
000074c0  74 48 61 72 64 44 65 73  63 0d 3b 24 05 e1 0d 3b  |tHardDesc.;$...;|
000074d0  42 12 dd f2 49 6e 69 74  48 61 72 64 44 65 73 63  |B...InitHardDesc|
000074e0  0d 3b 4c 0a e7 49 44 45  25 8c 0d 3b 56 13 42 6f  |.;L..IDE%..;V.Bo|
000074f0  6f 74 52 65 63 25 21 2d  26 31 30 3d 30 0d 3b 60  |otRec%!-&10=0.;`|
00007500  12 42 6f 6f 74 52 65 63  25 21 2d 26 43 3d 30 0d  |.BootRec%!-&C=0.|
00007510  3b 6a 19 42 6f 6f 74 52  65 63 25 3f 2d 35 3d 49  |;j.BootRec%?-5=I|
00007520  6e 69 74 46 6c 61 67 25  0d 3b 74 18 42 6f 6f 74  |nitFlag%.;t.Boot|
00007530  52 65 63 25 3f 2d 36 3d  4c 42 41 66 6c 61 67 25  |Rec%?-6=LBAflag%|
00007540  0d 3b 7e 05 cc 0d 3b 88  1b 42 6f 6f 74 52 65 63  |.;~...;..BootRec|
00007550  25 21 2d 26 31 30 3d 26  30 30 30 30 30 30 30 30  |%!-&10=&00000000|
00007560  0d 3b 92 1a 42 6f 6f 74  52 65 63 25 21 2d 26 43  |.;..BootRec%!-&C|
00007570  3d 26 30 44 30 43 32 30  30 41 0d 3b b0 30 42 6f  |=&0D0C200A.;.0Bo|
00007580  6f 74 52 65 63 25 21 2d  38 3d 4c 6f 77 43 75 72  |otRec%!-8=LowCur|
00007590  72 65 6e 74 43 79 6c 25  84 28 50 72 65 43 6f 6d  |rentCyl%.(PreCom|
000075a0  70 43 79 6c 25 3c 3c 31  36 29 0d 3b ba 05 cd 0d  |pCyl%<<16).;....|
000075b0  3b d8 0d e7 42 69 67 44  69 73 63 25 0d 3b e2 2b  |;...BigDisc%.;.+|
000075c0  42 6f 6f 74 52 65 63 25  21 2d 34 3d 53 65 63 73  |BootRec%!-4=Secs|
000075d0  50 65 72 54 72 6b 25 2a  48 65 61 64 73 25 2a 50  |PerTrk%*Heads%*P|
000075e0  61 72 6b 43 79 6c 25 0d  3b ec 05 cc 0d 3b f6 34  |arkCyl%.;....;.4|
000075f0  42 6f 6f 74 52 65 63 25  21 2d 34 3d 53 65 63 53  |BootRec%!-4=SecS|
00007600  69 7a 65 25 2a 53 65 63  73 50 65 72 54 72 6b 25  |ize%*SecsPerTrk%|
00007610  2a 48 65 61 64 73 25 2a  50 61 72 6b 43 79 6c 25  |*Heads%*ParkCyl%|
00007620  0d 3c 00 05 cd 0d 3c 14  1b 42 6f 6f 74 52 65 63  |.<....<..BootRec|
00007630  25 21 2d 26 31 34 3d 26  46 46 46 46 46 46 46 46  |%!-&14=&FFFFFFFF|
00007640  0d 3c 1e 05 e1 0d 3c 3c  20 dd a4 41 73 6b 28 73  |.<....<< ..Ask(s|
00007650  74 72 69 6e 67 24 2c 44  65 66 61 75 6c 74 25 2c  |tring$,Default%,|
00007660  6d 69 6e 25 29 0d 3c 46  16 ea 58 2c 59 2c 72 65  |min%).<F..X,Y,re|
00007670  70 6c 79 24 2c 76 61 6c  75 65 25 0d 3c 50 2d e7  |ply$,value%.<P-.|
00007680  a7 61 75 74 6f 72 65 70  6c 79 24 2c 22 44 65 66  |.autoreply$,"Def|
00007690  61 75 6c 74 73 22 29 80  20 44 65 66 61 75 6c 74  |aults"). Default|
000076a0  25 3e 3d 6d 69 6e 25 8c  0d 3c 5a 0d 3d 44 65 66  |%>=min%..<Z.=Def|
000076b0  61 75 6c 74 25 0d 3c 64  05 cd 0d 3c 6e 09 f1 3a  |ault%.<d...<n..:|
000076c0  ef 31 31 0d 3c 78 25 f2  6d 65 73 73 61 67 65 5f  |.11.<x%.message_|
000076d0  70 72 69 6e 74 5f 30 28  73 74 72 69 6e 67 24 29  |print_0(string$)|
000076e0  3a 58 3d b1 3a 59 3d bc  0d 3c 82 06 ea 85 0d 3c  |:X=.:Y=..<.....<|
000076f0  8c 18 ee 85 ea e7 9f 3d  31 37 f2 61 62 6f 72 74  |.......=17.abort|
00007700  28 f6 24 2c 31 29 0d 3c  96 05 f5 0d 3c a0 1d f1  |(.$,1).<....<...|
00007710  8a 58 2c 59 29 3b 44 65  66 61 75 6c 74 25 3b 89  |.X,Y);Default%;.|
00007720  33 3b 8a 58 2c 59 29 3b  0d 3c aa 0c 2a 46 58 20  |3;.X,Y);.<..*FX |
00007730  31 35 2c 31 0d 3c b4 0d  e8 22 22 72 65 70 6c 79  |15,1.<...""reply|
00007740  24 0d 3c be 0f e7 72 65  70 6c 79 24 3d 22 22 8c  |$.<...reply$="".|
00007750  0d 3c c8 13 76 61 6c 75  65 25 3d 44 65 66 61 75  |.<..value%=Defau|
00007760  6c 74 25 0d 3c d2 05 cc  0d 3c dc 14 76 61 6c 75  |lt%.<....<..valu|
00007770  65 25 3d a0 28 72 65 70  6c 79 24 29 0d 3c e6 05  |e%=.(reply$).<..|
00007780  cd 0d 3c f0 11 fd 76 61  6c 75 65 25 3e 3d 6d 69  |..<...value%>=mi|
00007790  6e 25 0d 3c fa 14 f1 8a  58 2c 59 29 3b 76 61 6c  |n%.<....X,Y);val|
000077a0  75 65 25 3b 89 33 0d 3d  04 0b 3d 76 61 6c 75 65  |ue%;.3.=..=value|
000077b0  25 0d 3d 22 21 dd a4 49  6e 70 75 74 44 65 63 28  |%.="!..InputDec(|
000077c0  73 74 72 69 6e 67 24 2c  6d 69 6e 25 2c 6d 61 78  |string$,min%,max|
000077d0  25 29 0d 3d 2c 16 ea 58  2c 59 2c 72 65 70 6c 79  |%).=,..X,Y,reply|
000077e0  24 2c 76 61 6c 75 65 25  0d 3d 36 09 f1 3a ef 31  |$,value%.=6..:.1|
000077f0  31 0d 3d 40 35 f2 6d 65  73 73 61 67 65 5f 70 72  |1.=@5.message_pr|
00007800  69 6e 74 5f 32 28 73 74  72 69 6e 67 24 2c c3 28  |int_2(string$,.(|
00007810  6d 69 6e 25 29 2c c3 28  6d 61 78 25 29 29 3a 58  |min%),.(max%)):X|
00007820  3d b1 3a 59 3d bc 0d 3d  4a 06 ea 85 0d 3d 54 18  |=.:Y=..=J....=T.|
00007830  ee 85 ea e7 9f 3d 31 37  f2 61 62 6f 72 74 28 f6  |.....=17.abort(.|
00007840  24 2c 31 29 0d 3d 5e 05  f5 0d 3d 68 1f f1 8a 58  |$,1).=^...=h...X|
00007850  2c 59 29 3b 89 31 32 3b  8a 58 2c 59 29 3b 3a e8  |,Y);.12;.X,Y);:.|
00007860  22 22 72 65 70 6c 79 24  0d 3d 72 14 76 61 6c 75  |""reply$.=r.valu|
00007870  65 25 3d a0 28 72 65 70  6c 79 24 29 0d 3d 7c 1f  |e%=.(reply$).=|.|
00007880  fd 76 61 6c 75 65 25 3e  3d 6d 69 6e 25 80 20 76  |.value%>=min%. v|
00007890  61 6c 75 65 25 3c 3d 6d  61 78 25 0d 3d 86 0b 3d  |alue%<=max%.=..=|
000078a0  76 61 6c 75 65 25 0d 3d  a4 17 dd a4 49 6e 70 75  |value%.=....Inpu|
000078b0  74 48 65 78 28 73 74 72  69 6e 67 24 29 0d 3d ae  |tHex(string$).=.|
000078c0  16 ea 58 2c 59 2c 72 65  70 6c 79 24 2c 76 61 6c  |..X,Y,reply$,val|
000078d0  75 65 25 0d 3d b8 09 f1  3a ef 31 31 0d 3d c2 25  |ue%.=...:.11.=.%|
000078e0  f2 6d 65 73 73 61 67 65  5f 70 72 69 6e 74 5f 30  |.message_print_0|
000078f0  28 73 74 72 69 6e 67 24  29 3a 58 3d b1 3a 59 3d  |(string$):X=.:Y=|
00007900  bc 0d 3d cc 06 ea 85 0d  3d d6 18 ee 85 ea e7 9f  |..=.....=.......|
00007910  3d 31 37 f2 61 62 6f 72  74 28 f6 24 2c 31 29 0d  |=17.abort(.$,1).|
00007920  3d e0 1f f1 8a 58 2c 59  29 3b 89 31 32 3b 8a 58  |=....X,Y);.12;.X|
00007930  2c 59 29 3b 3a e8 22 22  72 65 70 6c 79 24 0d 3d  |,Y);:.""reply$.=|
00007940  ea 12 3d a0 28 22 26 22  2b 72 65 70 6c 79 24 29  |..=.("&"+reply$)|
00007950  0d 3d fe 18 dd a4 49 6e  70 75 74 48 65 78 32 28  |.=....InputHex2(|
00007960  73 74 72 69 6e 67 24 29  0d 3e 08 16 ea 58 2c 59  |string$).>...X,Y|
00007970  2c 72 65 70 6c 79 24 2c  76 61 6c 75 65 25 0d 3e  |,reply$,value%.>|
00007980  12 09 f1 3a ef 31 31 0d  3e 1c 25 f2 6d 65 73 73  |...:.11.>.%.mess|
00007990  61 67 65 5f 70 72 69 6e  74 5f 30 28 73 74 72 69  |age_print_0(stri|
000079a0  6e 67 24 29 3a 58 3d b1  3a 59 3d bc 0d 3e 3a 1f  |ng$):X=.:Y=..>:.|
000079b0  f1 8a 58 2c 59 29 3b 89  31 32 3b 8a 58 2c 59 29  |..X,Y);.12;.X,Y)|
000079c0  3b 3a e8 22 22 72 65 70  6c 79 24 0d 3e 44 18 3d  |;:.""reply$.>D.=|
000079d0  a4 53 65 63 74 6f 72 41  64 64 72 28 72 65 70 6c  |.SectorAddr(repl|
000079e0  79 24 29 0d 3e 62 18 dd  a4 53 65 63 74 6f 72 41  |y$).>b...SectorA|
000079f0  64 64 72 28 72 65 70 6c  79 24 29 0d 3e 6c 0f ea  |ddr(reply$).>l..|
00007a00  61 64 64 25 2c 61 64 64  32 25 0d 3e 76 0a 61 64  |add%,add2%.>v.ad|
00007a10  64 25 3d 30 0d 3e 80 0b  61 64 64 32 25 3d 30 0d  |d%=0.>..add2%=0.|
00007a20  3e 94 3b c8 95 a7 22 61  62 63 64 65 66 41 42 43  |>.;..."abcdefABC|
00007a30  44 45 46 30 31 32 33 34  35 36 37 38 39 22 2c c0  |DEF0123456789",.|
00007a40  72 65 70 6c 79 24 2c 31  29 29 3c 3e 30 80 a9 28  |reply$,1))<>0..(|
00007a50  72 65 70 6c 79 24 29 3c  3e 30 0d 3e 9e 20 61 64  |reply$)<>0.>. ad|
00007a60  64 32 25 3d 28 61 64 64  32 25 3c 3c 34 29 2b 28  |d2%=(add2%<<4)+(|
00007a70  61 64 64 25 3e 3e 3e 32  38 29 0d 3e a8 10 61 64  |add%>>>28).>..ad|
00007a80  64 25 3d 61 64 64 25 3c  3c 34 0d 3e b2 1f 61 64  |d%=add%<<4.>..ad|
00007a90  64 25 3d 61 64 64 25 2b  a0 28 22 26 22 2b c0 72  |d%=add%+.("&"+.r|
00007aa0  65 70 6c 79 24 2c 31 29  29 0d 3e bc 15 72 65 70  |eply$,1)).>..rep|
00007ab0  6c 79 24 3d c1 72 65 70  6c 79 24 2c 32 29 0d 3e  |ly$=.reply$,2).>|
00007ac0  c6 05 ce 0d 3e d0 35 3d  28 61 64 64 25 3e 3e 3e  |....>.5=(add%>>>|
00007ad0  4c 6f 67 32 53 65 63 53  69 7a 65 25 29 2b 28 61  |Log2SecSize%)+(a|
00007ae0  64 64 32 25 3c 3c 28 33  32 2d 4c 6f 67 32 53 65  |dd2%<<(32-Log2Se|
00007af0  63 53 69 7a 65 25 29 29  0d 3e f8 2b dd a4 43 68  |cSize%)).>.+..Ch|
00007b00  6f 6f 73 65 28 73 65 6c  65 63 74 24 2c 73 74 72  |oose(select$,str|
00007b10  69 6e 67 24 2c 6f 70 74  24 2c 64 65 66 61 75 6c  |ing$,opt$,defaul|
00007b20  74 24 29 0d 3f 02 48 3d  a4 63 68 6f 6f 73 65 5f  |t$).?.H=.choose_|
00007b30  6e 6f 5f 6c 6f 6f 6b 75  70 28 73 65 6c 65 63 74  |no_lookup(select|
00007b40  24 2c a4 6d 65 73 73 61  67 65 5f 6c 6f 6f 6b 75  |$,.message_looku|
00007b50  70 5f 30 28 73 74 72 69  6e 67 24 29 2c 6f 70 74  |p_0(string$),opt|
00007b60  24 2c 64 65 66 61 75 6c  74 24 29 0d 3f 20 45 dd  |$,default$).? E.|
00007b70  a4 63 68 6f 6f 73 65 5f  6e 6f 5f 6c 6f 6f 6b 75  |.choose_no_looku|
00007b80  70 28 73 65 6c 65 63 74  24 2c 53 74 72 69 6e 67  |p(select$,String|
00007b90  24 2c 65 6e 67 6c 69 73  68 5f 6f 70 74 24 2c 65  |$,english_opt$,e|
00007ba0  6e 67 6c 69 73 68 5f 64  65 66 61 75 6c 74 24 29  |nglish_default$)|
00007bb0  0d 3f 2a 27 ea 58 2c 59  2c 72 65 70 6c 79 24 2c  |.?*'.X,Y,reply$,|
00007bc0  73 74 61 72 74 2c 65 6e  64 2c 6f 70 74 24 2c 64  |start,end,opt$,d|
00007bd0  65 66 61 75 6c 74 24 0d  3f 34 28 6f 70 74 24 3d  |efault$.?4(opt$=|
00007be0  a4 6d 65 73 73 61 67 65  5f 6c 6f 6f 6b 75 70 5f  |.message_lookup_|
00007bf0  30 28 65 6e 67 6c 69 73  68 5f 6f 70 74 24 29 0d  |0(english_opt$).|
00007c00  3f 3e 1a e7 65 6e 67 6c  69 73 68 5f 64 65 66 61  |?>..english_defa|
00007c10  75 6c 74 24 3c 3e 22 22  8c 0d 3f 48 35 64 65 66  |ult$<>""..?H5def|
00007c20  61 75 6c 74 24 3d c1 6f  70 74 24 2c a7 65 6e 67  |ault$=.opt$,.eng|
00007c30  6c 69 73 68 5f 6f 70 74  24 2c 65 6e 67 6c 69 73  |lish_opt$,englis|
00007c40  68 5f 64 65 66 61 75 6c  74 24 29 2c 31 29 0d 3f  |h_default$),1).?|
00007c50  52 05 cc 0d 3f 5c 0f 64  65 66 61 75 6c 74 24 3d  |R...?\.default$=|
00007c60  22 22 0d 3f 66 05 cd 0d  3f 7a 14 e7 61 75 74 6f  |"".?f...?z..auto|
00007c70  72 65 70 6c 79 24 3c 3e  22 22 8c 0d 3f 84 1e 73  |reply$<>""..?..s|
00007c80  74 61 72 74 3d a7 61 75  74 6f 72 65 70 6c 79 24  |tart=.autoreply$|
00007c90  2c 73 65 6c 65 63 74 24  29 0d 3f 8e 20 65 6e 64  |,select$).?. end|
00007ca0  3d a7 61 75 74 6f 72 65  70 6c 79 24 2c 22 2c 22  |=.autoreply$,","|
00007cb0  2c 73 74 61 72 74 2b 31  29 0d 3f 98 1e e7 65 6e  |,start+1).?...en|
00007cc0  64 3d 30 8c 65 6e 64 3d  a9 28 61 75 74 6f 72 65  |d=0.end=.(autore|
00007cd0  70 6c 79 24 29 2b 31 0d  3f a2 0d e7 73 74 61 72  |ply$)+1.?...star|
00007ce0  74 3d 30 8c 0d 3f ac 32  f2 6d 65 73 73 61 67 65  |t=0..?.2.message|
00007cf0  5f 70 72 69 6e 74 5f 32  28 22 46 61 69 6c 65 64  |_print_2("Failed|
00007d00  41 75 74 6f 22 2c 73 65  6c 65 63 74 24 2c 53 74  |Auto",select$,St|
00007d10  72 69 6e 67 24 29 0d 3f  b6 0b f2 66 69 6e 69 73  |ring$).?...finis|
00007d20  68 0d 3f c0 05 cd 0d 3f  ca 15 73 74 61 72 74 2b  |h.?....?..start+|
00007d30  3d a9 28 73 65 6c 65 63  74 24 29 0d 3f d4 10 e7  |=.(select$).?...|
00007d40  73 74 61 72 74 3c 3e 65  6e 64 8c 0d 3f de 32 e7  |start<>end..?.2.|
00007d50  64 65 76 25 f1 53 74 72  69 6e 67 24 3b 22 20 22  |dev%.String$;" "|
00007d60  3b c1 61 75 74 6f 72 65  70 6c 79 24 2c 73 74 61  |;.autoreply$,sta|
00007d70  72 74 2c 65 6e 64 2d 73  74 61 72 74 29 0d 3f e8  |rt,end-start).?.|
00007d80  21 3d c1 61 75 74 6f 72  65 70 6c 79 24 2c 73 74  |!=.autoreply$,st|
00007d90  61 72 74 2c 65 6e 64 2d  73 74 61 72 74 29 0d 3f  |art,end-start).?|
00007da0  f2 05 cd 0d 3f fc 05 cd  0d 40 06 09 f1 3a ef 31  |....?....@...:.1|
00007db0  31 0d 40 10 15 f1 53 74  72 69 6e 67 24 3b 3a 58  |1.@...String$;:X|
00007dc0  3d b1 3a 59 3d bc 0d 40  1a 05 f5 0d 40 24 05 f5  |=.:Y=..@....@$..|
00007dd0  0d 40 2e 28 f1 8a 58 2c  59 29 3b 64 65 66 61 75  |.@.(..X,Y);defau|
00007de0  6c 74 24 3b 89 31 32 3b  8a 58 2c 59 29 3b 3a e8  |lt$;.12;.X,Y);:.|
00007df0  22 22 72 65 70 6c 79 24  0d 40 38 1e e7 72 65 70  |""reply$.@8..rep|
00007e00  6c 79 24 3d 22 22 8c 72  65 70 6c 79 24 3d 64 65  |ly$="".reply$=de|
00007e10  66 61 75 6c 74 24 0d 40  42 10 fd a9 28 72 65 70  |fault$.@B...(rep|
00007e20  6c 79 24 29 3d 31 0d 40  4c 2c e7 a7 6f 70 74 24  |ly$)=1.@L,..opt$|
00007e30  2c 72 65 70 6c 79 24 29  3d 30 8c 72 65 70 6c 79  |,reply$)=0.reply|
00007e40  24 3d bd 28 97 28 72 65  70 6c 79 24 29 80 26 44  |$=.(.(reply$).&D|
00007e50  46 29 0d 40 56 12 fd a7  6f 70 74 24 2c 72 65 70  |F).@V...opt$,rep|
00007e60  6c 79 24 29 0d 40 74 23  3d c1 65 6e 67 6c 69 73  |ly$).@t#=.englis|
00007e70  68 5f 6f 70 74 24 2c a7  6f 70 74 24 2c 72 65 70  |h_opt$,.opt$,rep|
00007e80  6c 79 24 29 2c 31 29 0d  40 92 1a dd a4 72 65 61  |ly$),1).@....rea|
00007e90  64 76 61 72 76 61 6c 28  76 61 72 6e 61 6d 65 24  |dvarval(varname$|
00007ea0  29 0d 40 9c 14 ea 76 61  72 6c 65 6e 25 2c 76 61  |).@...varlen%,va|
00007eb0  72 62 75 66 25 0d 40 a6  0f de 76 61 72 62 75 66  |rbuf%.@...varbuf|
00007ec0  25 32 35 36 0d 40 b0 39  c8 99 22 58 4f 53 5f 52  |%256.@.9.."XOS_R|
00007ed0  65 61 64 56 61 72 56 61  6c 22 2c 76 61 72 6e 61  |eadVarVal",varna|
00007ee0  6d 65 24 2c 76 61 72 62  75 66 25 2c 32 35 36 2c  |me$,varbuf%,256,|
00007ef0  30 2c 33 b8 2c 2c 76 61  72 6c 65 6e 25 0d 40 ba  |0,3.,,varlen%.@.|
00007f00  16 76 61 72 62 75 66 25  3f 76 61 72 6c 65 6e 25  |.varbuf%?varlen%|
00007f10  3d 31 33 0d 40 c4 0d 3d  24 76 61 72 62 75 66 25  |=13.@..=$varbuf%|
00007f20  0d 40 ec 12 dd f2 43 68  65 63 6b 50 75 74 28 49  |.@....CheckPut(I|
00007f30  25 29 0d 40 f6 39 63 68  65 63 6b 25 3d 28 63 68  |%).@.9check%=(ch|
00007f40  65 63 6b 25 3e 3e 3e 31  33 29 82 28 28 63 68 65  |eck%>>>13).((che|
00007f50  63 6b 25 80 28 32 5e 31  33 2d 31 29 29 3c 3c 28  |ck%.(2^13-1))<<(|
00007f60  33 32 2d 31 33 29 29 82  20 49 25 0d 41 00 05 e1  |32-13)). I%.A...|
00007f70  0d 41 1e 15 dd a4 73 75  6d 28 62 61 73 65 25 2c  |.A....sum(base%,|
00007f80  6c 65 6e 25 29 0d 41 28  0f 73 75 6d 25 3d 30 3a  |len%).A(.sum%=0:|
00007f90  63 25 3d 30 0d 41 32 13  e3 49 25 3d 6c 65 6e 25  |c%=0.A2..I%=len%|
00007fa0  2d 32 b8 30 88 2d 31 0d  41 3c 19 73 75 6d 25 3d  |-2.0.-1.A<.sum%=|
00007fb0  73 75 6d 25 2b 62 61 73  65 25 3f 49 25 2b 63 25  |sum%+base%?I%+c%|
00007fc0  0d 41 46 26 e7 73 75 6d  25 3c 26 31 30 30 20 63  |.AF&.sum%<&100 c|
00007fd0  25 3d 30 8b 73 75 6d 25  3d 73 75 6d 25 80 26 46  |%=0.sum%=sum%.&F|
00007fe0  46 3a 63 25 3d 31 0d 41  50 07 ed 49 25 0d 41 5a  |F:c%=1.AP..I%.AZ|
00007ff0  09 3d 73 75 6d 25 0d 41  6e 15 dd f2 53 75 6d 28  |.=sum%.An...Sum(|
00008000  62 61 73 65 25 2c 6c 65  6e 25 29 0d 41 78 23 62  |base%,len%).Ax#b|
00008010  61 73 65 25 3f 28 6c 65  6e 25 2d 31 29 3d a4 73  |ase%?(len%-1)=.s|
00008020  75 6d 28 62 61 73 65 25  2c 6c 65 6e 25 29 0d 41  |um(base%,len%).A|
00008030  82 05 e1 0d 41 96 25 dd  a4 4e 65 77 4d 61 70 43  |....A.%..NewMapC|
00008040  68 65 63 6b 28 42 25 2c  43 25 29 3d ba 28 4e 65  |heck(B%,C%)=.(Ne|
00008050  77 43 68 65 63 6b 25 29  0d 41 aa 09 dd f2 41 73  |wCheck%).A....As|
00008060  6d 0d 41 b4 0f e3 6f 70  74 25 3d 30 b8 32 88 32  |m.A...opt%=0.2.2|
00008070  0d 41 be 0a 50 25 3d 6d  63 25 0d 41 c8 0d 5b 4f  |.A..P%=mc%.A..[O|
00008080  50 54 20 6f 70 74 25 0d  41 d2 0e 2e 4e 65 77 43  |PT opt%.A...NewC|
00008090  68 65 63 6b 25 0d 41 dc  0d 4d 4f 56 20 52 30 2c  |heck%.A..MOV R0,|
000080a0  23 30 0d 41 e6 15 41 44  44 53 20 52 32 2c 52 31  |#0.A..ADDS R2,R1|
000080b0  2c 52 32 5c 43 3d 30 0d  41 f0 0a 2e 6c 6f 6f 70  |,R2\C=0.A...loop|
000080c0  25 0d 41 fa 14 4c 44 52  20 52 33 2c 5b 52 32 2c  |%.A..LDR R3,[R2,|
000080d0  23 2d 34 5d 21 0d 42 04  11 41 44 43 53 20 52 30  |#-4]!.B..ADCS R0|
000080e0  2c 52 30 2c 52 33 0d 42  0e 0e 54 45 51 53 20 52  |,R0,R3.B..TEQS R|
000080f0  32 2c 52 31 0d 42 18 0d  42 4e 45 20 6c 6f 6f 70  |2,R1.B..BNE loop|
00008100  25 0d 42 22 10 80 20 52  33 2c 52 33 2c 23 26 46  |%.B".. R3,R3,#&F|
00008110  46 0d 42 2c 10 53 55 42  20 52 30 2c 52 30 2c 52  |F.B,.SUB R0,R0,R|
00008120  33 0d 42 36 15 82 20 52  30 2c 52 30 2c 52 30 2c  |3.B6.. R0,R0,R0,|
00008130  4c 53 52 23 31 36 0d 42  40 14 82 20 52 30 2c 52  |LSR#16.B@.. R0,R|
00008140  30 2c 52 30 2c 4c 53 52  23 38 0d 42 4a 10 80 20  |0,R0,LSR#8.BJ.. |
00008150  52 30 2c 52 30 2c 23 26  46 46 0d 42 54 0f 4d 4f  |R0,R0,#&FF.BT.MO|
00008160  56 53 20 50 43 2c 52 31  34 0d 42 5e 05 5d 0d 42  |VS PC,R14.B^.].B|
00008170  68 09 ed 6f 70 74 25 0d  42 72 05 e1 0d 42 86 13  |h..opt%.Br...B..|
00008180  dd f2 44 69 73 61 62 6c  65 45 73 63 61 70 65 0d  |..DisableEscape.|
00008190  42 90 28 c8 99 22 58 4f  53 5f 42 79 74 65 22 2c  |B.(.."XOS_Byte",|
000081a0  32 30 30 2c 31 2c 30 b8  52 30 2c 4f 6c 64 45 73  |200,1,0.R0,OldEs|
000081b0  63 53 74 61 74 65 25 0d  42 9a 32 c8 99 22 58 4f  |cState%.B.2.."XO|
000081c0  53 5f 42 79 74 65 22 2c  32 34 37 2c 25 31 30 31  |S_Byte",247,%101|
000081d0  30 31 30 31 30 2c 30 b8  52 30 2c 4f 6c 64 42 72  |01010,0.R0,OldBr|
000081e0  65 61 6b 53 74 61 74 65  25 0d 42 a4 05 e1 0d 42  |eakState%.B....B|
000081f0  b8 13 dd f2 52 65 73 74  6f 72 65 45 73 63 61 70  |....RestoreEscap|
00008200  65 0d 42 c2 23 c8 99 22  58 4f 53 5f 42 79 74 65  |e.B.#.."XOS_Byte|
00008210  22 2c 32 30 30 2c 4f 6c  64 45 73 63 53 74 61 74  |",200,OldEscStat|
00008220  65 25 2c 30 0d 42 cc 25  c8 99 22 58 4f 53 5f 42  |e%,0.B.%.."XOS_B|
00008230  79 74 65 22 2c 32 34 37  2c 4f 6c 64 42 72 65 61  |yte",247,OldBrea|
00008240  6b 53 74 61 74 65 25 2c  30 0d 42 d6 05 e1 0d 42  |kState%,0.B....B|
00008250  ea 19 dd f2 4d 6f 61 6e  4f 70 28 62 25 2c 43 25  |....MoanOp(b%,C%|
00008260  2c 44 25 2c 45 25 29 0d  42 f4 0e e7 42 69 67 41  |,D%,E%).B...BigA|
00008270  44 46 53 25 8c 0d 42 fe  43 c8 99 41 64 66 73 53  |DFS%..B.C..AdfsS|
00008280  77 69 25 2c 30 2c 62 25  84 41 6c 74 44 65 66 65  |wi%,0,b%.AltDefe|
00008290  63 74 42 69 74 25 84 28  44 69 73 63 52 65 63 25  |ctBit%.(DiscRec%|
000082a0  3c 3c 36 29 2c 43 25 84  44 72 69 76 65 25 3c 3c  |<<6),C%.Drive%<<|
000082b0  32 39 2c 44 25 2c 45 25  0d 43 08 05 cc 0d 43 12  |29,D%,E%.C....C.|
000082c0  4e c8 99 41 64 66 73 53  77 69 25 2c 30 2c 62 25  |N..AdfsSwi%,0,b%|
000082d0  84 41 6c 74 44 65 66 65  63 74 42 69 74 25 84 28  |.AltDefectBit%.(|
000082e0  44 69 73 63 52 65 63 25  3c 3c 36 29 2c 28 43 25  |DiscRec%<<6),(C%|
000082f0  2a 53 65 63 53 69 7a 65  25 29 84 44 72 69 76 65  |*SecSize%).Drive|
00008300  25 3c 3c 32 39 2c 44 25  2c 45 25 0d 43 1c 05 cd  |%<<29,D%,E%.C...|
00008310  0d 43 26 05 e1 0d 43 44  15 dd f2 4f 70 28 62 25  |.C&...CD...Op(b%|
00008320  2c 43 25 2c 44 25 2c 45  25 29 0d 43 4e 0e e7 42  |,C%,D%,E%).CN..B|
00008330  69 67 41 44 46 53 25 8c  0d 43 58 63 c8 99 41 64  |igADFS%..CXc..Ad|
00008340  66 73 53 77 69 25 84 28  31 3c 3c 31 37 29 2c 30  |fsSwi%.(1<<17),0|
00008350  2c 62 25 84 41 6c 74 44  65 66 65 63 74 42 69 74  |,b%.AltDefectBit|
00008360  25 84 28 44 69 73 63 52  65 63 25 3c 3c 36 29 2c  |%.(DiscRec%<<6),|
00008370  43 25 84 44 72 69 76 65  25 3c 3c 32 39 2c 44 25  |C%.Drive%<<29,D%|
00008380  2c 45 25 b8 52 65 73 75  6c 74 25 2c 52 31 25 2c  |,E%.Result%,R1%,|
00008390  45 72 72 44 69 73 63 41  64 64 25 0d 43 62 05 cc  |ErrDiscAdd%.Cb..|
000083a0  0d 43 6c 6e c8 99 41 64  66 73 53 77 69 25 84 28  |.Cln..AdfsSwi%.(|
000083b0  31 3c 3c 31 37 29 2c 30  2c 62 25 84 41 6c 74 44  |1<<17),0,b%.AltD|
000083c0  65 66 65 63 74 42 69 74  25 84 28 44 69 73 63 52  |efectBit%.(DiscR|
000083d0  65 63 25 3c 3c 36 29 2c  28 43 25 2a 53 65 63 53  |ec%<<6),(C%*SecS|
000083e0  69 7a 65 25 29 84 44 72  69 76 65 25 3c 3c 32 39  |ize%).Drive%<<29|
000083f0  2c 44 25 2c 45 25 b8 52  65 73 75 6c 74 25 2c 52  |,D%,E%.Result%,R|
00008400  31 25 2c 45 72 72 44 69  73 63 41 64 64 25 0d 43  |1%,ErrDiscAdd%.C|
00008410  76 05 cd 0d 43 80 0d e7  52 65 73 75 6c 74 25 8c  |v...C...Result%.|
00008420  0d 43 8a 0e e7 56 65 72  62 6f 73 65 25 8c 0d 43  |.C...Verbose%..C|
00008430  94 0b f1 22 28 22 22 22  3b 0d 43 9e 22 49 25 3d  |..."(""";.C."I%=|
00008440  52 65 73 75 6c 74 25 2b  34 3a c8 95 3f 49 25 ef  |Result%+4:..?I%.|
00008450  3f 49 25 3a 49 25 2b 3d  31 3a ce 0d 43 a8 2c f2  |?I%:I%+=1:..C.,.|
00008460  6d 65 73 73 61 67 65 5f  70 72 69 6e 74 5f 31 28  |message_print_1(|
00008470  22 4f 70 45 72 72 6f 72  22 2c c3 7e 28 21 52 65  |"OpError",.~(!Re|
00008480  73 75 6c 74 25 29 29 0d  43 b2 05 cd 0d 43 bc 16  |sult%)).C....C..|
00008490  e7 21 52 65 73 75 6c 74  25 80 28 31 3c 3c 33 31  |.!Result%.(1<<31|
000084a0  29 8c 0d 43 c6 33 f2 6d  65 73 73 61 67 65 5f 70  |)..C.3.message_p|
000084b0  72 69 6e 74 5f 31 28 22  45 72 72 6f 72 22 2c c3  |rint_1("Error",.|
000084c0  7e 28 52 65 73 75 6c 74  25 80 26 33 46 46 46 46  |~(Result%.&3FFFF|
000084d0  46 46 46 29 29 0d 43 d0  0b f2 66 69 6e 69 73 68  |FFF)).C...finish|
000084e0  0d 43 da 05 cc 0d 43 e4  27 e7 28 28 21 52 65 73  |.C....C.'.((!Res|
000084f0  75 6c 74 25 29 80 26 46  46 46 46 46 46 29 3d 41  |ult%).&FFFFFF)=A|
00008500  64 66 73 44 69 73 63 45  72 72 25 8c 0d 43 ee 15  |dfsDiscErr%..C..|
00008510  52 65 73 75 6c 74 25 3d  52 65 73 75 6c 74 25 3f  |Result%=Result%?|
00008520  33 0d 43 f8 05 cc 0d 44  02 2e f2 6d 65 73 73 61  |3.C....D...messa|
00008530  67 65 5f 70 72 69 6e 74  5f 31 28 22 45 72 72 6f  |ge_print_1("Erro|
00008540  72 22 2c c3 7e 28 21 52  65 73 75 6c 74 25 29 29  |r",.~(!Result%))|
00008550  3a ef 33 32 0d 44 0c 08  49 25 3d 34 0d 44 16 10  |:.32.D..I%=4.D..|
00008560  c8 95 52 65 73 75 6c 74  25 3f 49 25 0d 44 20 0f  |..Result%?I%.D .|
00008570  ef 52 65 73 75 6c 74 25  3f 49 25 0d 44 2a 0b 49  |.Result%?I%.D*.I|
00008580  25 3d 49 25 2b 31 0d 44  34 05 ce 0d 44 3e 0b f2  |%=I%+1.D4...D>..|
00008590  66 69 6e 69 73 68 0d 44  48 05 cd 0d 44 52 05 cd  |finish.DH...DR..|
000085a0  0d 44 5c 05 cc 0d 44 66  05 cd 0d 44 70 05 e1 0d  |.D\...Df...Dp...|
000085b0  44 8e 1f dd a4 6d 61 74  63 68 73 74 72 69 6e 67  |D....matchstring|
000085c0  73 28 73 74 72 31 24 2c  73 74 72 32 24 29 0d 44  |s(str1$,str2$).D|
000085d0  98 14 ea 49 49 25 2c 4a  4a 25 2c 4c 49 25 2c 4c  |...II%,JJ%,LI%,L|
000085e0  4a 25 0d 44 a2 16 49 49  25 3d 30 3a 4c 49 25 3d  |J%.D..II%=0:LI%=|
000085f0  a9 28 73 74 72 31 24 29  0d 44 ac 16 4a 4a 25 3d  |.(str1$).D..JJ%=|
00008600  30 3a 4c 4a 25 3d a9 28  73 74 72 32 24 29 0d 44  |0:LJ%=.(str2$).D|
00008610  b6 05 f5 0d 44 ca 30 c8  95 49 49 25 3c 4c 49 25  |....D.0..II%<LI%|
00008620  80 97 28 c1 73 74 72 31  24 2c 49 49 25 2b 31 2c  |..(.str1$,II%+1,|
00008630  31 29 29 3d 97 28 22 20  22 29 3a 49 49 25 2b 3d  |1))=.(" "):II%+=|
00008640  31 3a ce 0d 44 d4 30 c8  95 4a 4a 25 3c 4c 4a 25  |1:..D.0..JJ%<LJ%|
00008650  80 97 28 c1 73 74 72 32  24 2c 4a 4a 25 2b 31 2c  |..(.str2$,JJ%+1,|
00008660  31 29 29 3d 97 28 22 20  22 29 3a 4a 4a 25 2b 3d  |1))=.(" "):JJ%+=|
00008670  31 3a ce 0d 44 de 16 e7  49 49 25 3c 4c 49 25 80  |1:..D...II%<LI%.|
00008680  20 4a 4a 25 3c 4c 4a 25  8c 0d 44 e8 2c e7 97 28  | JJ%<LJ%..D.,..(|
00008690  c1 73 74 72 31 24 2c 49  49 25 2b 31 2c 31 29 29  |.str1$,II%+1,1))|
000086a0  3c 3e 97 28 c1 73 74 72  32 24 2c 4a 4a 25 2b 31  |<>.(.str2$,JJ%+1|
000086b0  2c 31 29 29 8c 0d 44 f2  06 3d a3 0d 44 fc 05 cd  |,1))..D..=..D...|
000086c0  0d 45 06 05 cc 0d 45 10  17 e7 49 49 25 3d 4c 49  |.E....E...II%=LI|
000086d0  25 82 20 4a 4a 25 3d 4c  4a 25 3d a3 0d 45 1a 05  |%. JJ%=LJ%=..E..|
000086e0  cd 0d 45 24 12 e7 49 49  25 3c 4c 49 25 49 49 25  |..E$..II%<LI%II%|
000086f0  2b 3d 31 0d 45 2e 12 e7  4a 4a 25 3c 4c 4a 25 4a  |+=1.E...JJ%<LJ%J|
00008700  4a 25 2b 3d 31 0d 45 38  15 fd 49 49 25 3d 4c 49  |J%+=1.E8..II%=LI|
00008710  25 80 20 4a 4a 25 3d 4c  4a 25 0d 45 42 06 3d b9  |%. JJ%=LJ%.EB.=.|
00008720  0d 45 6a 1b dd f2 61 62  6f 72 74 28 77 68 79 24  |.Ej...abort(why$|
00008730  2c 66 61 69 6c 63 6f 64  65 25 29 0d 45 74 0b ea  |,failcode%).Et..|
00008740  64 75 6d 6d 79 24 0d 45  7e 06 ea 85 0d 45 88 07  |dummy$.E~....E..|
00008750  ee 85 87 0d 45 9c 0a e7  9f 3d 31 37 8c 0d 45 a6  |....E....=17..E.|
00008760  20 f2 6d 65 73 73 61 67  65 5f 70 72 69 6e 74 5f  | .message_print_|
00008770  30 28 22 55 73 65 72 51  75 69 74 22 29 0d 45 b0  |0("UserQuit").E.|
00008780  0b f2 66 69 6e 69 73 68  0d 45 ba 05 cd 0d 45 ce  |..finish.E....E.|
00008790  15 e7 6d 73 67 73 5f 66  69 6c 65 5f 6f 70 65 6e  |..msgs_file_open|
000087a0  25 8c 0d 45 d8 2d f2 6d  65 73 73 61 67 65 5f 70  |%..E.-.message_p|
000087b0  72 69 6e 74 5f 32 28 22  48 46 6f 72 6d 46 61 69  |rint_2("HFormFai|
000087c0  6c 65 64 22 2c 77 68 79  24 2c c3 28 9e 29 29 0d  |led",why$,.(.)).|
000087d0  45 e2 05 cc 0d 45 ec 2a  f1 27 22 48 46 4f 52 4d  |E....E.*.'"HFORM|
000087e0  20 66 61 69 6c 65 64 20  3a 20 22 3b 77 68 79 24  | failed : ";why$|
000087f0  3b 22 20 61 74 20 6c 69  6e 65 20 22 3b 9e 0d 45  |;" at line ";..E|
00008800  f6 05 cd 0d 46 0a 20 e7  a7 61 75 74 6f 72 65 70  |....F. ..autorep|
00008810  6c 79 24 2c 22 4e 4f 70  72 6f 6d 70 74 73 22 29  |ly$,"NOprompts")|
00008820  3d 30 8c 0d 46 14 15 e7  6d 73 67 73 5f 66 69 6c  |=0..F...msgs_fil|
00008830  65 5f 6f 70 65 6e 25 8c  0d 46 1e 20 f2 6d 65 73  |e_open%..F. .mes|
00008840  73 61 67 65 5f 70 72 69  6e 74 5f 30 28 22 50 72  |sage_print_0("Pr|
00008850  65 73 73 4b 65 79 22 29  0d 46 28 05 cc 0d 46 32  |essKey").F(...F2|
00008860  21 f1 22 50 72 65 73 73  20 52 65 74 75 72 6e 20  |!."Press Return |
00008870  74 6f 20 63 6f 6e 74 69  6e 75 65 20 22 3b 0d 46  |to continue ";.F|
00008880  3c 05 cd 0d 46 46 0d e8  22 22 64 75 6d 6d 79 24  |<...FF..""dummy$|
00008890  0d 46 50 05 cd 0d 46 5a  0b f2 66 69 6e 69 73 68  |.FP...FZ..finish|
000088a0  0d 46 64 05 e1 0d 46 8c  0c dd f2 66 69 6e 69 73  |.Fd...F....finis|
000088b0  68 0d 46 96 1b 2a 73 65  74 20 48 46 6f 72 6d 24  |h.F..*set HForm$|
000088c0  45 6e 64 53 74 61 74 75  73 20 32 30 0d 46 a0 09  |EndStatus 20.F..|
000088d0  f2 65 78 69 74 0d 46 aa  05 e1 0d 46 d2 0a dd f2  |.exit.F....F....|
000088e0  65 78 69 74 0d 46 dc 17  f2 63 6c 6f 73 65 5f 6d  |exit.F...close_m|
000088f0  65 73 73 61 67 65 5f 66  69 6c 65 0d 46 e6 05 e0  |essage_file.F...|
00008900  0d 46 f0 05 e1 0d 47 0e  1b dd f2 72 65 73 74 6f  |.F....G....resto|
00008910  72 65 70 61 72 61 6d 73  28 69 66 61 63 65 25 29  |reparams(iface%)|
00008920  0d 47 18 0c e7 69 66 61  63 65 25 8c 0d 47 22 10  |.G...iface%..G".|
00008930  f2 72 65 73 74 6f 72 65  50 52 4f 44 0d 47 2c 05  |.restorePROD.G,.|
00008940  cc 0d 47 36 11 f2 72 65  73 74 6f 72 65 53 54 35  |..G6..restoreST5|
00008950  30 36 0d 47 40 05 cd 0d  47 4a 05 e1 0d 47 68 11  |06.G@...GJ...Gh.|
00008960  dd f2 72 65 73 74 6f 72  65 50 52 4f 44 0d 47 72  |..restorePROD.Gr|
00008970  07 f7 2b 31 0d 47 7c 05  e1 0d 48 08 5d dc 20 43  |..+1.G|...H.]. C|
00008980  6f 6e 6e 65 72 20 50 65  72 69 70 68 65 72 61 6c  |onner Peripheral|
00008990  73 20 34 30 4d 42 20 2d  20 43 50 33 30 34 34 2c  |s 40MB - CP3044,|
000089a0  20 20 20 20 20 20 20 20  20 20 54 79 70 65 43 50  |          TypeCP|
000089b0  33 30 34 34 2c 20 20 20  20 20 34 30 2c 20 20 34  |3044,     40,  4|
000089c0  2c 20 20 35 32 36 2c 20  31 2c 20 30 2c 20 20 35  |,  526, 1, 0,  5|
000089d0  32 35 2c 20 20 30 0d 48  26 5d dc 20 43 6f 6e 6e  |25,  0.H&]. Conn|
000089e0  65 72 20 50 65 72 69 70  68 65 72 61 6c 73 20 34  |er Peripherals 4|
000089f0  32 4d 42 20 2d 20 43 50  32 30 34 34 2c 20 20 20  |2MB - CP2044,   |
00008a00  20 20 20 20 20 20 20 54  79 70 65 43 50 32 30 34  |       TypeCP204|
00008a10  34 50 4b 2c 20 20 20 33  38 2c 20 20 34 2c 20 20  |4PK,   38,  4,  |
00008a20  35 34 38 2c 20 31 2c 20  30 2c 20 20 35 34 37 2c  |548, 1, 0,  547,|
00008a30  20 20 30 0d 48 30 5d dc  20 43 6f 6e 6e 65 72 20  |  0.H0]. Conner |
00008a40  50 65 72 69 70 68 65 72  61 6c 73 20 36 33 4d 42  |Peripherals 63MB|
00008a50  20 2d 20 43 50 32 30 36  34 2c 20 20 20 20 20 20  | - CP2064,      |
00008a60  20 20 20 20 54 79 70 65  43 50 32 30 36 34 2c 20  |    TypeCP2064, |
00008a70  20 20 20 20 33 38 2c 20  20 34 2c 20 20 38 32 33  |    38,  4,  823|
00008a80  2c 20 31 2c 20 30 2c 20  20 38 32 32 2c 20 20 30  |, 1, 0,  822,  0|
00008a90  0d 48 3a 5d dc 20 43 6f  6e 6e 65 72 20 50 65 72  |.H:]. Conner Per|
00008aa0  69 70 68 65 72 61 6c 73  20 32 31 30 4d 42 20 2d  |ipherals 210MB -|
00008ab0  20 43 46 53 32 31 30 41  2c 20 20 20 20 20 20 20  | CFS210A,       |
00008ac0  20 54 79 70 65 43 46 53  32 31 30 41 2c 20 20 20  | TypeCFS210A,   |
00008ad0  20 33 38 2c 20 31 36 2c  20 20 36 38 35 2c 20 31  | 38, 16,  685, 1|
00008ae0  2c 20 30 2c 20 20 36 38  34 2c 20 20 30 0d 48 44  |, 0,  684,  0.HD|
00008af0  5d dc 20 43 6f 6e 6e 65  72 20 50 65 72 69 70 68  |]. Conner Periph|
00008b00  65 72 61 6c 73 20 32 37  30 4d 42 20 2d 20 43 46  |erals 270MB - CF|
00008b10  53 32 37 30 41 2c 20 20  20 20 20 20 20 20 54 79  |S270A,        Ty|
00008b20  70 65 43 46 53 32 37 30  41 2c 20 20 20 20 36 33  |peCFS270A,    63|
00008b30  2c 20 31 34 2c 20 20 36  30 30 2c 20 31 2c 20 30  |, 14,  600, 1, 0|
00008b40  2c 20 20 35 39 39 2c 20  20 30 0d 48 4e 5d dc 20  |,  599,  0.HN]. |
00008b50  43 6f 6e 6e 65 72 20 50  65 72 69 70 68 65 72 61  |Conner Periphera|
00008b60  6c 73 20 34 32 30 4d 42  20 2d 20 43 46 53 34 32  |ls 420MB - CFS42|
00008b70  30 41 2c 20 20 20 20 20  20 20 20 54 79 70 65 43  |0A,        TypeC|
00008b80  46 53 34 32 30 41 2c 20  20 20 20 36 33 2c 20 31  |FS420A,    63, 1|
00008b90  36 2c 20 20 38 32 36 2c  20 31 2c 20 30 2c 20 20  |6,  826, 1, 0,  |
00008ba0  38 32 35 2c 20 20 30 0d  48 58 5d dc 20 43 6f 6e  |825,  0.HX]. Con|
00008bb0  6e 65 72 20 50 65 72 69  70 68 65 72 61 6c 73 20  |ner Peripherals |
00008bc0  34 32 35 4d 42 20 2d 20  43 46 53 34 32 35 41 2c  |425MB - CFS425A,|
00008bd0  20 20 20 20 20 20 20 20  54 79 70 65 43 46 53 34  |        TypeCFS4|
00008be0  32 35 41 2c 20 20 20 20  36 32 2c 20 31 36 2c 20  |25A,    62, 16, |
00008bf0  20 38 33 39 2c 20 31 2c  20 30 2c 20 20 38 33 38  | 839, 1, 0,  838|
00008c00  2c 20 20 30 0d 48 62 5d  dc 20 43 6f 6e 6e 65 72  |,  0.Hb]. Conner|
00008c10  20 50 65 72 69 70 68 65  72 61 6c 73 20 38 35 30  | Peripherals 850|
00008c20  4d 42 20 2d 20 43 46 53  38 35 30 41 2c 20 20 20  |MB - CFS850A,   |
00008c30  20 20 20 20 20 54 79 70  65 43 46 53 38 35 30 41  |     TypeCFS850A|
00008c40  2c 20 20 20 20 36 33 2c  20 31 36 2c 20 31 36 35  |,    63, 16, 165|
00008c50  31 2c 20 31 2c 20 30 2c  20 31 36 35 30 2c 20 20  |1, 1, 0, 1650,  |
00008c60  31 0d 48 76 9a dc 20 4f  54 48 45 52 2c 20 20 20  |1.Hv.. OTHER,   |
00008c70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00008c90  20 20 54 79 70 65 4f 54  48 45 52 2c 20 20 20 20  |  TypeOTHER,    |
00008ca0  20 20 31 2c 20 20 31 2c  20 20 31 2c 20 20 20 31  |  1,  1,  1,   1|
00008cb0  2c 20 31 2c 20 20 31 2c  20 31 3a 20 52 45 4d 20  |, 1,  1, 1: REM |
00008cc0  4d 75 73 74 20 62 65 20  6c 61 73 74 2c 20 6e 75  |Must be last, nu|
00008cd0  6d 62 65 72 73 20 69 72  72 65 6c 65 76 61 6e 74  |mbers irrelevant|
00008ce0  20 28 65 78 63 65 70 74  20 6d 75 73 74 20 62 65  | (except must be|
00008cf0  20 6e 6f 6e 20 7a 65 72  6f 29 2e 0d 48 8a 12 dd  | non zero)..H...|
00008d00  f2 72 65 73 74 6f 72 65  53 54 35 30 36 0d 48 94  |.restoreST506.H.|
00008d10  07 f7 2b 31 0d 48 9e 05  e1 0d 48 c6 5c dc 20 32  |..+1.H....H.\. 2|
00008d20  30 4d 62 20 4d 69 6e 69  73 63 72 69 62 65 20 38  |0Mb Miniscribe 8|
00008d30  34 32 35 2c 20 20 20 20  20 20 20 20 20 20 20 20  |425,            |
00008d40  20 20 20 20 20 20 20 20  20 20 54 79 70 65 38 34  |          Type84|
00008d50  32 35 2c 20 20 20 20 20  20 20 33 32 2c 20 34 2c  |25,       32, 4,|
00008d60  20 36 31 35 2c 20 26 33  46 46 2c 20 20 31 32 38  | 615, &3FF,  128|
00008d70  2c 20 36 36 33 0d 48 d0  5c dc 20 35 33 4d 62 20  |, 663.H.\. 53Mb |
00008d80  52 6f 64 69 6d 65 20 52  4f 33 30 36 35 2c 20 20  |Rodime RO3065,  |
00008d90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008da0  20 20 20 20 20 20 54 79  70 65 52 4f 33 30 36 35  |      TypeRO3065|
00008db0  2c 20 20 20 20 20 33 32  2c 20 37 2c 20 38 37 32  |,     32, 7, 872|
00008dc0  2c 20 26 33 46 46 2c 20  20 36 35 30 2c 20 38 37  |, &3FF,  650, 87|
00008dd0  31 0d 48 da 5c dc 20 32  30 4d 62 20 4b 61 6c 6f  |1.H.\. 20Mb Kalo|
00008de0  6b 20 4b 4c 33 32 30 2c  20 20 20 20 20 20 20 20  |k KL320,        |
00008df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008e00  20 20 54 79 70 65 4b 4c  33 32 30 2c 20 20 20 20  |  TypeKL320,    |
00008e10  20 20 33 32 2c 20 34 2c  20 36 31 35 2c 20 36 31  |  32, 4, 615, 61|
00008e20  35 2c 20 20 20 33 30 30  2c 20 36 31 35 0d 48 ee  |5,   300, 615.H.|
00008e30  6d dc 20 4f 54 48 45 52  2c 20 20 20 20 20 20 20  |m. OTHER,       |
00008e40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008e50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 54 79  |              Ty|
00008e60  70 65 4f 54 48 45 52 2c  20 20 20 20 20 20 33 32  |peOTHER,      32|
00008e70  2c 20 34 2c 20 36 31 32  2c 20 26 33 46 46 2c 20  |, 4, 612, &3FF, |
00008e80  20 31 32 38 2c 20 36 31  31 3a 52 45 4d 20 4d 55  | 128, 611:REM MU|
00008e90  53 54 20 42 45 20 4c 41  53 54 0d 49 3e 22 dd f2  |ST BE LAST.I>"..|
00008ea0  6f 70 65 6e 5f 6d 65 73  73 61 67 65 5f 66 69 6c  |open_message_fil|
00008eb0  65 28 66 69 6c 65 6e 61  6d 65 24 29 0d 49 48 11  |e(filename$).IH.|
00008ec0  ea 66 6c 61 67 73 25 2c  73 69 7a 65 25 0d 49 52  |.flags%,size%.IR|
00008ed0  36 c8 99 22 4d 65 73 73  61 67 65 54 72 61 6e 73  |6.."MessageTrans|
00008ee0  5f 46 69 6c 65 49 6e 66  6f 22 2c 2c 66 69 6c 65  |_FileInfo",,file|
00008ef0  6e 61 6d 65 24 b8 66 6c  61 67 73 25 2c 2c 73 69  |name$.flags%,,si|
00008f00  7a 65 25 0d 49 5c 36 e7  28 66 6c 61 67 73 25 80  |ze%.I\6.(flags%.|
00008f10  20 31 29 8c 6d 73 67 73  5f 66 69 6c 65 5f 62 75  | 1).msgs_file_bu|
00008f20  66 25 3d 30 8b de 6d 73  67 73 5f 66 69 6c 65 5f  |f%=0..msgs_file_|
00008f30  62 75 66 25 73 69 7a 65  25 0d 49 66 37 c8 99 22  |buf%size%.If7.."|
00008f40  4f 53 5f 4d 6f 64 75 6c  65 22 2c 36 2c 2c 2c 31  |OS_Module",6,,,1|
00008f50  37 2b a9 28 66 69 6c 65  6e 61 6d 65 24 29 b8 2c  |7+.(filename$).,|
00008f60  2c 6d 73 67 73 5f 66 69  6c 65 5f 64 65 73 63 25  |,msgs_file_desc%|
00008f70  0d 49 70 23 24 28 6d 73  67 73 5f 66 69 6c 65 5f  |.Ip#$(msgs_file_|
00008f80  64 65 73 63 25 2b 31 36  29 3d 66 69 6c 65 6e 61  |desc%+16)=filena|
00008f90  6d 65 24 0d 49 7a 4f c8  99 22 4d 65 73 73 61 67  |me$.IzO.."Messag|
00008fa0  65 54 72 61 6e 73 5f 4f  70 65 6e 46 69 6c 65 22  |eTrans_OpenFile"|
00008fb0  2c 6d 73 67 73 5f 66 69  6c 65 5f 64 65 73 63 25  |,msgs_file_desc%|
*
00008fd0  2b 31 36 2c 6d 73 67 73  5f 66 69 6c 65 5f 62 75  |+16,msgs_file_bu|
00008fe0  66 25 0d 49 84 15 6d 73  67 73 5f 66 69 6c 65 5f  |f%.I..msgs_file_|
00008ff0  6f 70 65 6e 25 3d b9 0d  49 8e 1c 6d 73 67 5f 6c  |open%=..I..msg_l|
00009000  6f 6f 6b 75 70 5f 62 75  66 5f 73 69 7a 65 25 3d  |ookup_buf_size%=|
00009010  32 35 36 0d 49 98 28 de  6d 73 67 5f 6c 6f 6f 6b  |256.I.(.msg_look|
00009020  75 70 5f 62 75 66 25 6d  73 67 5f 6c 6f 6f 6b 75  |up_buf%msg_looku|
00009030  70 5f 62 75 66 5f 73 69  7a 65 25 0d 49 a2 05 e1  |p_buf_size%.I...|
00009040  0d 49 d4 18 dd f2 63 6c  6f 73 65 5f 6d 65 73 73  |.I....close_mess|
00009050  61 67 65 5f 66 69 6c 65  0d 49 de 0b ea 66 6c 61  |age_file.I...fla|
00009060  67 73 25 0d 49 e8 06 ea  85 0d 49 f2 07 ee 85 87  |gs%.I.....I.....|
00009070  0d 4a 06 15 e7 6d 73 67  73 5f 66 69 6c 65 5f 6f  |.J...msgs_file_o|
00009080  70 65 6e 25 8c 0d 4a 10  36 c8 99 22 4d 65 73 73  |pen%..J.6.."Mess|
00009090  61 67 65 54 72 61 6e 73  5f 43 6c 6f 73 65 46 69  |ageTrans_CloseFi|
000090a0  6c 65 22 2c 6d 73 67 73  5f 66 69 6c 65 5f 64 65  |le",msgs_file_de|
000090b0  73 63 25 b8 3b 66 6c 61  67 73 25 0d 4a 1a 15 6d  |sc%.;flags%.J..m|
000090c0  73 67 73 5f 66 69 6c 65  5f 6f 70 65 6e 25 3d a3  |sgs_file_open%=.|
000090d0  0d 4a 24 12 e7 28 66 6c  61 67 73 25 80 20 31 29  |.J$..(flags%. 1)|
000090e0  8c f6 0d 4a 2e 05 cd 0d  4a 42 15 e7 6d 73 67 73  |...J....JB..msgs|
000090f0  5f 66 69 6c 65 5f 64 65  73 63 25 8c 0d 4a 4c 2c  |_file_desc%..JL,|
00009100  c8 99 22 4f 53 5f 4d 6f  64 75 6c 65 22 2c 37 2c  |.."OS_Module",7,|
00009110  2c 6d 73 67 73 5f 66 69  6c 65 5f 64 65 73 63 25  |,msgs_file_desc%|
00009120  b8 3b 66 6c 61 67 73 25  0d 4a 56 15 6d 73 67 73  |.;flags%.JV.msgs|
00009130  5f 66 69 6c 65 5f 64 65  73 63 25 3d 30 0d 4a 60  |_file_desc%=0.J`|
00009140  12 e7 28 66 6c 61 67 73  25 80 20 31 29 8c f6 0d  |..(flags%. 1)...|
00009150  4a 6a 05 cd 0d 4a 74 05  e1 0d 4a b0 1c dd a4 6d  |Jj...Jt...J....m|
00009160  65 73 73 61 67 65 5f 6c  6f 6f 6b 75 70 5f 30 28  |essage_lookup_0(|
00009170  74 61 67 24 29 0d 4a ba  28 3d a4 6d 65 73 73 61  |tag$).J.(=.messa|
00009180  67 65 5f 6c 6f 6f 6b 75  70 5f 34 28 74 61 67 24  |ge_lookup_4(tag$|
00009190  2c 22 22 2c 22 22 2c 22  22 2c 22 22 29 0d 4a ce  |,"","","","").J.|
000091a0  22 dd a4 6d 65 73 73 61  67 65 5f 6c 6f 6f 6b 75  |"..message_looku|
000091b0  70 5f 31 28 74 61 67 24  2c 61 72 67 31 24 29 0d  |p_1(tag$,arg1$).|
000091c0  4a d8 2b 3d a4 6d 65 73  73 61 67 65 5f 6c 6f 6f  |J.+=.message_loo|
000091d0  6b 75 70 5f 34 28 74 61  67 24 2c 61 72 67 31 24  |kup_4(tag$,arg1$|
000091e0  2c 22 22 2c 22 22 2c 22  22 29 0d 4a ec 28 dd a4  |,"","","").J.(..|
000091f0  6d 65 73 73 61 67 65 5f  6c 6f 6f 6b 75 70 5f 32  |message_lookup_2|
00009200  28 74 61 67 24 2c 61 72  67 31 24 2c 61 72 67 32  |(tag$,arg1$,arg2|
00009210  24 29 0d 4a f6 2e 3d a4  6d 65 73 73 61 67 65 5f  |$).J..=.message_|
00009220  6c 6f 6f 6b 75 70 5f 34  28 74 61 67 24 2c 61 72  |lookup_4(tag$,ar|
00009230  67 31 24 2c 61 72 67 32  24 2c 22 22 2c 22 22 29  |g1$,arg2$,"","")|
00009240  0d 4b 0a 2e dd a4 6d 65  73 73 61 67 65 5f 6c 6f  |.K....message_lo|
00009250  6f 6b 75 70 5f 33 28 74  61 67 24 2c 61 72 67 31  |okup_3(tag$,arg1|
00009260  24 2c 61 72 67 32 24 2c  61 72 67 33 24 29 0d 4b  |$,arg2$,arg3$).K|
00009270  14 31 3d a4 6d 65 73 73  61 67 65 5f 6c 6f 6f 6b  |.1=.message_look|
00009280  75 70 5f 34 28 74 61 67  24 2c 61 72 67 31 24 2c  |up_4(tag$,arg1$,|
00009290  61 72 67 32 24 2c 61 72  67 33 24 2c 22 22 29 0d  |arg2$,arg3$,"").|
000092a0  4b 28 34 dd a4 6d 65 73  73 61 67 65 5f 6c 6f 6f  |K(4..message_loo|
000092b0  6b 75 70 5f 34 28 74 61  67 24 2c 61 72 67 31 24  |kup_4(tag$,arg1$|
000092c0  2c 61 72 67 32 24 2c 61  72 67 33 24 2c 61 72 67  |,arg2$,arg3$,arg|
000092d0  34 24 29 0d 4b 32 09 ea  6c 65 6e 25 0d 4b 3c 77  |4$).K2..len%.K<w|
000092e0  c8 99 22 4d 65 73 73 61  67 65 54 72 61 6e 73 5f  |.."MessageTrans_|
000092f0  47 53 4c 6f 6f 6b 75 70  22 2c 6d 73 67 73 5f 66  |GSLookup",msgs_f|
00009300  69 6c 65 5f 64 65 73 63  25 2c 74 61 67 24 2c 6d  |ile_desc%,tag$,m|
00009310  73 67 5f 6c 6f 6f 6b 75  70 5f 62 75 66 25 2c 6d  |sg_lookup_buf%,m|
00009320  73 67 5f 6c 6f 6f 6b 75  70 5f 62 75 66 5f 73 69  |sg_lookup_buf_si|
00009330  7a 65 25 2c 61 72 67 31  24 2c 61 72 67 32 24 2c  |ze%,arg1$,arg2$,|
00009340  61 72 67 33 24 2c 61 72  67 34 24 b8 2c 2c 2c 6c  |arg3$,arg4$.,,,l|
00009350  65 6e 25 0d 4b 46 1b 6d  73 67 5f 6c 6f 6f 6b 75  |en%.KF.msg_looku|
00009360  70 5f 62 75 66 25 3f 6c  65 6e 25 3d 31 33 0d 4b  |p_buf%?len%=13.K|
00009370  50 15 3d 24 6d 73 67 5f  6c 6f 6f 6b 75 70 5f 62  |P.=$msg_lookup_b|
00009380  75 66 25 0d 4b 82 1b dd  f2 6d 65 73 73 61 67 65  |uf%.K....message|
00009390  5f 70 72 69 6e 74 5f 30  28 74 61 67 24 29 0d 4b  |_print_0(tag$).K|
000093a0  8c 26 f2 6d 65 73 73 61  67 65 5f 70 72 69 6e 74  |.&.message_print|
000093b0  5f 34 28 74 61 67 24 2c  22 22 2c 22 22 2c 22 22  |_4(tag$,"","",""|
000093c0  2c 22 22 29 0d 4b 96 05  e1 0d 4b aa 21 dd f2 6d  |,"").K....K.!..m|
000093d0  65 73 73 61 67 65 5f 70  72 69 6e 74 5f 31 28 74  |essage_print_1(t|
000093e0  61 67 24 2c 61 72 67 31  24 29 0d 4b b4 29 f2 6d  |ag$,arg1$).K.).m|
000093f0  65 73 73 61 67 65 5f 70  72 69 6e 74 5f 34 28 74  |essage_print_4(t|
00009400  61 67 24 2c 61 72 67 31  24 2c 22 22 2c 22 22 2c  |ag$,arg1$,"","",|
00009410  22 22 29 0d 4b be 05 e1  0d 4b d2 27 dd f2 6d 65  |"").K....K.'..me|
00009420  73 73 61 67 65 5f 70 72  69 6e 74 5f 32 28 74 61  |ssage_print_2(ta|
00009430  67 24 2c 61 72 67 31 24  2c 61 72 67 32 24 29 0d  |g$,arg1$,arg2$).|
00009440  4b dc 2c f2 6d 65 73 73  61 67 65 5f 70 72 69 6e  |K.,.message_prin|
00009450  74 5f 34 28 74 61 67 24  2c 61 72 67 31 24 2c 61  |t_4(tag$,arg1$,a|
00009460  72 67 32 24 2c 22 22 2c  22 22 29 0d 4b e6 05 e1  |rg2$,"","").K...|
00009470  0d 4b fa 2d dd f2 6d 65  73 73 61 67 65 5f 70 72  |.K.-..message_pr|
00009480  69 6e 74 5f 33 28 74 61  67 24 2c 61 72 67 31 24  |int_3(tag$,arg1$|
00009490  2c 61 72 67 32 24 2c 61  72 67 33 24 29 0d 4c 04  |,arg2$,arg3$).L.|
000094a0  2f f2 6d 65 73 73 61 67  65 5f 70 72 69 6e 74 5f  |/.message_print_|
000094b0  34 28 74 61 67 24 2c 61  72 67 31 24 2c 61 72 67  |4(tag$,arg1$,arg|
000094c0  32 24 2c 61 72 67 33 24  2c 22 22 29 0d 4c 0e 05  |2$,arg3$,"").L..|
000094d0  e1 0d 4c 22 33 dd f2 6d  65 73 73 61 67 65 5f 70  |..L"3..message_p|
000094e0  72 69 6e 74 5f 34 28 74  61 67 24 2c 61 72 67 31  |rint_4(tag$,arg1|
000094f0  24 2c 61 72 67 32 24 2c  61 72 67 33 24 2c 61 72  |$,arg2$,arg3$,ar|
00009500  67 34 24 29 0d 4c 2c 09  ea 6c 65 6e 25 0d 4c 36  |g4$).L,..len%.L6|
00009510  77 c8 99 22 4d 65 73 73  61 67 65 54 72 61 6e 73  |w.."MessageTrans|
00009520  5f 47 53 4c 6f 6f 6b 75  70 22 2c 6d 73 67 73 5f  |_GSLookup",msgs_|
00009530  66 69 6c 65 5f 64 65 73  63 25 2c 74 61 67 24 2c  |file_desc%,tag$,|
00009540  6d 73 67 5f 6c 6f 6f 6b  75 70 5f 62 75 66 25 2c  |msg_lookup_buf%,|
00009550  6d 73 67 5f 6c 6f 6f 6b  75 70 5f 62 75 66 5f 73  |msg_lookup_buf_s|
00009560  69 7a 65 25 2c 61 72 67  31 24 2c 61 72 67 32 24  |ize%,arg1$,arg2$|
00009570  2c 61 72 67 33 24 2c 61  72 67 34 24 b8 2c 2c 2c  |,arg3$,arg4$.,,,|
00009580  6c 65 6e 25 0d 4c 40 26  c8 99 22 4f 53 5f 57 72  |len%.L@&.."OS_Wr|
00009590  69 74 65 4e 22 2c 6d 73  67 5f 6c 6f 6f 6b 75 70  |iteN",msg_lookup|
000095a0  5f 62 75 66 25 2c 6c 65  6e 25 0d 4c 4a 05 e1 0d  |_buf%,len%.LJ...|
000095b0  4c 86 0d dd a4 42 69 67  41 44 46 53 0d 4c 90 12  |L....BigADFS.L..|
000095c0  ea 4d 69 73 63 5f 49 6e  66 6f 50 74 72 25 0d 4c  |.Misc_InfoPtr%.L|
000095d0  9a 06 ea 85 0d 4c a4 0d  ee 85 ea 3a f7 85 3a 3d  |.....L.....:..:=|
000095e0  a3 0d 4c ae 23 c8 99 22  41 44 46 53 5f 4d 69 73  |..L.#.."ADFS_Mis|
000095f0  63 4f 70 22 2c 36 b8 4d  69 73 63 5f 49 6e 66 6f  |cOp",6.Misc_Info|
00009600  50 74 72 25 0d 4c b8 06  f7 85 0d 4c c2 25 3d 28  |Ptr%.L.....L.%=(|
00009610  28 21 4d 69 73 63 5f 49  6e 66 6f 50 74 72 25 29  |(!Misc_InfoPtr%)|
00009620  80 28 31 3c 3c 39 29 29  3d 28 31 3c 3c 39 29 0d  |.(1<<9))=(1<<9).|
00009630  4c d6 0f dd f2 53 68 61  72 65 53 69 7a 65 0d 4c  |L....ShareSize.L|
00009640  e0 0a ea 4c 46 41 55 25  0d 4c ea 1f 4c 46 41 55  |...LFAU%.L..LFAU|
00009650  25 3d 4c 69 6e 6b 42 69  74 73 25 3c 3c 4c 6f 67  |%=LinkBits%<<Log|
00009660  32 41 6c 6c 6f 63 25 0d  4c f4 14 4c 6f 67 32 53  |2Alloc%.L..Log2S|
00009670  68 61 72 65 53 69 7a 65  25 3d 30 0d 4c fe 2c c8  |hareSize%=0.L.,.|
00009680  95 28 32 35 33 2a 28 53  65 63 53 69 7a 65 25 3c  |.(253*(SecSize%<|
00009690  3c 4c 6f 67 32 53 68 61  72 65 53 69 7a 65 25 29  |<Log2ShareSize%)|
000096a0  3c 4c 46 41 55 25 29 0d  4d 08 15 4c 6f 67 32 53  |<LFAU%).M..Log2S|
000096b0  68 61 72 65 53 69 7a 65  25 2b 3d 31 0d 4d 12 05  |hareSize%+=1.M..|
000096c0  ce 0d 4d 1c 20 53 68 61  72 65 53 69 7a 65 25 3d  |..M. ShareSize%=|
000096d0  31 3c 3c 4c 6f 67 32 53  68 61 72 65 53 69 7a 65  |1<<Log2ShareSize|
000096e0  25 0d 4d 26 05 e1 0d 4d  3a 16 dd a4 68 65 78 61  |%.M&...M:...hexa|
000096f0  64 64 72 28 53 65 63 74  6f 72 25 29 0d 4d 44 0f  |ddr(Sector%).MD.|
00009700  ea 68 69 67 68 24 2c 6c  6f 77 24 0d 4d 4e 29 68  |.high$,low$.MN)h|
00009710  69 67 68 24 3d c3 7e 28  53 65 63 74 6f 72 25 3e  |igh$=.~(Sector%>|
00009720  3e 3e 28 33 32 2d 4c 6f  67 32 53 65 63 53 69 7a  |>>(32-Log2SecSiz|
00009730  65 25 29 29 0d 4d 58 12  c8 95 28 a9 28 68 69 67  |e%)).MX...(.(hig|
00009740  68 24 29 3c 38 29 0d 4d  62 13 68 69 67 68 24 3d  |h$)<8).Mb.high$=|
00009750  22 30 22 2b 68 69 67 68  24 0d 4d 6c 05 ce 0d 4d  |"0"+high$.Ml...M|
00009760  76 24 6c 6f 77 24 3d c3  7e 28 53 65 63 74 6f 72  |v$low$=.~(Sector|
00009770  25 3c 3c 28 4c 6f 67 32  53 65 63 53 69 7a 65 25  |%<<(Log2SecSize%|
00009780  29 29 0d 4d 80 11 c8 95  28 a9 28 6c 6f 77 24 29  |)).M....(.(low$)|
00009790  3c 38 29 0d 4d 8a 11 6c  6f 77 24 3d 22 30 22 2b  |<8).M..low$="0"+|
000097a0  6c 6f 77 24 0d 4d 94 05  ce 0d 4d 9e 0f 3d 68 69  |low$.M....M..=hi|
000097b0  67 68 24 2b 6c 6f 77 24  0d ff                    |gh$+low$..|
000097ba