2 # ConvertAsm.py: Automatically generated from CopyMem.asm
4 #------------------------------------------------------------------------------
6 # Copyright (c) 2006 - 2009, Intel Corporation
7 # All rights reserved. This program and the accompanying materials
8 # are licensed and made available under the terms and conditions of the BSD License
9 # which accompanies this distribution. The full text of the license may be found at
10 # http://opensource.org/licenses/bsd-license.php
12 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
25 #------------------------------------------------------------------------------
27 #include <EdkIIGlueBase.h>
28 #------------------------------------------------------------------------------
31 # InternalMemCopyMem (
32 # IN VOID *Destination,
36 #------------------------------------------------------------------------------
37 .globl ASM_PFX(InternalMemCopyMem)
38 ASM_PFX(InternalMemCopyMem):
41 movq %rdx, %rsi # rsi <- Source
42 movq %rcx, %rdi # rdi <- Destination
43 leaq -1(%rsi, %r8,), %r9 # r9 <- End of Source
45 movq %rdi, %rax # rax <- Destination as return value
48 jae L_CopyBackward # Copy backward if overlapped
53 rep movsq # Copy as many Qwords as possible
56 movq %r9, %rsi # rsi <- End of Source
57 leaq -1(%rdi, %r8), %rdi # esi <- End of Destination
58 std # set direction flag
61 rep movsb # Copy bytes backward