home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / sysdeps / i386 / strchr.c.old < prev    next >
Encoding:
Text File  |  1994-08-20  |  422 b   |  25 lines

  1. #include <string.h>
  2.  
  3. #include "asm-ops.h"
  4.  
  5. char * strchr(const char * s,int c)
  6. {
  7. register char * __res;
  8. __asm__("cld\n\t"
  9.     "movb %%al,%%ah\n"
  10.     LL(1) "\tlodsb\n\t"
  11.     "cmpb %%ah,%%al\n\t"
  12.     "je " LF(2) "\n\t"
  13.     "testb %%al,%%al\n\t"
  14.     "jne " LB(1) "\n\t"
  15.     "movl $1,%1\n"
  16.     LL(2) "\tleal -1(%1),%0\n"
  17.     :"=a" (__res):"S" (s),"0" (c):"si");
  18. return __res;
  19. }
  20.  
  21. #include <gnu-stabs.h>
  22. #ifdef elf_alias
  23. elf_alias (strchr, index);
  24. #endif
  25.