]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EfiCommonLib / Ia32 / DivU64x32.asm
index 6e5d71e009f2a54352567450c032b34d9ec5befd..42ae8967736be583e49cdfb5affd56c31d0e2202 100644 (file)
@@ -1,8 +1,8 @@
 ;---------------------------------------------------------------------------\r
 ;/*++\r
 ;\r
-;Copyright (c) 2006, Intel Corporation                                                         \r
-;All rights reserved. This program and the accompanying materials                          \r
+;Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+;This program and the accompanying materials                          \r
 ;are licensed and made available under the terms and conditions of the BSD License         \r
 ;which accompanies this distribution.  The full text of the license may be found at        \r
 ;http://opensource.org/licenses/bsd-license.php                                            \r
 ;---------------------------------------------------------------------------\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