]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseMemoryLibMmx/X64/ScanMem8.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibMmx / X64 / ScanMem8.nasm
CommitLineData
d85d9d34
JJ
1;------------------------------------------------------------------------------\r
2;\r
3; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
9344f092 4; SPDX-License-Identifier: BSD-2-Clause-Patent\r
d85d9d34
JJ
5;\r
6; Module Name:\r
7;\r
8; ScanMem8.Asm\r
9;\r
10; Abstract:\r
11;\r
12; ScanMem8 function\r
13;\r
14; Notes:\r
15;\r
16; The following BaseMemoryLib instances contain the same copy of this file:\r
17;\r
18; BaseMemoryLibRepStr\r
19; BaseMemoryLibMmx\r
20; BaseMemoryLibSse2\r
21; BaseMemoryLibOptDxe\r
22; BaseMemoryLibOptPei\r
23;\r
24;------------------------------------------------------------------------------\r
25\r
26 DEFAULT REL\r
27 SECTION .text\r
28\r
29;------------------------------------------------------------------------------\r
30; CONST VOID *\r
31; EFIAPI\r
32; InternalMemScanMem8 (\r
33; IN CONST VOID *Buffer,\r
34; IN UINTN Length,\r
35; IN UINT8 Value\r
36; );\r
37;------------------------------------------------------------------------------\r
38global ASM_PFX(InternalMemScanMem8)\r
39ASM_PFX(InternalMemScanMem8):\r
40 push rdi\r
41 mov rdi, rcx\r
42 mov rcx, rdx\r
43 mov rax, r8\r
44 repne scasb\r
45 lea rax, [rdi - 1]\r
46 cmovnz rax, rcx ; set rax to 0 if not found\r
47 pop rdi\r
48 ret\r
49\r