update for HEAD-2003091401
[reactos.git] / lib / ntdll / nasm / rtl / i386_RtlFillMemoryUlong.asm
1 ; * base on ntdll/rtl/mem.c v 1.13 2003/07/11 13:50:23 
2 ; * 
3 ; * COPYRIGHT:       See COPYING in the top level directory
4 ; * PROJECT:         ReactOS kernel
5 ; * FILE:            i386_RtlMemoryUlong.asm
6 ; * PURPOSE:         Memory functions
7 ; * PROGRAMMER:      Magnus Olsen (magnusolsen@greatlord.com)
8 ; * UPDATE HISTORY:
9 ; *                  Created 20/07-2003
10 ; * 
11
12   
13
14         BITS 32
15         GLOBAL _RtlFillMemoryUlong@12    ; (no bug) (max optimze code)  
16         
17         SECTION .text
18
19
20
21
22 ; * 
23 ; * VOID STDCALL RtlFillMemoryUlong (PVOID Destination, ULONG Length, ULONG Fill)
24 ; * 
25
26 _RtlFillMemoryUlong@12:
27         mov ecx, dword [esp + 8 ]                   ; Length                                       
28         shr ecx,2                                   ; Length = Length / sizeof(ULONG) 
29           jz .zero                                    ; if (Length==0) goto .zero
30          
31         push edi
32         mov edi, dword [esp + (4 + 4)]             ; Destination
33         mov eax, dword [esp + (12 + 4)]            ; Fill       
34         cld                                       
35         rep stosd                                  ; while (Length>0) {Destination[Length-1]=Fill; Length = Length - 1}
36         pop edi
37 .zero:
38         ret 12