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 / CPM / ZCPR33 / A-R / LED02.LBR / LED.DOC next >
Text File  |  2000-06-30  |  3KB  |  106 lines

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