+//\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
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