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 / strpbrk.c.old < prev    next >
Encoding:
Text File  |  1994-08-20  |  559 b   |  31 lines

  1. #include <string.h>
  2.  
  3. #include "asm-ops.h"
  4.  
  5. char * strpbrk(const char * cs,const char * ct)
  6. {
  7. register char * __res;
  8. __asm__("cld\n\t"
  9.     "movl %4,%%edi\n\t"
  10.     "repne\n\t"
  11.     "scasb\n\t"
  12.     "notl %%ecx\n\t"
  13.     "decl %%ecx\n\t"
  14.     "movl %%ecx,%%edx\n"
  15.     LL(1) "\tlodsb\n\t"
  16.     "testb %%al,%%al\n\t"
  17.     "je " LF(2) "\n\t"
  18.     "movl %4,%%edi\n\t"
  19.     "movl %%edx,%%ecx\n\t"
  20.     "repne\n\t"
  21.     "scasb\n\t"
  22.     "jne " LB(1) "\n\t"
  23.     "decl %0\n\t"
  24.     "jmp " LF(3) "\n"
  25.     LL(2) "\txorl %0,%0\n"
  26.     LL(3) 
  27.     :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct)
  28.     :"ax","cx","dx","di");
  29. return __res;
  30. }
  31.