1/* strcat.s 4.1 84/11/01 */ 2 3/* 4 * Concatenate string s2 to the end of s1 5 * and return the base of s1. 6 * 7 * char * 8 * strcat(s1, s2) 9 * char *s1, *s2; 10 */ 11 .globl _strcat 12 13_strcat: 14 .word 0x1c0 15 movq 4(ap), r6 # r6 = s1; r7 = s2 16 movl r6,r1 170: 18 locc $0,$65535,(r1) # look for '\0' 19 beql 0b 20 movl r1,r3 # save end of s1 211: 22 locc $0,$65535,(r7) # find length of s2 23 bneq 2f 24 movc3 $65535,(r7),(r3)# copy full block 25 movl r1,r7 26 jbr 1b 272: 28 subl2 r7,r1 # calculate length 29 incl r1 30 movc3 r1,(r7),(r3) # copy remainder 31 movl r6,r0 32 ret 33