1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
12 ; IsZeroBuffer function
16 ;------------------------------------------------------------------------------
21 ;------------------------------------------------------------------------------
24 ; InternalMemIsZeroBuffer (
25 ; IN CONST VOID *Buffer,
28 ;------------------------------------------------------------------------------
29 global ASM_PFX(InternalMemIsZeroBuffer)
30 ASM_PFX(InternalMemIsZeroBuffer):
32 mov rdi, rcx ; rdi <- Buffer
33 mov rcx, rdx ; rcx <- Length
34 shr rcx, 3 ; rcx <- number of qwords
35 and rdx, 7 ; rdx <- number of trailing bytes
36 xor rax, rax ; rax <- 0, also set ZF
38 jnz @ReturnFalse ; ZF=0 means non-zero element found
43 mov rax, 1 ; return TRUE