- Revert 49927 "Update to trunk" as it breaks KsStudio (again)
[reactos.git] / lib / sdk / crt / mem / i386 / memchr_asm.s
index 40cd3dc..f6e8037 100644 (file)
@@ -5,34 +5,28 @@
  * FILE:            lib/sdk/crt/mem/i386/memchr.s
  */
 
-#include <asm.inc>
-#include <ks386.inc>
-
 /*
  * void* memchr(const void* s, int c, size_t n)
  */
 
-PUBLIC _memchr
-.code
+.globl _memchr
 
 _memchr:
-       push ebp
-       mov ebp, esp
-       push edi
-       mov     edi, [ebp + 8]
-       mov     eax, [ebp + 12]
-       mov     ecx, [ebp + 16]
+       push    %ebp
+       mov     %esp,%ebp
+       push    %edi
+       mov     0x8(%ebp),%edi
+       mov     0xc(%ebp),%eax
+       mov     0x10(%ebp),%ecx
        cld
-       jecxz .Lnotfound
-       repne scasb
-       je .Lfound
+       jecxz   .Lnotfound
+       repne   scasb
+       je      .Lfound
 .Lnotfound:
-       mov edi, 1
+       mov     $1,%edi
 .Lfound:
-       mov eax, edi
-       dec eax
-       pop edi
+       mov     %edi,%eax
+       dec     %eax
+       pop     %edi
        leave
        ret
-
-END