home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / asmutl / asmlib1.lbr / BUFSTR.AYM / BUFSTR.AYM
Encoding:
Text File  |  1994-05-31  |  1.0 KB  |  37 lines

  1. ;----------------------------------------------------------------
  2. ;         This is a module in the ASMLIB library.
  3. ; This module will move a standard console buffer into a 
  4. ; standard string. This also moves the size byte.
  5. ; This allows easy character movement. On entry DE ->
  6. ; start of the console buffer and HL -> the character string.
  7. ;
  8. ;             Written        R.C.H.         1/10/83
  9. ;            Last Update    R.C.H.         1/10/83
  10. ;----------------------------------------------------------------
  11. ;
  12.     name    'bufstr'
  13.     public    bufstr
  14.     maclib    z80
  15. ;
  16. bufstr:
  17. ; Here DE -> buffer (source) , HL -> string (dest).
  18.     push    b            ; Save 
  19.     xchg
  20. ; HL -> buffer (source), DE -> string (dest).
  21.     inx    h            ; Index past the buffer size byte
  22.     mov    a,m            ; Get the the size byte
  23.     ora    a            ; String size = 0 ??
  24.     jrz    bufstrend
  25.     mov    c,a            ; Load the size.
  26.     mvi    b,00            ; Set up the move
  27.     ldir                ; Move the data
  28. ;
  29. bufstrend:
  30.     pop    b
  31.     ret
  32. ;
  33.     end
  34.  
  35.  
  36.