2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: fillmemory_asm.S
5 * PURPOSE: Memory functions
6 * PROGRAMMERS: Patrick Baggett (baggett.patrick@gmail.com)
7 * Alex Ionescu (alex@relsoft.net)
8 * Magnus Olsen (magnusolsen@greatlord.com)
11 .intel_syntax noprefix
13 /* GLOBALS ****************************************************************/
15 .globl _RtlFillMemory@12 //[4] (no bug)
17 /* FUNCTIONS ***************************************************************/
20 mov ecx,dword [esp + 8 ] // ecx = Length
21 cmp ecx,0// if (Length==0) goto .zero
24 mov edx, dword [esp + 4] // edx = Destination
25 mov eax, dword [esp + 12] // eax = fill
27 mov byte [edx + ecx -1],al // src[Length - 1] = fill
28 dec ecx // Length = Length - 1
29 jnz 1b // if (Length!=0) goto .loop