OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [machine/] [sh/] [strcpy.S] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 56 joel
! Entry: r4: destination
2
!        r5: source
3
! Exit:  r0: destination
4
!        r1-r2,r5: clobbered
5
 
6
#include "asm.h"
7
 
8
ENTRY(strcpy)
9
        mov     r4,r0
10
        or      r5,r0
11
        tst     #3,r0
12
        SL(bf, L_setup_char_loop, mov r4,r0)
13
        mov.l   @r5+,r1
14
        mov     #0,r2
15
        cmp/str r2,r1
16
        SL(bt, Longword_loop_end, sub r5,r0)
17
        .align  2
18
Longword_loop:
19
        mov.l   r1,@(r0,r5)
20
        mov.l   @r5+,r1
21
        cmp/str r2,r1
22
        bt      Longword_loop_end
23
        mov.l   r1,@(r0,r5)
24
        mov.l   @r5+,r1
25
        cmp/str r2,r1
26
        bf      Longword_loop
27
Longword_loop_end:
28
        add     #-4,r5
29
        add     #3,r0
30
        .align  2
31
L_char_loop:
32
        mov.b   @r5+,r1
33
L_char_loop_start:
34
        tst     r1,r1
35
        SL(bf, L_char_loop, mov.b r1,@(r0,r5))
36
        rts
37
        mov r4,r0
38
L_setup_char_loop:
39
        mov.b   @r5+,r1
40
        bra L_char_loop_start
41
        sub r5,r0

powered by: WebSVN 2.1.0

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