mirror of
https://github.com/reactos/reactos.git
synced 2024-09-22 18:45:51 +00:00
ab6c2ee54c
incude asm.inc instead of reactos/asm.h Fix a bug that smeaked into _chkstk svn path=/branches/cmake-bringup/; revision=49591
53 lines
580 B
ArmAsm
53 lines
580 B
ArmAsm
/*
|
|
* $Id$
|
|
*/
|
|
|
|
#include <asm.inc>
|
|
#include <ks386.inc>
|
|
|
|
/*
|
|
* void *memset (void *src, int val, size_t count)
|
|
*/
|
|
|
|
PUBLIC _memset
|
|
.code
|
|
|
|
_memset:
|
|
push ebp
|
|
mov ebp, esp
|
|
push edi
|
|
mov edi, [ebp + 8]
|
|
movzx eax, byte ptr [ebp + 12]
|
|
mov ecx, [ebp + 16]
|
|
cld
|
|
cmp ecx, 16
|
|
jb .L1
|
|
mov edx, HEX(01010101)
|
|
mul edx
|
|
mov edx, ecx
|
|
test edi, 3
|
|
je .L2
|
|
mov ecx, edi
|
|
and ecx, 3
|
|
sub ecx, 5
|
|
not ecx
|
|
sub edx, ecx
|
|
rep stosb
|
|
mov ecx, edx
|
|
.L2:
|
|
shr ecx, 2
|
|
rep stosd
|
|
mov ecx, edx
|
|
and ecx, 3
|
|
.L1:
|
|
test ecx, ecx
|
|
je .L3
|
|
rep stosb
|
|
.L3:
|
|
pop edi
|
|
mov eax, [ebp + 8]
|
|
leave
|
|
ret
|
|
|
|
END
|