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/] [strlen.S] - Blame information for rev 527

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

Line No. Rev Author Line
1 207 jeremybenn
        .file   "strlen.S"
2
 
3
        .section .text
4
 
5
        .global  _strlen
6
        .type    _strlen,@function
7
_strlen:
8
        add     #0, r1, r4      ; Save a copy of the string start address and set the condition flags.
9
        beq     null_string     ; Test for a NULL pointer.
10
        mov     #-1, r3         ; Set a limit on the number of bytes examined.
11
        mov     #0,  r2         ; Stop searching when we find a NUL byte.
12
        suntil.b                ; Search until *r1 == r2
13
        sub     #1, r1          ; suntil.b leaves r1 pointing to the byte beyond the match.
14
null_string:
15
        sub     r4, r1          ; Compute the length.
16
        rts

powered by: WebSVN 2.1.0

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