Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #include <string.h>
  2.  
  3. int strcmp(const char *s1, const char *s2)
  4. {
  5. int d0, d1;
  6. register int __res;
  7. __asm__ __volatile__(
  8.         "1:\tlodsb\n\t"
  9.         "scasb\n\t"
  10.         "jne 2f\n\t"
  11.         "testb %%al,%%al\n\t"
  12.         "jne 1b\n\t"
  13.         "xorl %%eax,%%eax\n\t"
  14.         "jmp 3f\n"
  15.         "2:\tsbbl %%eax,%%eax\n\t"
  16.         "orb $1,%%al\n"
  17.         "3:"
  18.         :"=a" (__res), "=&S" (d0), "=&D" (d1)
  19.                      :"1" (s1),"2" (s2));
  20. return __res;
  21. }
  22.