home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / libnix-0.8-src.lha / libnix-0.8 / sources / nix / string / strcat.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  324 b   |  36 lines

  1. #ifndef mc68000
  2.  
  3. #include <string.h>
  4.  
  5. char *strcat(char *s1,const char *s2)
  6.   char *s=s1;
  7.  
  8.   while(*s++)
  9.     ;
  10.  
  11.   --s;
  12.   
  13.   while((*s++=*s2++))
  14.     ;
  15.  
  16.   return s1;
  17. }
  18.  
  19. #else
  20.  
  21. asm("
  22.     .globl    _strcat
  23. _strcat:    
  24.     movml    sp@(4:W),d0/a0
  25.     movel    d0,a1
  26. L2:    tstb    a1@+
  27.     jne    L2
  28.     subqw    #1,a1
  29. L1:    moveb    a0@+,a1@+
  30.     jne    L1
  31.     rts
  32. ");
  33.  
  34. #endif
  35.