Rev 9620 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
9765 | turbocat | 1 | #include |
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 | } |