12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #include <string.h>
- #undef strchr
- char *strchr(const char *s, int c)
- {
- int esi;
- register char * eax;
- __asm__ __volatile__(
- " movb %%al, %%ah\n"
- "1: lodsb\n"
- " cmpb %%ah, %%al\n"
- " je 2f\n"
- " testb %%al, %%al\n"
- " jnz 1b\n"
- " movl $1, %%esi\n"
- "2: leal -1(%%esi), %%eax\n"
- : "=a" (eax), "=&S" (esi)
- : "0" (c), "1" (s)
-
- );
- return eax;
- }
- libc_hidden_def(strchr)
- #ifdef __UCLIBC_SUSV3_LEGACY__
- strong_alias(strchr,index)
- #endif
|