]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibOptDxe/Ia32/CompareMem.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibOptDxe / Ia32 / CompareMem.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; CompareMem.Asm
9 ;
10 ; Abstract:
11 ;
12 ; CompareMem function
13 ;
14 ; Notes:
15 ;
16 ; The following BaseMemoryLib instances contain the same copy of this file:
17 ;
18 ; BaseMemoryLibRepStr
19 ; BaseMemoryLibMmx
20 ; BaseMemoryLibSse2
21 ; BaseMemoryLibOptDxe
22 ; BaseMemoryLibOptPei
23 ;
24 ;------------------------------------------------------------------------------
25
26 SECTION .text
27
28 ;------------------------------------------------------------------------------
29 ; INTN
30 ; EFIAPI
31 ; InternalMemCompareMem (
32 ; IN CONST VOID *DestinationBuffer,
33 ; IN CONST VOID *SourceBuffer,
34 ; IN UINTN Length
35 ; );
36 ;------------------------------------------------------------------------------
37 global ASM_PFX(InternalMemCompareMem)
38 ASM_PFX(InternalMemCompareMem):
39 push esi
40 push edi
41 mov esi, [esp + 12]
42 mov edi, [esp + 16]
43 mov ecx, [esp + 20]
44 repe cmpsb
45 movzx eax, byte [esi - 1]
46 movzx edx, byte [edi - 1]
47 sub eax, edx
48 pop edi
49 pop esi
50 ret
51