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

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