Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. #include <string.h>
  2. #include <libc/unconst.h>
  3.  
  4. char * strchr(const char *s, int c)
  5. {
  6.  int d0;
  7.  register char * __res;
  8.  __asm__ __volatile__(
  9.         "movb %%al,%%ah\n"
  10.         "1:\tlodsb\n\t"
  11.         "cmpb %%ah,%%al\n\t"
  12.         "je 2f\n\t"
  13.         "testb %%al,%%al\n\t"
  14.         "jne 1b\n\t"
  15.         "movl $1,%1\n"
  16.         "2:\tmovl %1,%0\n\t"
  17.         "decl %0"
  18.         :"=a" (__res), "=&S" (d0) : "1" (s),"0" (c));
  19.  return __res;
  20. }
  21.