X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=MdePkg%2FLibrary%2FBaseLib%2FIa32%2FDivU64x32Remainder.asm;h=1634ef478e29d05cd694363b2196e71463a33257;hb=bb817c56c51fabe92915fe30b168b4833cb2aed9;hp=f1c6c1f4acd1535295ba7f21b8707a8cf6aacab8;hpb=185d764218d07c06838d4758125a5ca66178e7c9;p=mirror_edk2.git diff --git a/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.asm b/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.asm index f1c6c1f4ac..1634ef478e 100644 --- a/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.asm +++ b/MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.asm @@ -1,7 +1,7 @@ ;------------------------------------------------------------------------------ ; -; Copyright (c) 2006, Intel Corporation -; All rights reserved. This program and the accompanying materials +; Copyright (c) 2006, Intel Corporation. All rights reserved.
+; This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at ; http://opensource.org/licenses/bsd-license.php @@ -23,19 +23,28 @@ .model flat,C .code +;------------------------------------------------------------------------------ +; UINT64 +; EFIAPI +; InternalMathDivRemU64x32 ( +; IN UINT64 Dividend, +; IN UINT32 Divisor, +; OUT UINT32 *Remainder +; ); +;------------------------------------------------------------------------------ InternalMathDivRemU64x32 PROC - mov ecx, [esp + 12] - mov eax, [esp + 8] + mov ecx, [esp + 12] ; ecx <- divisor + mov eax, [esp + 8] ; eax <- dividend[32..63] xor edx, edx - div ecx + div ecx ; eax <- quotient[32..63], edx <- remainder push eax - mov eax, [esp + 8] - div ecx - mov ecx, [esp + 20] - jecxz @F + mov eax, [esp + 8] ; eax <- dividend[0..31] + div ecx ; eax <- quotient[0..31] + mov ecx, [esp + 20] ; ecx <- Remainder + jecxz @F ; abandon remainder if Remainder == NULL mov [ecx], edx @@: - pop edx + pop edx ; edx <- quotient[32..63] ret InternalMathDivRemU64x32 ENDP