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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [machine/] [rx/] [strncpy.S] - Blame information for rev 345

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
        .file   "strncpy.S"
2
 
3
        .section .text
4
        .global  _strncpy
5
        .type    _strncpy,@function
6
_strncpy:
7
        mov     r1, r4          ; Save a copy of the dest pointer.
8
        mov     r3, r5          ; Save a copy of the byte count
9
        smovu                   ; Copy the bytes
10
        cmp     #0, r3          ; If we have copied the number of bytes requested
11
        beq     1f              ;  then skip the next bit:
12
        add     r4, r5, r1      ; Point to the last byte that we are supposed to write.
13
        sub     r3, r1          ; Subtract the number of bytes left to be written.
14
        mov     #0, r2          ; Fill the remaining bytes with NULs,
15
        sstr.b
16
1:
17
        mov     r4, r1          ; Return the destination pointer
18
        rts

powered by: WebSVN 2.1.0

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