home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / tcj / wsshloff.z80 < prev   
Encoding:
Text File  |  1993-06-07  |  1.5 KB  |  57 lines

  1. ; Program:    WSSHLOFF
  2. ; Author:    Jay Sage
  3. ; Date:        March 26, 1988
  4.  
  5. ; This code is a configuration overlay to correct a problem in the shell
  6. ; handling code in WordStar Release 4.
  7. ;
  8. ; Problem:  Because WordStar runs as a ZCPR3 shell, it is impossible to use
  9. ; WS in a multiple command line with commands intended to execute after WS is
  10. ; finished.  One can disable this by patching the ZCPR3 environment to show
  11. ; zero entries in the shell stack while WS is running.  This effectively
  12. ; disables WS4's shell capability.  Unfortunately, it means that the extended
  13. ; features of the 'R' command under ZCPR3 are also lost.
  14.  
  15. ;---- Addresses
  16.  
  17. initsub    equ    03bbh
  18. exitsub    equ    03beh
  19. morpat    equ    045bh
  20.  
  21. ;---- Patch code
  22.  
  23.     org    initsub        ; Initialization subroutine
  24.  
  25. init:    jp    initpatch
  26.  
  27. ;----
  28.  
  29.     org    exitsub        ; Un-initialization subroutine
  30.  
  31. exit:    jp    exitpatch
  32.  
  33. ;----
  34.  
  35.     org    morpat        ; General patch area
  36.  
  37. initpatch:            ; Initialization patch
  38.     call    getshls        ; Get pointer to shell stack number
  39.     ld    a,(hl)        ; Get number
  40.     ld    (shstks),a    ; Save it for later restoration
  41.     ld    (hl),0        ; Set it to zero to disable shells
  42.     ret
  43.  
  44. exitpatch:            ; Termination patch
  45.     call    getshls        ; Get pointer to shell stack number
  46. shstks    equ    $+1        ; Pointer for code modification
  47.     ld    (hl),0        ; Value supplied by INITPATCH code
  48.     ret
  49.  
  50. getshls:
  51.     ld    hl,(109h)    ; Get ENV address
  52.     ld    de,20h        ; Offset to number of shell entries
  53.     add    hl,de        ; HL points to number of shell entries
  54.     ret
  55.  
  56.     end
  57.