home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / editors / ws4bug.lbr / WSPAT2.ZZ0 / WSPAT2.Z80
Encoding:
Text File  |  1993-06-08  |  2.5 KB  |  63 lines

  1. ;Patch for WS4 to initialize the D/U used for accessing the
  2. ;WS.OVL file.
  3. ;When WS4 is invoked, the WS.COM file is loaded at 100h and executed.
  4. ;Difficulties can arise under ZCPR3 if WS and its overlay are not
  5. ;present in the current (default) directory. In such a case (I keep all
  6. ;these files in a System Utility Directory) WS conducts a search for
  7. ;the WS.OVL file. Eventually, the search employs the ZCPR3 search PATH.
  8. ;Locations ovlusr and ovldrv are searched first, however. These bytes
  9. ;are not part of the loaded image of WS.COM and are not initialized to
  10. ;any particular value at the time they are first used! If the byte at
  11. ;OVLDRV specifies an unimplemented drive, a ZRDOS or BDOS error will
  12. ;occur and WS aborts! If the byte at OVLUSR happens to have its high
  13. ;bit set, then WS aborts with a "can't find WS.COM" message! These bugs
  14. ;appear only sporadically, depending on what happens to be in memory at
  15. ;the time WS is invoked. There are two ways to prevent the aborts:
  16. ;   1) Use POKE 2201 0 and POKE 2202 0 to initialize these bytes before
  17. ;the WS command. Memory utilities, Debuggers, or Monitors can be used
  18. ;to do the same thing. They could be built into an Alias for convenience.
  19. ;   2) Patch the equivalent process into WS itself. This file, when
  20. ;assembled to a HEX file can be used to overlay the patch into WS.
  21.  
  22. ;    ZAS WSPAT2 $HP        <== to produce a HEX and PRN file
  23.  
  24. ;(Other Z80 assemblers can also be used. M80 requires the ASEG; others
  25. ;may not. ZAS, ZMAC, and SLR assemblers accept the ASEG.)
  26. ;The patching is accomplished with MLOAD V2.4...
  27.  
  28. ;    MLOAD WS.COM,WSPAT2
  29.  
  30. ;...to produce the patched file quickly and accurately. As usual, don't
  31. ;do this on your ONLY copy of WS! Always use a copy for modification.
  32.  
  33. ;Alternatively, you can use WSCHANGE to manually enter the code byte-
  34. ;by-byte.
  35.  
  36. ;You may already have patches installed in the MORPAT area. If you
  37. ;do, then change the Hex definition at "morpat equ ..." from 045Bh
  38. ;to a free location in the MORPAT or EXTRA patch area of WS4.
  39.  
  40. ;         Al Hawley, Z-Node #2, (213) 670-9465
  41.  
  42.     ASEG            ;REQUIRED by M80
  43.  
  44. morpat    equ    045bh        ;patch routine goes here
  45. patch2    equ    1ac0h        ;instruction replaced by patch
  46. ovlusr    equ    2201h        ;first user number to search for OVL
  47. ovldrv    equ    2202h        ;first drive to search for OVL
  48. curdrv    equ    220ch        ;location where current drive is stored
  49.  
  50.     org    morpat
  51.  
  52. wspat2:    ld    (ovlusr),a
  53.     ld    a,(curdrv)
  54.     ld    (ovldrv),a
  55.     ld    a,(0007h)    ;the original instruction
  56.     ret
  57.  
  58.     org    patch2
  59.  
  60.     call    wspat2
  61.  
  62.     end
  63.