mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:05:49 +00:00
Create a branch for header work.
svn path=/branches/header-work/; revision=45691
This commit is contained in:
parent
14fe274b1c
commit
9ea495ba33
19538 changed files with 0 additions and 1063950 deletions
47
lib/sdk/crt/mem/i386/memset_asm.s
Normal file
47
lib/sdk/crt/mem/i386/memset_asm.s
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* void *memset (void *src, int val, size_t count)
|
||||
*/
|
||||
|
||||
.globl _memset
|
||||
|
||||
_memset:
|
||||
push %ebp
|
||||
mov %esp,%ebp
|
||||
push %edi
|
||||
mov 0x8(%ebp),%edi
|
||||
movzb 0xc(%ebp),%eax
|
||||
mov 0x10(%ebp),%ecx
|
||||
cld
|
||||
cmp $16,%ecx
|
||||
jb .L1
|
||||
mov $0x01010101,%edx
|
||||
mul %edx
|
||||
mov %ecx,%edx
|
||||
test $3,%edi
|
||||
je .L2
|
||||
mov %edi,%ecx
|
||||
and $3,%ecx
|
||||
sub $5,%ecx
|
||||
not %ecx
|
||||
sub %ecx,%edx
|
||||
rep stosb
|
||||
mov %edx,%ecx
|
||||
.L2:
|
||||
shr $2,%ecx
|
||||
rep stosl
|
||||
mov %edx,%ecx
|
||||
and $3,%ecx
|
||||
.L1:
|
||||
test %ecx,%ecx
|
||||
je .L3
|
||||
rep stosb
|
||||
.L3:
|
||||
pop %edi
|
||||
mov 0x8(%ebp),%eax
|
||||
leave
|
||||
ret
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue