summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm
diff options
context:
space:
mode:
authorbxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-28 07:28:19 +0000
committerbxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-28 07:28:19 +0000
commiteb227e96bd06a5b0f2f933187a679e7fb3382cd9 (patch)
treeb16e46f494d8d9d8552d8d0e882ad78019934071 /MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm
parent27169a56e67556796ab0410c8917436dc9aa2abf (diff)
downloadedk2-eb227e96bd06a5b0f2f933187a679e7fb3382cd9.tar.gz
edk2-eb227e96bd06a5b0f2f933187a679e7fb3382cd9.tar.bz2
edk2-eb227e96bd06a5b0f2f933187a679e7fb3382cd9.zip
1. Updated function headers for all assembly function
2. Optimized register usage in SetMemXX functions in all lib instances 3. Fixed a logical error in CopyMem for all lib instances git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1139 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm')
-rw-r--r--MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm16
1 files changed, 12 insertions, 4 deletions
diff --git a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm
index 7b3e5eafee..86677ef614 100644
--- a/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm
+++ b/MdePkg/Library/BaseMemoryLibRepStr/Ia32/CopyMem.asm
@@ -25,14 +25,22 @@
.model flat,C
.code
+;------------------------------------------------------------------------------
+; VOID *
+; InternalMemCopyMem (
+; IN VOID *Destination,
+; IN VOID *Source,
+; IN UINTN Count
+; )
+;------------------------------------------------------------------------------
InternalMemCopyMem PROC USES esi edi
mov esi, [esp + 16] ; esi <- Source
mov edi, [esp + 12] ; edi <- Destination
mov edx, [esp + 20] ; edx <- Count
- lea eax, [edi + edx - 1] ; eax <- End of Destination
+ lea eax, [esi + edx - 1] ; eax <- End of Source
cmp esi, edi
jae @F
- cmp eax, esi
+ cmp eax, edi
jae @CopyBackward ; Copy backward if overlapped
@@:
mov ecx, edx
@@ -41,8 +49,8 @@ InternalMemCopyMem PROC USES esi edi
rep movsd ; Copy as many Dwords as possible
jmp @CopyBytes
@CopyBackward:
- mov edi, eax ; edi <- End of Destination
- lea esi, [esi + edx - 1] ; esi <- End of Source
+ mov esi, eax ; esi <- End of Source
+ lea edi, [edi + edx - 1] ; edi <- End of Destination
std
@CopyBytes:
mov ecx, edx