Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | #include |
2 | #include |
||
3 | #include |
||
4 | |||
5 | void * memchr(const void *s, int c, size_t n) |
||
6 | { |
||
7 | int d0; |
||
8 | register void * __res; |
||
9 | if (!n) return NULL; |
||
10 | __asm__ __volatile__( |
||
11 | "repne\n\t" |
||
12 | "scasb\n\t" |
||
13 | "je 1f\n\t" |
||
14 | "movl $1,%0\n" |
||
15 | "1:\tdecl %0" |
||
16 | :"=D" (__res), "=&c" (d0) : "a" (c),"0" (s),"1" (n)); |
||
17 | return __res; |
||
18 | } |