This commit was manufactured by cvs2svn to create branch 'captive'.
[reactos.git] / lib / ntdll / nasm / rtl / i386_RtlFillMemory.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_RtlCompareMemory.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
15           BITS 32
16         GLOBAL _RtlFillMemory@12      ; [4]  (no bug)  
17         
18         SECTION .text
19
20 ; *
21 ; * [6] VOID STDCALL RtlFillMemory (PVOID Destination, ULONG Length, UCHAR Fill)
22 ; * 
23
24 _RtlFillMemory@12:
25       mov ecx,dword [esp + 8 ]      ; ecx = Length                                       
26         cmp ecx,0                     ; if (Length==0) goto .zero 
27         je  .zero               
28
29       mov edx, dword [esp + 4]      ; edx = Destination           
30       mov eax, dword [esp + 12]     ; eax = fill                        
31 .loop:     
32       mov       byte [edx + ecx -1],al  ; src[Length - 1] = fill
33       dec ecx                       ; Length = Length - 1
34       jnz .loop                     ; if (Length!=0) goto .loop
35 .zero:                  
36       ret 12                        ; return