1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
4 ; This program and the accompanying materials
5 ; are licensed and made available under the terms and conditions of the BSD License
6 ; which accompanies this distribution. The full text of the license may be found at
7 ; http://opensource.org/licenses/bsd-license.php.
9 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 ; IsZeroBuffer function
22 ;------------------------------------------------------------------------------
26 ;------------------------------------------------------------------------------
29 ; InternalMemIsZeroBuffer (
30 ; IN CONST VOID *Buffer,
33 ;------------------------------------------------------------------------------
34 global ASM_PFX(InternalMemIsZeroBuffer)
35 ASM_PFX(InternalMemIsZeroBuffer):
37 mov edi, [esp + 8] ; edi <- Buffer
38 mov ecx, [esp + 12] ; ecx <- Length
39 mov edx, ecx ; edx <- ecx
40 shr ecx, 2 ; ecx <- number of dwords
41 and edx, 3 ; edx <- number of trailing bytes
42 xor eax, eax ; eax <- 0, also set ZF
44 jnz @ReturnFalse ; ZF=0 means non-zero element found
49 mov eax, 1 ; return TRUE