Separated math and memory functions into their own files to limit the amount of objec...
[reactos.git] / reactos / lib / rtl / i386 / comparememory_ulong_asm.s
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: comparememory_ulong_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 _RtlCompareMemoryUlong@12 // [5] (no bug)
16
17 /* FUNCTIONS ***************************************************************/
18
19 _RtlCompareMemoryUlong@12:
20 xor eax,eax
21 mov ecx, dword [esp + 8 ] // ecx = Length
22 shr ecx,2 // Length / sizeof(ULONG)
23 jz 1f // if (Length==0) goto .zero
24
25 push edi// register that does not to be save eax,ecx,edx to
26 push ebx// the stack for protetion
27
28 mov edi, dword [esp + (4 + 8)] // edx = Destination
29 mov eax, dword [esp + (12 + 8)] // ebx = value
30 mov ebx,ecx
31 cld
32 repe scasd
33
34 inc ecx
35 mov eax,ebx
36
37 sub eax,ecx
38 shl eax,2
39
40 pop ebx
41 pop edi
42
43 1:
44 ret 12