; STATPAT.Z80 - Fix STAT.COM to work under ZCPR 3.3 ; Howard Goldstein June 18, 1987 ; Some of the options of DRI's STAT.COM do not work under ZCPR 3.3. ; In particular, the options that end with a colon, such as DSK: DEV:, etc., ; fail because of the way Z33 sets up the default FCB's when it can't resolve ; a directory spec. (That's what it thinks these commands are!) The code in ; this patch checks the bad directory flag in the first default FCB. If ; it is set and the file name field is blank, this code makes the file name ; nonblank and clears the drive byte. When STAT sees the FCB set up in this ; way, it assumes that one of its special commands is present. It then ; processes the command by reading it from the command tail. ; To install this patch, assemble to a HEX file and then overlay STAT.COM using ; MLOAD or a debugger. ORGSTRT EQU 433H ; Start address of STAT (we will overlay ; ..the initial jump to this address) BADDU EQU 15 ; Offset to bad du indicator in FCB TFCB EQU 05CH ; First default FCB ORG 100H ; Patch starts here STATPAT: LD A,(TFCB+BADDU) ; Get bad du indicator OR A JP Z,ORGSTRT ; If zero, go to original STAT code LD HL,TFCB+1 ; Pt to first char of file name LD A,(HL) SUB ' ' ; If file name not blank JP NZ,ORGSTRT ; ..go to original STAT code INC (HL) ; Make file name nonblank DEC HL ; Pt to drive byte LD (HL),A ; Set drive byte to 0 ; A=0 from previous SUB instruction JP ORGSTRT ; All done - go to STAT END