1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2006, Intel Corporation
4 ; All rights reserved. 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 ;------------------------------------------------------------------------------
29 ;------------------------------------------------------------------------------
32 ; InternalMemCopyMem (
33 ; IN VOID *Destination,
37 ;------------------------------------------------------------------------------
38 InternalMemCopyMem PROC USES esi edi
39 mov esi, [esp + 16] ; esi <- Source
40 mov edi, [esp + 12] ; edi <- Destination
41 mov edx, [esp + 20] ; edx <- Count
42 lea eax, [esi + edx - 1] ; eax <- End of Source
45 cmp eax, edi ; Overlapped?
46 jae @CopyBackward ; Copy backward if overlapped
50 shr ecx, 3 ; ecx <- # of Qwords to copy
54 movq [esp], mm0 ; save mm0
61 movq mm0, [esp] ; restore mm0
62 pop ecx ; stack cleanup
63 pop ecx ; stack cleanup
66 mov esi, eax ; esi <- Last byte in Source
67 lea edi, [edi + edx - 1] ; edi <- Last byte in Destination
75 InternalMemCopyMem ENDP