Subversion Repositories Kolibri OS

Rev

Rev 8793 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9765 turbocat 1
#include "unconst.h"
2
#include 
3
 
4
char* strchr(const char* s, int c)
5
{
6
    int d0;
7
    register char* __res;
8
    __asm__ __volatile__(
9
        "movb %%al,%%ah\n"
10
        "1:\tlodsb\n\t"
11
        "cmpb %%ah,%%al\n\t"
12
        "je 2f\n\t"
13
        "testb %%al,%%al\n\t"
14
        "jne 1b\n\t"
15
        "movl $1,%1\n"
16
        "2:\tmovl %1,%0\n\t"
17
        "decl %0"
18
        : "=a"(__res), "=&S"(d0)
19
        : "1"((unsigned)s), "0"(c));
20
    return __res;
8687 turbocat 21
}