home *** CD-ROM | disk | FTP | other *** search
- ;Patch for WS4 to initialize the D/U used for accessing the
- ;WS.OVL file.
- ;When WS4 is invoked, the WS.COM file is loaded at 100h and executed.
- ;Difficulties can arise under ZCPR3 if WS and its overlay are not
- ;present in the current (default) directory. In such a case (I keep all
- ;these files in a System Utility Directory) WS conducts a search for
- ;the WS.OVL file. Eventually, the search employs the ZCPR3 search PATH.
- ;Locations ovlusr and ovldrv are searched first, however. These bytes
- ;are not part of the loaded image of WS.COM and are not initialized to
- ;any particular value at the time they are first used! If the byte at
- ;OVLDRV specifies an unimplemented drive, a ZRDOS or BDOS error will
- ;occur and WS aborts! If the byte at OVLUSR happens to have its high
- ;bit set, then WS aborts with a "can't find WS.COM" message! These bugs
- ;appear only sporadically, depending on what happens to be in memory at
- ;the time WS is invoked. There are two ways to prevent the aborts:
- ; 1) Use POKE 2201 0 and POKE 2202 0 to initialize these bytes before
- ;the WS command. Memory utilities, Debuggers, or Monitors can be used
- ;to do the same thing. They could be built into an Alias for convenience.
- ; 2) Patch the equivalent process into WS itself. This file, when
- ;assembled to a HEX file can be used to overlay the patch into WS.
-
- ; ZAS WSPAT2 $HP <== to produce a HEX and PRN file
-
- ;(Other Z80 assemblers can also be used. M80 requires the ASEG; others
- ;may not. ZAS, ZMAC, and SLR assemblers accept the ASEG.)
- ;The patching is accomplished with MLOAD V2.4...
-
- ; MLOAD WS.COM,WSPAT2
-
- ;...to produce the patched file quickly and accurately. As usual, don't
- ;do this on your ONLY copy of WS! Always use a copy for modification.
-
- ;Alternatively, you can use WSCHANGE to manually enter the code byte-
- ;by-byte.
-
- ;You may already have patches installed in the MORPAT area. If you
- ;do, then change the Hex definition at "morpat equ ..." from 045Bh
- ;to a free location in the MORPAT or EXTRA patch area of WS4.
-
- ; Al Hawley, Z-Node #2, (213) 670-9465
-
- ASEG ;REQUIRED by M80
-
- morpat equ 045bh ;patch routine goes here
- patch2 equ 1ac0h ;instruction replaced by patch
- ovlusr equ 2201h ;first user number to search for OVL
- ovldrv equ 2202h ;first drive to search for OVL
- curdrv equ 220ch ;location where current drive is stored
-
- org morpat
-
- wspat2: ld (ovlusr),a
- ld a,(curdrv)
- ld (ovldrv),a
- ld a,(0007h) ;the original instruction
- ret
-
- org patch2
-
- call wspat2
-
- end
-