home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / asmlib.lbr / STRBUF.AZM / STRBUF.ASM
Assembly Source File  |  1991-06-25  |  896b  |  37 lines

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