mirror of
https://github.com/reactos/reactos.git
synced 2024-09-23 02:56:00 +00:00
a3623f23de
- Make all x86assembly ML compatible - Remove memcpy, it was duplicated from memmove, copy the label instead - Guard some code against compilation on msvc, as these functions are intrinsics on MSVC and cannot be implemented - Fix some x64 assembly (don't modify stack below rsp) svn path=/branches/cmake-bringup/; revision=49421
38 lines
499 B
ArmAsm
38 lines
499 B
ArmAsm
/* $Id$
|
|
*
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
* PROJECT: ReactOS kernel
|
|
* FILE: lib/sdk/crt/mem/i386/memchr.s
|
|
*/
|
|
|
|
#include <reactos/asm.h>
|
|
|
|
/*
|
|
* void* memchr(const void* s, int c, size_t n)
|
|
*/
|
|
|
|
PUBLIC _memchr
|
|
.code
|
|
|
|
_memchr:
|
|
push ebp
|
|
mov ebp, esp
|
|
push edi
|
|
mov edi, [ebp + 8]
|
|
mov eax, [ebp + 12]
|
|
mov ecx, [ebp + 16]
|
|
cld
|
|
jecxz .Lnotfound
|
|
repne scasb
|
|
je .Lfound
|
|
.Lnotfound:
|
|
mov edi, 1
|
|
.Lfound:
|
|
mov eax, edi
|
|
dec eax
|
|
pop edi
|
|
leave
|
|
ret
|
|
|
|
END
|