OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [libc/] [machine/] [rx/] [strcat.S] - Blame information for rev 207

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
        .file   "strcat.S"
2
 
3
        .section .text
4
        .global  _strcat
5
        .type    _strcat,@function
6
_strcat:
7
        ;; On entry: r1 => Destination
8
        ;;           r2 => Source
9
        mov     r1, r4          ; Save a copy of the dest pointer.
10
        mov     r2, r5          ; Save a copy of the source pointer.
11
 
12
        mov     #0,  r2         ; Search for the NUL byte.
13
        mov     #-1, r3         ; Limit on the number of bytes examined.
14
        suntil.b                ; Find the end of the destination string.
15
        sub     #1,  r1         ; suntil.b leaves r1 pointing to the byte beyond the match.
16
 
17
        mov     #-1, r3         ; Set a limit on the number of bytes copied.
18
        mov     r5,  r2         ; Restore the source pointer.
19
        smovu                   ; Copy source to destination
20
 
21
        mov     r4, r1          ; Return the original dest pointer.
22
        rts

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.