1: /* 2: * Copyright (c) 1987 Regents of the University of California. 3: * All rights reserved. The Berkeley software License Agreement 4: * specifies the terms and conditions for redistribution. 5: */ 6: 7: #ifdef LIBC_SCCS 8: <@(#)strcat.s 1.1 (Berkeley) 1/20/87\0> 9: .even 10: #endif LIBC_SCCS 11: 12: /* 13: * Concatenate string s2 to the end of s1 14: * and return the base of s1. 15: * 16: * char * 17: * strcat(s1, s2) 18: * char *s1, *s2; 19: */ 20: #include "DEFS.h" 21: 22: ENTRY(strcat) 23: mov 2(sp),r0 / r0 = s1 24: 1: 25: tstb (r0)+ / find end of string 26: bne 1b 27: dec r0 / back up to '\0' 28: mov 4(sp),r1 / r1 = s2 29: 2: 30: movb (r1)+,(r0)+ / copy s2 to end of s1 31: bne 2b 32: mov 2(sp),r0 / and return s1 33: rts pc