home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / TASMSWAN.ZIP / COPYSTR.ASM < prev    next >
Assembly Source File  |  1989-07-17  |  636b  |  33 lines

  1. %TITLE "Copy String external Turbo C function"
  2.  
  3.     IDEAL
  4.     MODEL    small
  5.  
  6.     CODESEG
  7.  
  8.     PUBLIC    _copystring
  9.  
  10. %NEWPAGE
  11. ;-----------------------------------------------------------------------------
  12. ;  void copystring(unsigned char far * source, unsigned char far * destination, int sourcelen)
  13. ;-----------------------------------------------------------------------------
  14. PROC    _copystring    NEAR
  15.     ARG source:DWord, destination:DWord, sourcelen:Word
  16.  
  17.     push    bp
  18.     mov    bp,sp
  19.     mov    cx,[sourcelen]
  20.     jcxz    @@99
  21.     push    ds
  22.     les    di,[destination]
  23.     lds    si,[source]
  24.     cld
  25.     rep    movsb
  26.     pop    ds
  27. @@99:
  28.     pop    bp
  29.     ret
  30. ENDP _copystring
  31.  
  32.     END
  33.