home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / SOFTWARE / LIBS / PMC101.ZIP / LIBSRC.ZIP / STRNCAT.ASM (.txt) < prev    next >
Assembly Source File  |  1994-06-14  |  787b  |  49 lines

  1. .386p
  2. locals
  3.  
  4. public  STRNCAT
  5.  
  6. _TEXT           segment byte public use32 'CODE'
  7. assume  cs:_TEXT
  8.  
  9. STRNCAT:
  10.         push esi edi
  11.         cld
  12.  
  13.         mov edi,[esp+4+8+08h]
  14.         mov edx,edi
  15.         or ecx,-1
  16.         xor al,al
  17.         repne scasb
  18.         lea esi,[edi-1]
  19.  
  20.         mov edi,[esp+4+8+04h]
  21.         or ecx,-1
  22.         repne scasb
  23.         not ecx
  24.         sub edi,ecx
  25.         dec ecx
  26.         mov eax,edx
  27.  
  28.         mov edx,[esp+4+8+00h]
  29.         cmp ecx,edx
  30.         jbe short @@00
  31.         mov ecx,edx
  32.  
  33. @@00:
  34.         xchg edi,esi
  35.         mov edx,ecx
  36.         shr ecx,2
  37.         rep movsd
  38.         mov ecx,edx
  39.         and ecx,3
  40.         rep movsb
  41.         mov byte ptr [edi],0
  42.  
  43.         pop edi esi
  44.         ret 0ch
  45.  
  46. _TEXT           ends
  47. end
  48.  
  49.