]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseMemoryLibRepStr/x64/CopyMem.asm
1. Updated function headers for all assembly function
[mirror_edk2.git] / MdePkg / Library / BaseMemoryLibRepStr / x64 / CopyMem.asm
index 43630715cb58e0b46d77bbf4b50c8cf009b9e52c..a2e04056fdf0be542dbe47926465122f1903084a 100644 (file)
 \r
     .code\r
 \r
+;------------------------------------------------------------------------------\r
+;  VOID *\r
+;  EFIAPI\r
+;  InternalMemCopyMem (\r
+;    IN VOID   *Destination,\r
+;    IN VOID   *Source,\r
+;    IN UINTN  Count\r
+;    )\r
+;------------------------------------------------------------------------------\r
 InternalMemCopyMem  PROC    USES    rsi rdi\r
     mov     rsi, rdx                    ; rsi <- Source\r
     mov     rdi, rcx                    ; rdi <- Destination\r
-    lea     r9, [rdi + r8 - 1]          ; r9 <- End of Destination\r
+    lea     r9, [rsi + r8 - 1]          ; r9 <- End of Source\r
     cmp     rsi, rdi\r
     mov     rax, rdi                    ; rax <- Destination as return value\r
     jae     @F\r
@@ -39,8 +48,8 @@ InternalMemCopyMem  PROC    USES    rsi rdi
     rep     movsq                       ; Copy as many Qwords as possible\r
     jmp     @CopyBytes\r
 @CopyBackward:\r
-    mov     rdi, r9                     ; rdi <- End of Destination\r
-    lea     rsi, [rsi + r8 - 1]         ; esi <- End of Source\r
+    mov     rsi, r9                     ; rsi <- End of Source\r
+    lea     rdi, [rdi + r8 - 1]         ; esi <- End of Destination\r
     std                                 ; set direction flag\r
 @CopyBytes:\r
     mov     rcx, r8\r