]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseMemoryLibSse2/Ia32/CopyMem.asm
Removed CommonHeader.h generated file from the MdePkg.
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibSse2 / Ia32 / CopyMem.asm
index 6127cc2188db843462ce15d009149d38a1cd79c8..034918af2fc9a16abf5b78ac8671eecfb35c07c5 100644 (file)
@@ -1,3 +1,8 @@
+//\r
+// Include common header file for this module.\r
+//\r
+\r
+\r
 ;------------------------------------------------------------------------------\r
 ;\r
 ; Copyright (c) 2006, Intel Corporation\r
 \r
 ;------------------------------------------------------------------------------\r
 ;  VOID *\r
-;  _mem_CopyMem (\r
+;  InternalMemCopyMem (\r
 ;    IN VOID   *Destination,\r
 ;    IN VOID   *Source,\r
 ;    IN UINTN  Count\r
-;    )\r
+;    );\r
 ;------------------------------------------------------------------------------\r
 InternalMemCopyMem  PROC    USES    esi edi\r
     mov     esi, [esp + 16]             ; esi <- Source\r
     mov     edi, [esp + 12]             ; edi <- Destination\r
     mov     edx, [esp + 20]             ; edx <- Count\r
-    lea     eax, [edi + edx - 1]        ; eax <- End of Destination\r
+    lea     eax, [esi + edx - 1]        ; eax <- End of Source\r
     cmp     esi, edi\r
     jae     @F\r
-    cmp     eax, esi                    ; Overlapped?\r
+    cmp     eax, edi                    ; Overlapped?\r
     jae     @CopyBackward               ; Copy backward if overlapped\r
 @@:\r
     xor     ecx, ecx\r
@@ -70,8 +75,8 @@ InternalMemCopyMem  PROC    USES    esi edi
     add     esp, 16                     ; stack cleanup\r
     jmp     @CopyBytes\r
 @CopyBackward:\r
-    mov     edi, eax                    ; edi <- Last byte in Destination\r
-    lea     esi, [esi + edx - 1]        ; esi <- Last byte in Source\r
+    mov     esi, eax                    ; esi <- Last byte in Source\r
+    lea     edi, [edi + edx - 1]        ; edi <- Last byte in Destination\r
     std\r
 @CopyBytes:\r
     mov     ecx, edx\r