]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibRepStr/Ia32/CompareMem.asm
dabd337a7c05e6d4acf3cfc3efa74b8ca2b87383
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibRepStr / Ia32 / CompareMem.asm
1 //
2 // Include common header file for this module.
3 //
4 #include "CommonHeader.h"
5
6 ;------------------------------------------------------------------------------
7 ;
8 ; Copyright (c) 2006, Intel Corporation
9 ; All rights reserved. This program and the accompanying materials
10 ; are licensed and made available under the terms and conditions of the BSD License
11 ; which accompanies this distribution. The full text of the license may be found at
12 ; http://opensource.org/licenses/bsd-license.php
13 ;
14 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 ;
17 ; Module Name:
18 ;
19 ; CompareMem.Asm
20 ;
21 ; Abstract:
22 ;
23 ; CompareMem function
24 ;
25 ; Notes:
26 ;
27 ; The following BaseMemoryLib instances share the same version of this file:
28 ;
29 ; BaseMemoryLibRepStr
30 ; BaseMemoryLibMmx
31 ; BaseMemoryLibSse2
32 ;
33 ;------------------------------------------------------------------------------
34
35 .686
36 .model flat,C
37 .code
38
39 ;------------------------------------------------------------------------------
40 ; INTN
41 ; EFIAPI
42 ; InternalMemCompareMem (
43 ; IN CONST VOID *DestinationBuffer,
44 ; IN CONST VOID *SourceBuffer,
45 ; IN UINTN Length
46 ; );
47 ;------------------------------------------------------------------------------
48 InternalMemCompareMem PROC USES esi edi
49 mov esi, [esp + 12]
50 mov edi, [esp + 16]
51 mov ecx, [esp + 20]
52 repe cmpsb
53 movzx eax, byte ptr [esi - 1]
54 movzx edx, byte ptr [edi - 1]
55 sub eax, edx
56 ret
57 InternalMemCompareMem ENDP
58
59 END