home *** CD-ROM | disk | FTP | other *** search
/ Dream 48 / Amiga_Dream_48.iso / Atari / c / sozobon-v2 / dlibsrc.lha / STRCPY.S < prev    next >
Text File  |  1988-10-19  |  407b  |  22 lines

  1. *    char *strcpy(dest, source)
  2. *        register char *dest, *source;
  3. *        {
  4. *        register char *p = dest;
  5. *    
  6. *        while(*dest++ = *source++)
  7. *            ;
  8. *        return(p);
  9. *        }
  10.  
  11. .text
  12. .globl _strcpy
  13. _strcpy:
  14.     move.l    4(a7),a1    ; destination
  15.     move.l    8(a7),a0    ; source
  16.     clr.l    d0
  17. strcpy1:
  18.     move.b    (a0)+,(a1)+    ; copy byte
  19.     bne    strcpy1        ; loop, unless byte was zero
  20.     move.l    4(a7),d0    ; return destination pointer
  21.     rts
  22.