]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/DivU64x32.nasm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / DivU64x32.nasm
1 ;------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 ; SPDX-License-Identifier: BSD-2-Clause-Patent
5 ;
6 ; Module Name:
7 ;
8 ; DivU64x32.nasm
9 ;
10 ; Abstract:
11 ;
12 ; Calculate the quotient of a 64-bit integer by a 32-bit integer
13 ;
14 ;------------------------------------------------------------------------------
15
16 SECTION .text
17
18 ;------------------------------------------------------------------------------
19 ; UINT64
20 ; EFIAPI
21 ; InternalMathDivU64x32 (
22 ; IN UINT64 Dividend,
23 ; IN UINT32 Divisor
24 ; );
25 ;------------------------------------------------------------------------------
26 global ASM_PFX(InternalMathDivU64x32)
27 ASM_PFX(InternalMathDivU64x32):
28 mov eax, [esp + 8]
29 mov ecx, [esp + 12]
30 xor edx, edx
31 div ecx
32 push eax ; save quotient on stack
33 mov eax, [esp + 8]
34 div ecx
35 pop edx ; restore high-order dword of the quotient
36 ret
37