Separated math and memory functions into their own files to limit the amount of objec...
[reactos.git] / reactos / lib / rtl / i386 / fillmemory_asm.s
1 /*
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)
9 */
10
11 .intel_syntax noprefix
12
13 /* GLOBALS ****************************************************************/
14
15 .globl _RtlFillMemory@12 //[4] (no bug)
16
17 /* FUNCTIONS ***************************************************************/
18
19 _RtlFillMemory@12:
20 mov ecx,dword [esp + 8 ] // ecx = Length
21 cmp ecx,0// if (Length==0) goto .zero
22 je 2f
23
24 mov edx, dword [esp + 4] // edx = Destination
25 mov eax, dword [esp + 12] // eax = fill
26 1:
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
30 2:
31 ret 12 // return