Subversion Repositories Kolibri OS

Rev

Rev 8793 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #include "unconst.h"
  2. #include <string.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)
  19.         : "1"((unsigned)s), "0"(c));
  20.     return __res;
  21. }