home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / editors / wscurkey.z80 < prev    next >
Encoding:
Text File  |  1993-06-08  |  2.0 KB  |  89 lines

  1. ;---------------------------------------------------------------------------
  2. ;
  3. ;                              WSCURKEY.Z80
  4. ;
  5. ;                     Date:   May 28, 1990
  6. ;                   Author:  Joseph I. Mortensen
  7. ;
  8. ; patch to WordStar 4.0 to change cursor keys from conventional Kaypro CBIOS
  9. ; values to those used by WordStar.  Restores original values on exit.
  10. ; Adapted for '83 Kaypros from WSKEYPAD.AZM, (C) 1989 by Dale H. Cook
  11. ; There are several possible locations for the main body of this patch
  12. ; within WS.COM 4.0;  For this short patch (and since the space is not needed 
  13. ; for anything else) I used the CRTPAT area.
  14. ;
  15. ; Set the equate for curkey to suit your system.  Examples:
  16. ;       64K system -- curkey = 0fa35h
  17. ;       63K system -- curkey = 0f635h
  18. ;       62.75K system -- curkey = 0f535h
  19. ;       62.5K system -- curkey = 0f435h
  20. ;       62.25K system -- curkey = 0f335h
  21. ;
  22. ; Assemble this file (HEX option).
  23. ; Use MLOAD to patch WS.COM:  mload ws.com,wscurkey.hex   
  24. ;
  25. ;---------------------------equates-------------------------------------
  26. ctrld    equ    04h        ;ws right arrow
  27. ctrle    equ     05h        ;ws up arrow
  28. ctrlh    equ    08h        ;kp left arrow
  29. ctrlj    equ    0ah        ;kp down arrow
  30. ctrlk    equ    0bh        ;kp up arrow
  31. ctrll    equ    0ch        ;kp right arrow
  32. ctrls    equ    13h        ;ws left arrow
  33. ctrlx    equ     18h        ;ws down arrow
  34.  
  35. inisub    equ    03bbh           ;init subroutine loc in WS.COM
  36. unisub    equ    03beh           ;uninit subroutine loc in WS.COM
  37. crtpat    equ    04dbh           ;location of this patch
  38.  
  39. curkey    equ    0f335h        ;bios address for cursor keys (62.25K system)
  40.  
  41.     org    inisub
  42.     jp    myini
  43.  
  44.     org    unisub
  45.     jp    myuni
  46.  
  47.     org     crtpat
  48.  
  49. myini:    
  50.     ld    hl,wskeys
  51.     ld    de,curkey
  52.     ld    b,4
  53.     call    swap
  54.     db    0,0,0c9h
  55.  
  56. myuni:    ld    hl,kpkeys
  57.     ld    de,curkey
  58.     ld     b,4
  59.     call    swap
  60.     db    0,0,0c9h
  61.     
  62. swap:    
  63.     ld    c,(hl)
  64.     ld    a,(de)
  65.     ld    (hl),a
  66.     ld    a,c
  67.     ld    (de),a
  68.     inc    hl
  69.     inc    de
  70.     dec    b
  71.     jp    nz,swap
  72.  
  73.     ret        
  74.  
  75. wskeys:
  76.     db    ctrle
  77.     db    ctrlx
  78.     db    ctrls
  79.     db    ctrld
  80.  
  81. kpkeys:
  82.     db    ctrlk
  83.     db    ctrlj
  84.     db    ctrlh
  85.     db    ctrll
  86.  
  87.     end
  88.