qASSEMBLYNOT CLEAND18COMCLEAND18CRC+!'CLEAND18FOR/wCLEAND18MZC1qqCLEANDIRHZS/READTHISNOW ݉SPEED NOTVWARNING !!! G Notes on reassembling CLEAND18: This version was developed and assembled with SLR System's SLR180 Plus--in my opinion, the finest assembler package ever made available for Z80-based computer systems. I assembled the source with ZAS 2.4, and got 52 (!) assembly errors--mostly flagging the 'ext' defined symbols at the beginning of the file as, first 'M'ultiply-defined, then as 'U'ndefined, and giving 'V'alue errors for half the relative jumps in the program. (Yes, I tried 'extrn' too--no luck). I know David McCord likes to keep Z-system tools in such a form that they are able to be assembled by ZAS. I really did try, but, when ZAS bombed out so badly on this source (much of it unchanged from Version 1.4, the version he modified explicitly so it WOULD assemble with ZAS), I gave up. If and when ZAS ever grows up into a usable product, I will be glad to support it. Until then, I can't recommend the SLR family of assembler products strongly enough-- and I can't recommend ZAS at all. The problem is probably mostly my lack of knowledge of the idiosyncrasies of ZAS. If you do get this version to assemble with ZAS, I would appreciate a message telling me what I did wrong, so I can come closer to ZAS compatibility in the future. Leave me a note on ZNode Central or on Seattle's 'downspout', ZNode #12, at 206-325-1325. Note that this version allocates a smaller-than-usual amount of space for the stack--50 bytes. This should be more than sufficient for most systems, since the most that is on the stack at any BIOS entry is 10 bytes (on the call to SECTRN; all other BIOS calls have 8 or less bytes on the stack). Unless your BIOS read or write routines take more than 40 bytes of stack space, you should have no problem. If you, do, just change the amount of space for the stack to a larger value and reassemble. Note that this will reduce the amount of space available for directory entries. HOWEVER, note also that this version was assembled with a custom version of SYSLIB that has the COUT routine do its output via a BDOS call rather than a BIOS call. This allows for printer echo of all program output, and also makes the amount of stack space available on console output calls irrelevant, since BDOS/ZRDOS switches to a local stack. If you reassemble CLEANDIR and link it with the standard SYSLIB, COUT will use direct BIOS console output calls, and you will need to make sure you have enough stack space for those also. Steve Dirickson 14 June 1987  Z3ENV* G *KB *' 2"! "b!r w#8 >2t) y CLEANDIR, Version 1.8:]/E6:^6:m6:n6\M 2# Oy Disk yÁ  ^#VSl ~#fo*####"f"h*[! R}OD 6#"\y --> Reading, *)"j!"dS~(@ V##~#^ 5y Zero Length File: !z4#~-( ( $*v#"v"n*\Rڴ [bSb*h+"h|":z(&y y files of zero-length *vT]##"`))R)))))}2{G*fRx(+"^|y Sorting (:r(y Descending y Ascendingy Order), *n"*! "! "*#"}  *nR"!""- x """O~Gy # x F:r(8<07Fwx# x *|/W}/_*0#"**{ozg"*#""*}|E*[{y Checking, !"n*n+"|[|!  0#y Duplicate directory entry --> >2u*n#"n[vR !"n+"|~ 0@ #~ 8\`0X*(T,(P:8@8H#~ 0^###~0t*n#[vR Jy User # > 31 --> >2uy Illegal file name --> y Extent # > 31, --> y Recd count > 80h --> !:" C "n"p+"|"~*|K *|"~&n:"(f|(R^:"(Vz(R#:"(#*p#"p*vR(+"~K #:"(#*n"p #[vR[:sW:u™y Writing, *)"j!"x*! "d*`"h>2 *h|(+"h: = !"dSD*^"h:# O! ()%y Done:u( :t /) y Not enough memory to read directory.*|~ y :H y y Two files use allocation block :"( }( *~>2u!6#Kd Kj Kx  1 L[x*+R0 *j#"jSx*d"dy READ ERROR - No Change Madeéy WRITE ERROR - Directory Left in UNKNOWN Conditioné*!   KvN##~qw x ɷ|g}o)))))[! C 2sD2ry Syntax: CLEANDIR dir: o Options: C - Check only - don't rewrite directory D - sort in Descending Order (users and files) Note: Only disk ref is used in dir: formé[l$ : gDM 8 w*K "~#fo"K GO> ́  Ä |( }(  d   0́   _y  > ́ {y0́ {7 7  C 7Á 0Á  e >.́ e yw  s e Á > ́ w _ Filename.Typ Size Recs CRC Comment ASSEMBLY.NOT 4K 20 22F2 CLEAND18.COM 4K 20 4F91 CLEAND18.FOR 4K 2 0A35 CLEAND18.MZC 16K 113 AAC7 CRC after uncrunching = 864D CLEANDIR.HZS 8K 47 E870 CRC after uncrunching = D494 READTHIS.NOW 4K 12 3914 SPEED .NOT 4K 17 2996 WARNING .!!! 4K 12 6956 Version 1.8 of the ZCPR3 directory sort/cleanup utility corrects an error that caused the program to crash the system if it tried to clean up the directory of a disk that had nothing except erased or zero-length entries in the directory. vCLEAND18.MAC# J#ya60A' % h*1#M3n#@t4DCID0.4bIoǦ&69KTjAac!.3\&K#aw r)|DsT2!l4'Ilc39MLsʧ:ȀF cary\* v$ s h0£M-3MhYRU<81=oMN99 )UC6M kR-mV3C]R02JFJ9+k)F TU5V _' Bu-9zGypucݑ5O1BBP.F!t9d 8j_$nѼvbYQ݀hfAסL&؈UR|ᅹAPV) P )"fS @lQ c킚V5yMjM%*LMSQ-Pakq]L~WVAuƅ~Oof豄bAunɽ-Q y(>T=6qjA\1!veCE -[؍ bʓIh11@R a]fp !OhR0>aRCTHH.2h3D[/CE #5ad"+(cb 9DPALY$BNFg@VfVXg|h q$NA OwPCDHx L 8csxwOAEO72yDaL]u̦ ZzBSvN&@%(14}P !,b:GtP"0AL1+ppB"23lRD"`v7b;P8njSL2HKp4xsjBb h(sjfRCPp!M>)- =x ?%$1$I{b̙Q4b@ mY5”˴F)hA}6@`,bc>:5*$)1$.j#bTzU&Ui;r 6J ͩX'hvQUvVg**9K5D+ $q<͉WZ]ϕ Sr;4&I!)3Z+5=kSQ(4B5(,t,-L1sY T,ruR6̦n^k+EjƷ@֚r쉆&ypRɃrPX"foz)su Vjc y7]Hb` [ZFbly@Q0XWy،5Yn<"4  %2,jJ0vX![4YgPAn7PxPVxOS2Έ_OF{`9$F-p΂}a"+Mr]wCy8҃KJ{I.M!le2.mp(4"Фkx;wZLIn0[P`B g #+٭_h|ugaVQ:Jۘ*XF;6_l2_cPB--ޛ$P F Ǿ!\s6)VV];]bUك9@IHa8 Ͷ<4cL ?1@ wOAoꤠ7GfAT :H( /J˔ AXVAOX %찜8`ٷjݠ$?.;_m"o*Wqn)J;oI9Hp C6Ʊ0"/jqDŽ_/:v MTj + Ao0_͂+p\ ge&6v >W>တaݫ\w\ }0AǂץP1ҰN "adPE k2'kRzwFy n'2~$22ux'l$~g8qx]xF wx!I#O4vXx8R9RM}Nya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=oBVPPʱPKȆVy]L PNE@ Q _7f/q:fc?l$8CQ'uJ9y5 eA@T `@Hc?n:~E'OFR13B[PPVe`I_{V?@V?RWVAPIo.(/IIG/% /S} Ov`A'fHuoOSWpGsPta7$0d]b+8x:A:1,-ռ؄ _fO"=騢D-Ww{d;8;50ҎzP&v(0FE4 0{=7fhfU;;Si@10I˲Y618#,*@\Cq%׊ ?(wH35􌄄ǺIAyYIf you are using ZCPR3 with an unmodified CP/M BDOS, read the WARNING.!!! file BEFORE you use this program. Well, here we go again. At least this time the errors were left over from previously-written sections of the code. Version 1.7 (which still signed on as 1.6--another slip) clobbered the system if it tried to clean an empty disk. This version will properly handle empty disks. It doesn't tell you anything special if it finds the disk empty--I wasn't willing to give up the space just to print a message. It simply skips over the 'Sorting' and 'Checking' sections and goes directly to the directory write. This does provide a handy way to clean out the directory area of an empty disk without having to reformat the entire disk, if you need such a capability. This library contains the following files: READTHIS.NOW You are. SPEED.NOT Notes on the speed of the new version. CLEANDIR.HZS Crunched history of the CLEANDIR utility. CLEAND18.MZC Crunched source to the current version. CLEAND18.COM Assembled version. Z3INStalled with an external environment descriptor at 0fe00h. ASSEMBLY.NOT Notes on reassembling CLEANDIR. WARNING.!!! A warning to users of the CP/M BDOS with ZCPR3. CLEAND18.FOR A 'FOR' file you can extract and use when you upload this library to the next guy. CLEAND18.CRC CRCs on the files before inclusion in the library, including the CRCs of the uncrunched versions of the crunched files. A note on the speed of the new version of CLEANDIR: Basically, this version takes about twice to three times as long as versions before 1.6. Sorry about that, but it is because all versions before 1.6 did not really check all allocation map entries. Specifically, they would only find a duplicated allocation block if it met one of the following: 1) Duplicated one of the blocks allocated to the first (after sorting) entry in the directory, 2) Duplicated the FIRST block allocated to any other directory entry, or 3) Duplicated a block allocated in the SAME directory entry. You can verify this yourself. Save a junk file that has at least two extents. Use DUU, DU3, PATCH, etc. to look at the first extent of the file. Note one of the allocation group #s in the right half of the display. Then find the entry for the next extent of the file, and change one of the allocation group #s, not the first one in the map, to be the same as the # you found in the first extent. Write the modified extent back to the disk, and exit. Run CLEANDIR Version 1.5 or earlier in the 'C'heck mode. It will not tell you about any duplicate allocations. Now run Version 1.8. It WILL find the duplicated allocation group. Some specifics: on my 9.216 MHz SB180, Version 1.8 takes 49 seconds to do allocation checking on a directory with 1000 groups allocated (a little less than 4 Megabytes). Since the procedure is completely compute-bound, you can calculate how long it will take to check your disk by scaling this figure for your processor speed and the number of groups allocated in your directory (remember, the maximum number of entries the disk can have, called 'DRM', no longer means anything. Only active directory entries are seen by CLEANDIR). So don't panic when it seems to take forever compared to the previous versions. It is doing a lot of comparisons (anybody know offhand the value of 999! ?). As a worst-case example, a 2 MHz Z80 checking the directory of a filled 8 Meg disk would take almost 7 minutes! Steve Dirickson 14 June 1987 If you are using ZCPR3 with CP/M's unmodified BDOS, D O N O T U S E T H I S P R O G R A M A S I S !!!! The assembled version of CLEANDIR included in this library uses DOS function 37 to reset the disk and force the DOS to reinitialize the allocation map, as long as it detects no errors in the cleaned-up directory. This is necessary for ZRDOS Version 1.5 and later (either by having the program do it, or by running DISKRST as the first thing you do after CLEANDIR finishes) , and it causes no harm (although you may detect a VERY slight additional delay after it writes the disk before you get the system prompt back) with earlier versions of ZRDOS. Not true of the CP/M BDOS! The unmodified CP/M 2.x BDOS has a bug in it that causes it to improperly reinitialize its allocation information when function 37 is used, and results in already-allocated blocks being assigned to new files. Or, in simple terms, IT EATS YOUR FILES!. If you are using an unmodified CP/M BDOS, change the definition of the 'ZRD15' variable to FALSE and reassemble the file. For you purists using pre-1.5 ZRDOS, this will delete a little extraneous code (not enough for another directory entry) and give you the previously-mentioned small (like milliseconds) speedup. Sorry for the inconvenience, but I think most Z-system users have some version of ZRDOS, so I have provided the version that will best fit the largest number of users.