home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_12 / 2n12052a < prev    next >
Text File  |  1991-10-29  |  631b  |  19 lines

  1. Function StrCon(Dest:PCHAR;Letter:Char;Width, Size:Integer):PCHAR;
  2.   begin
  3.     StrCon := Dest;          { Return Dest }
  4.     if Dest = NIL then EXIT; { Don't fill a NIL! }
  5.     if Width >= Size then
  6.       Width := Size;         { Always keep in bounds - don't overwrite }
  7.     ASM
  8.        LES   DI, Dest     { Get Address of DEST in ES:DI }
  9.        CLD                { Set direction forward }
  10.        MOV   CX, Width    { count in CX }
  11.        MOV   AL, Letter
  12.        REP   STOSB        { make string of characters }
  13.        MOV   AL, 0        { Null Terminate }
  14.        STOSB              { and store }
  15.     end
  16.   end;
  17.  
  18.  
  19.