Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | #include |
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) : "1" (s),"0" (c)); |
||
19 | return __res; |
||
20 | } |