; EXLPAT.ASM - Fix initialization problem with output fcb in EXL.COM ; ; Author: Mike Freeman 11-Jun-1991 ; ; The author does not warrant this patch; it works for him. ; Complaints may be sent to: ; Mike Freeman ; 301 N.E. 107th Street ; Vancouver, WA 98685 USA ; Telephone (206)574-8221 ; Internet: FREEMAN@WATSUN.CC.COLUMBIA.EDU ; GEnie: M.FREEMAN11 ; ; The problem: If EXL has been asked to write a file to disk and the ; extension of the output file is not 3 characters in length, the last ; character is set to (yes, that's right, a binary zero) so that the ; file cannot be accessed by CP/M or other utilities until it is renamed via ; NSWEEP, RENAMZ or some such. This file contains a patch to EXL which ; fixes the problem. ; Patch rationale: If EXL has been asked to write a file to disk, the ; output FCB is first initialized before the name of the output file is ; copied into it. This is done with a sequence like: ; ld hl,
; ld de, ; ld bc, ; ld (hl), ; ldir ; which works fine. This is first done to init the filename/filetype to ; blanks (20H). The register HL is left pointing to the last position ; in the filetype, now initialized to a blank. EXL's author wishes to ; init the rest of the FCB to zero. Ideally, he/she (no name is given in ; EXL's documentation) should do the following: ; inc hl ; inc de ; ld bc,20 ; ld (hl),0 ; ldir ; to init the rest of the FCB to 0. However, HL and DE are not incremented ; so that when the ldir is done, the last position in the filetype is zeroed ; and the last position in the FCB is not guaranteed to be 0. This is fixed ; by putting 12 spaces (the first directly and the rest by ldir) into the ; output FCB, thus guaranteeing that HL and DE are properly incremented ; before the rest of the FCB is zeroed. This does no harm since the direct ; zeroing of the byte pointed to by HL, via the author's ; ld (hl),b ;BC is 20 so B=0 ; will overwrite the extra space we added with the first ldir. ; The fix is to copy 11 bytes (each a space) rather than 10 as in the ; original EXL.COM. ; Now to the fix: ; ORG 0653H ;Position to overlay EXL properly ; LXI B,11 ;Have the ldir copy 11 bytes ; ; That's all, folks!