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 / strrchr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-13  |  419 b   |  24 lines

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