1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2006, 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.
22 ;------------------------------------------------------------------------------
28 ;------------------------------------------------------------------------------
30 ; InternalMemCopyMem (
31 ; IN VOID *Destination,
35 ;------------------------------------------------------------------------------
36 InternalMemCopyMem PROC USES esi edi
37 mov esi, [esp+16] ; esi <- Source
38 mov edi, [esp+12] ; edi <- Destination
39 mov edx, [esp+20] ; edx <- Count
44 lea eax, [esi + edx - 1] ; eax <- End of Source
48 jb @CopyBytes ; Copy backward if overlapped
49 mov esi, eax ; esi <- End of Source
50 lea edi, [edi + edx - 1] ; edi <- End of Destination
54 rep movsb ; Copy bytes backward
57 mov eax, [esp + 12] ; eax <- Destination as return value
59 InternalMemCopyMem ENDP