home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / TASMSWAN.ZIP / CFILL.ASM < prev    next >
Assembly Source File  |  1989-07-17  |  622b  |  32 lines

  1. %TITLE "Fill C Strings--External module demo"
  2.  
  3.     IDEAL
  4.     MODEL    small
  5.  
  6.     CODESEG
  7.  
  8.     PUBLIC    _fillstring
  9.  
  10. %NEWPAGE
  11. ;-----------------------------------------------------------------------------
  12. ;  void fillstring(unsigned char far * thestring, int strlength, char fillchar)
  13. ;-----------------------------------------------------------------------------
  14. PROC    _fillstring    NEAR
  15.     ARG thestring:Dword, stringlength:Word, fillchar:Byte
  16.  
  17.     push    bp
  18.     mov    bp,sp
  19.     mov    cx,[stringlength]
  20.     jcxz    @@99
  21.     push    di
  22.     les    di,[thestring]
  23.     mov    al, [fillchar]
  24.     repnz    stosb
  25.     pop    di
  26. @@99:
  27.     pop    bp
  28.     ret
  29. ENDP _fillstring
  30.  
  31.     END
  32.