CloverBootloader/MdePkg/Library/BaseMemoryLibRepStr/X64/ZeroMem.nasm

44 lines
981 B
NASM
Raw Normal View History

;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
; Module Name:
;
; ZeroMem.Asm
;
; Abstract:
;
; ZeroMem function
;
; Notes:
;
;------------------------------------------------------------------------------
DEFAULT REL
SECTION .text
;------------------------------------------------------------------------------
; VOID *
; InternalMemZeroMem (
; IN VOID *Buffer,
; IN UINTN Count
; );
;------------------------------------------------------------------------------
global ASM_PFX(InternalMemZeroMem)
ASM_PFX(InternalMemZeroMem):
push rdi
push rcx
xor rax, rax
mov rdi, rcx
mov rcx, rdx
shr rcx, 3
and rdx, 7
rep stosq
mov ecx, edx
rep stosb
pop rax
pop rdi
ret