home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / STR / STRCAT.S < prev    next >
Encoding:
Text File  |  1993-01-02  |  881 b   |  42 lines

  1. / strcat.s (emx+gcc) -- Copyright (c) 1990-1993 by Eberhard Mattes
  2.  
  3.         .globl _strcat
  4.  
  5. / char *strcat (char *string1, const char *string2)
  6. /     {
  7. /     char *dst;
  8. /     dst = string1;
  9. /     while (*dst != 0)
  10. /         ++dst;
  11. /     while ((*dst = *string2) != 0)
  12. /         ++dst, ++string2;
  13. /     return (string1);
  14. /     }
  15.  
  16. / assumes ds=es!
  17.  
  18.         .text
  19.  
  20.         .align  2, 0x90
  21.  
  22. _strcat:
  23.         pushl   %esi
  24.         pushl   %edi
  25.         movl    3*4(%esp), %edi         / string1
  26.         movl    $-1, %ecx
  27.         movb    $0, %al
  28.         repne
  29.         scasb
  30.         decl    %edi
  31.         movl    4*4(%esp), %esi         / string2
  32.         .align  2, 0x90
  33. 1:      lodsb
  34.         stosb
  35.         orb     %al, %al
  36.         jnz     1b
  37.         movl    3*4(%esp), %eax         / string1
  38.         popl    %edi
  39.         popl    %esi
  40.         ret
  41.