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 / BEEHIVE / ZSUS / Z3HELP-3.LBR / L.LBR / LED.HZP / LED.HLP
Text File  |  2000-06-30  |  3KB  |  118 lines

  1. ;
  2.                                     LED.REL                                   
  3.  
  4.              Size (recs) CRC   Version    Author/Latest Issue      Disk
  5.                2k (11)   E6BD  1.0        Paul Pomerleau 8/87      Z3COM5
  6.  
  7.   1- Notes  2- Example of Usage                                               
  8.  
  9.  
  10.    Line EDitor is a subset of the EASE editor.  It can be included in any non-
  11. commercial program.
  12.  
  13. :1
  14.  
  15. Notes:
  16.  
  17. On entry:
  18.   BC = length of buffer
  19.   DE = buffer location
  20.   A  = command bits
  21.     0 (low bit) -- Zero = ignore BC and HL, use previous values
  22.     1        -- One  = Set the insert
  23.            Zero = Leave it as user set it last edit
  24.     2        -- One  = Insert On
  25.            Zero = Insert Off
  26.     3        -- One  = Initailize position (start at first char)
  27.            Zero = Same position as last edit
  28.             (Values for BC and DE must be the same as last edit)
  29.     4        -- One  = Output the line
  30.            Zero = Use output of last edit (Bit 3 should be One)
  31.  
  32.  
  33. Notes (continued):
  34.  
  35. On exit:
  36.   BC = length of input
  37.   A  = return code
  38.     0 = Normal "Done"
  39.     1 = Extension command #1
  40.     2 = Extension command #2
  41.     etc.
  42.  
  43.  
  44. Notes (continued):
  45.  
  46. Data needed:
  47.         A  buffer pointed to  by DE which  is  two bytes  longer  than 
  48.         length required.   The first  location  must  be contain  a zero.  Any
  49.         string terminated by a zero may follow.
  50.       Example:  BUFFER:      db    0,'Hello, World!',0
  51.  
  52.         A  kill buffer  of  the  name KILL (made PUBLIC) and KILSIZ, a
  53.         PUBLIC equate, which specifies how long  KILL is.   KILL must  be  one 
  54.         byte longer than KILSIZ claims it to be and must contain a string 
  55.         ending with a zero.
  56.       Example:
  57.     kilsize    equ    1000
  58.     KILL:    db    'Blech.',0
  59.         ds    kilsiz + 1 - 7 ; (Length) + (1) - (Length of 'Blech.')
  60.         public    kilsiz, KILL
  61.  
  62.  
  63. Notes (continued):
  64.  
  65.         A list of command keys and an equate stating how long the list
  66.         is.   Both  made public.   Uppercase characters  representing  control 
  67.         chars and the high bit set representing a preceeding Meta key.
  68.         After all standard LED functions are acounted for, the program
  69.         may include other keys which will return control to the program with a
  70.     Extension Command Number in A.
  71.       Example:
  72.     CMDLST:    db    'QDSEXAF','S'+80h,'D'+80h,'G','H',127,'T',
  73.         db    127+80h,'R','Y'+80h,'YUVIPWMC'
  74.         db    'N'+80h        ; Extension Command #1
  75.     cmdlen    equ    $ - CMDLST
  76.         public    CMDLST, cmdlen
  77.  
  78. :2
  79.  
  80. Example of Usage:
  81.  
  82.         public    CMDLST, cmdlen, KILL, kilsiz
  83.         ext    LED
  84.  
  85.         org    100h
  86.  
  87. RE_EDIT:    xor    a
  88.         ld    (KILL),a    ; Make sure there's nothing to UNDO
  89.         ld    bc,size
  90.         ld    de,BUFFER+1
  91.         ld    (de),a
  92.         dec    de
  93.         ld    (de),a        ; Clear the buffer -- No initial text
  94.         ld    a,00011111b    ; Do output,
  95.                     ; Start at first char,
  96.                     ; Insert On,
  97.                     ; Set insert,
  98.                     ; Use BC, HL.
  99.  
  100.  
  101. Example of Usage (continued):
  102.  
  103.         call    LED
  104.         or    a        ; Was <^Q><^N> hit?
  105.         jr    nz,RE_EDIT    ; nz = Yes
  106.         ld    a,c        ; Get the length in A
  107.         ret
  108.  
  109. BUFFER:        db    0,'Xyz inc.',0
  110.         ds    50
  111. size        equ    $ - BUFFER - 2
  112. CMDLST:        db    'QDSEXAF','S'+80h,'D'+80h,'G','H',127,'T',
  113.         db    127+80h,'R','Y'+80h,'YUVIPWMC'
  114. cmdlen        equ    $ - CMDLST
  115. kilsize        equ    1000
  116. KILL:        db    'Blech.',0
  117.         ds    KILSIZ + 1 - 7    ; (Length) + (1) - (Length of 'Blech.')
  118.