summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-21 05:57:04 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-07-21 05:57:04 +0000
commit0fb90682e7103d7f75c17b1b86595eb7f1f49d25 (patch)
tree55117eb5650a0df6fec4ea0a7c511c595c44696f /EdkCompatibilityPkg
parent95770ed8af43e1e3ff5d41d525bf23c0136548bf (diff)
downloadedk2-platforms-0fb90682e7103d7f75c17b1b86595eb7f1f49d25.tar.xz
Use ebp as frame buffer in DivU64x32. Fix a typo in GetPowerOfTwo.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5532 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm13
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.asm4
2 files changed, 11 insertions, 6 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm
index 6e5d71e009..afe58667d6 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm
@@ -56,27 +56,32 @@
;---------------------------------------------------------------------------
DivU64x32 PROC
+ push ebp
+ mov ebp, esp
xor edx, edx ; Clear EDX
- mov eax, [esp + 8] ; Put high 32 bits of 64-bit dividend in EAX
- mov ecx, [esp + 12] ; Put 32 bits divisor in ECX
+ mov eax, [ebp + 0Ch] ; Put high 32 bits of 64-bit dividend in EAX
+ mov ecx, [ebp + 10h] ; Put 32 bits divisor in ECX
div ecx ; Dividend Divisor Quoitent...Remainder
; 0:EAX / ECX = EAX EDX
push eax ; Push quoitent in stack
- mov eax, [esp + 4] ; Put low 32 bits of 64-bit dividend in EAX
+ mov eax, [ebp + 8] ; Put low 32 bits of 64-bit dividend in EAX
div ecx ; Leave the REMAINDER in EDX as High 32-bit of new dividend
; Dividend Divisor Quoitent...Remainder
; EDX:EAX / ECX = EAX EDX
- mov ecx, [esp + 16] ; Put &REMAINDER to ecx
+ mov ecx, [ebp + 14h] ; Put &REMAINDER to ecx
jecxz Label1 ; If ecx == 0, no remainder exist, return with quoitent in EDX directly
mov dword ptr [ecx], edx ; Put EDX through REMAINDER pointer in ECX
Label1:
pop edx ; Pop High 32-bit QUOITENT to EDX
+ pop ebp
+
+ ret
DivU64x32 ENDP
END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.asm
index 2d7b6de7a3..af009c7a7a 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.asm
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.asm
@@ -47,7 +47,7 @@
; two and less than Input
;
;--*/
-GetPowerOfTow PROC
+GetPowerOfTwo PROC
xor eax, eax
mov edx, eax
mov ecx, [esp + 8] ; dword ptr Input[4]
@@ -63,5 +63,5 @@ _F:
_Exit:
ret
-GetPowerOfTow ENDP
+GetPowerOfTwo ENDP
END