projects
/
reactos.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[CRT]
[reactos.git]
/
lib
/
sdk
/
crt
/
mem
/
i386
/
memset_asm.s
1
/*
2
* $Id$
3
*/
4
5
#include <reactos/asm.h>
6
7
/*
8
* void *memset (void *src, int val, size_t count)
9
*/
10
11
PUBLIC _memset
12
.code
13
14
_memset:
15
push ebp
16
mov ebp, esp
17
push edi
18
mov edi, [ebp + 8]
19
movzx eax, byte ptr [ebp + 12]
20
mov ecx, [ebp + 16]
21
cld
22
cmp ecx, 16
23
jb .L1
24
mov edx, HEX(01010101)
25
mul edx
26
mov edx, ecx
27
test edi, 3
28
je .L2
29
mov ecx, edi
30
and ecx, 3
31
sub ecx, 5
32
not ecx
33
sub edx, ecx
34
rep stosb
35
mov ecx, edx
36
.L2:
37
shr ecx, 2
38
rep stosd
39
mov ecx, edx
40
and ecx, 3
41
.L1:
42
test ecx, ecx
43
je .L3
44
rep stosb
45
.L3:
46
pop edi
47
mov eax, [ebp + 8]
48
leave
49
ret
50
51
END