reactos/lib/sdk/crt/mem/i386/memset_asm.s
Amine Khaldi c424146e2c Create a branch for cmake bringup.
svn path=/branches/cmake-bringup/; revision=48236
2010-07-24 18:52:44 +00:00

48 lines
535 B
ArmAsm

/*
* $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