2 // Include common header file for this module.
4 #include "CommonHeader.h"
6 ;------------------------------------------------------------------------------
8 ; Copyright (c) 2006, Intel Corporation
9 ; All rights reserved. This program and the accompanying materials
10 ; are licensed and made available under the terms and conditions of the BSD License
11 ; which accompanies this distribution. The full text of the license may be found at
12 ; http://opensource.org/licenses/bsd-license.php
14 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
27 ;------------------------------------------------------------------------------
33 ;------------------------------------------------------------------------------
35 ; InternalMemCopyMem (
36 ; IN VOID *Destination,
40 ;------------------------------------------------------------------------------
41 InternalMemCopyMem PROC USES esi edi
42 mov esi, [esp + 16] ; esi <- Source
43 mov edi, [esp + 12] ; edi <- Destination
44 mov edx, [esp + 20] ; edx <- Count
45 lea eax, [esi + edx - 1] ; eax <- End of Source
49 jae @CopyBackward ; Copy backward if overlapped
54 rep movsd ; Copy as many Dwords as possible
57 mov esi, eax ; esi <- End of Source
58 lea edi, [edi + edx - 1] ; edi <- End of Destination
62 rep movsb ; Copy bytes backward
64 mov eax, [esp + 12] ; eax <- Destination as return value
66 InternalMemCopyMem ENDP