libc.obj:
- Formatted by clang-format (WebKit-style). - Removed unnecessary errno linux. - Added KOS error codes. - String functions have been replaced with more optimal ones for x86. - Changed wrappers for 70 sysfunction. git-svn-id: svn://kolibrios.org@9765 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
/* strcmp( const char *, const char * )
|
||||
|
||||
This file is part of the Public Domain C Library (PDCLib).
|
||||
Permission is granted to use, modify, and / or redistribute at will.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/ksys.h>
|
||||
|
||||
int strcmp(const char * s1, const char * s2)
|
||||
{
|
||||
return __strcmp(s1, s2);
|
||||
}
|
||||
#include <string.h>
|
||||
|
||||
int strcmp(const char* s1, const char* s2)
|
||||
{
|
||||
int d0, d1;
|
||||
register int __res;
|
||||
__asm__ __volatile__(
|
||||
"1:\tlodsb\n\t"
|
||||
"scasb\n\t"
|
||||
"jne 2f\n\t"
|
||||
"testb %%al,%%al\n\t"
|
||||
"jne 1b\n\t"
|
||||
"xorl %%eax,%%eax\n\t"
|
||||
"jmp 3f\n"
|
||||
"2:\tsbbl %%eax,%%eax\n\t"
|
||||
"orb $1,%%al\n"
|
||||
"3:"
|
||||
: "=a"(__res), "=&S"(d0), "=&D"(d1)
|
||||
: "1"(s1), "2"(s2));
|
||||
return __res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user