.title cpystr .psect $code,rd,nowrt,exe,pic,shr,byte ; /* ; * Copy string s2 to s1. s1 must be large enough. ; * return a pointer to the trailing null in s2 ; */ ; ; char * ; cpystr(s1, s2) ; register char *s1, *s2; ; { ; ; while (*s1 = *s2++) ; s1++; ; return(s1); ; } .entry cpystr,^M movl 8(ap),r2 ; s2 locc #0,#-1,(r2) ; find null at end of s2 subl2 r2,r1 ; length of s2 incl r1 ; plus 1 for the null byte movc3 r1,@8(ap),@4(ap); copy the string movl r3,r0 ; r0 -> just past the destination decl r0 ; r0 -> trailing null ret .end