Annotation of coherent/b/lib/libc/string/i386/strlen.s, revision 1.1.1.1

1.1       root        1: //////////
                      2: / libc/string/i386/strlen.s
                      3: / i386 C string library.
                      4: / ANSI 4.11.6.3.
                      5: //////////
                      6: 
                      7: //////////
                      8: / size_t
                      9: / strlen(char *String)
                     10: /
                     11: / Find length of String.
                     12: //////////
                     13: 
                     14: String .equ    8
                     15: 
                     16:        .globl  strlen
                     17: 
                     18: strlen:
                     19:        push    %edi
                     20: 
                     21:        movl    %edi, String(%esp)      / String address to EDI
                     22:        movl    %ecx, $-1               / Max count to ECX
                     23:        subb    %al, %al                / NUL to AL
                     24:        cld
                     25:        repne
                     26:        scasb                           / Scan to NUL
                     27:        movl    %eax, $-2
                     28:        subl    %eax, %ecx              / Return length in EAX
                     29: 
                     30:        pop     %edi
                     31:        ret
                     32: 
                     33: / end of libc/string/i386/strlen.s

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.