5 .type _strcat,@function
7 ;; On entry: r1 => Destination
9 #ifdef __RX_DISALLOW_STRING_INSNS__
10 mov r1, r4 ; Save a copy of the dest pointer.
12 1: mov.b [r4+], r5 ; Find the NUL byte at the end of R4.
16 sub #1, r4 ; Move R4 back to point at the NUL byte.
18 2: mov.b [r2+], r5 ; Copy bytes from R2 to R4 until we reach a NUL byte.
25 mov r1, r4 ; Save a copy of the dest pointer.
26 mov r2, r5 ; Save a copy of the source pointer.
28 mov #0, r2 ; Search for the NUL byte.
29 mov #-1, r3 ; Limit on the number of bytes examined.
30 suntil.b ; Find the end of the destination string.
31 sub #1, r1 ; suntil.b leaves r1 pointing to the byte beyond the match.
33 mov #-1, r3 ; Set a limit on the number of bytes copied.
34 mov r5, r2 ; Restore the source pointer.
35 smovu ; Copy source to destination
37 mov r4, r1 ; Return the original dest pointer.
40 .size _strcat, . - _strcat