home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / ZCPR33 / S-Z / STATPAT.ZZ0 / STATPAT.Z80
Text File  |  2000-06-30  |  2KB  |  41 lines

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