]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Use ebp as frame buffer in DivU64x32. Fix a typo in GetPowerOfTwo.
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Jul 2008 05:57:04 +0000 (05:57 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Jul 2008 05:57:04 +0000 (05:57 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5532 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.asm

index 6e5d71e009f2a54352567450c032b34d9ec5befd..afe58667d65e2a32add530b7615d449a3647ec61 100644 (file)
 ;---------------------------------------------------------------------------\r
 \r
 DivU64x32 PROC\r
+    push ebp\r
+    mov ebp, esp\r
     xor edx, edx                    ; Clear EDX\r
 \r
-    mov eax, [esp + 8]              ; Put high 32 bits of 64-bit dividend in EAX\r
-    mov ecx, [esp + 12]             ; Put 32 bits divisor in ECX\r
+    mov eax, [ebp + 0Ch]              ; Put high 32 bits of 64-bit dividend in EAX\r
+    mov ecx, [ebp + 10h]            ; Put 32 bits divisor in ECX\r
     div ecx                         ; Dividend   Divisor  Quoitent...Remainder\r
                                     ;  0:EAX  /  ECX   =  EAX      EDX   \r
 \r
     push eax                        ; Push quoitent in stack\r
 \r
-    mov eax, [esp + 4]              ; Put low 32 bits of 64-bit dividend in EAX              \r
+    mov eax, [ebp + 8]              ; Put low 32 bits of 64-bit dividend in EAX              \r
     div ecx                         ; Leave the REMAINDER in EDX as High 32-bit of new dividend\r
                                     ; Dividend   Divisor  Quoitent...Remainder              \r
                                     ;  EDX:EAX  /  ECX   =  EAX      EDX               \r
 \r
-    mov ecx, [esp + 16]             ; Put &REMAINDER to ecx\r
+    mov ecx, [ebp + 14h]             ; Put &REMAINDER to ecx\r
 \r
     jecxz Label1                    ; If ecx == 0, no remainder exist, return with quoitent in EDX directly \r
     mov dword ptr [ecx], edx        ; Put EDX through REMAINDER pointer in ECX \r
 \r
 Label1:\r
     pop edx                         ; Pop High 32-bit QUOITENT to EDX\r
+    pop ebp\r
+\r
+    ret\r
 \r
 DivU64x32 ENDP\r
     END\r
index 2d7b6de7a321c51c61198cc9f158957b052076f5..af009c7a7a9a791995da542b064c52954bd69dfd 100644 (file)
@@ -47,7 +47,7 @@
 ;  two and less than Input\r
 ;\r
 ;--*/\r
-GetPowerOfTow PROC\r
+GetPowerOfTwo PROC\r
     xor     eax, eax\r
     mov     edx, eax\r
     mov     ecx, [esp + 8] ; dword ptr Input[4]\r
@@ -63,5 +63,5 @@ _F:
 _Exit:\r
 \r
     ret\r
-GetPowerOfTow  ENDP\r
+GetPowerOfTwo  ENDP\r
        END\r