]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseMemoryLibMmx/Ia32/SetMem16.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibMmx / Ia32 / SetMem16.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; SetMem16.nasm
9 ;
10 ; Abstract:
11 ;
12 ; SetMem16 function
13 ;
14 ; Notes:
15 ;
16 ;------------------------------------------------------------------------------
17
18 SECTION .text
19
20 ;------------------------------------------------------------------------------
21 ; VOID *
22 ; EFIAPI
23 ; InternalMemSetMem16 (
24 ; IN VOID *Buffer,
25 ; IN UINTN Count,
26 ; IN UINT16 Value
27 ; )
28 ;------------------------------------------------------------------------------
29 global ASM_PFX(InternalMemSetMem16)
30 ASM_PFX(InternalMemSetMem16):
31 push edi
32 mov eax, [esp + 16]
33 shrd edx, eax, 16
34 shld eax, edx, 16
35 mov edx, [esp + 12]
36 mov edi, [esp + 8]
37 mov ecx, edx
38 and edx, 3
39 shr ecx, 2
40 jz @SetWords
41 movd mm0, eax
42 movd mm1, eax
43 psllq mm0, 32
44 por mm0, mm1
45 .0:
46 movq [edi], mm0
47 add edi, 8
48 loop .0
49 @SetWords:
50 mov ecx, edx
51 rep stosw
52 mov eax, [esp + 8]
53 pop edi
54 ret
55