]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ia32/DivU64x32Remainder.S
Import some basic libraries instances for Mde Packages.
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ia32 / DivU64x32Remainder.S
1 //
2 // Include common header file for this module.
3 //
4 #include "CommonHeader.h"
5
6 #------------------------------------------------------------------------------
7 #
8 # Copyright (c) 2006, Intel Corporation
9 # All rights reserved. This program and the accompanying materials
10 # are licensed and made available under the terms and conditions of the BSD License
11 # which accompanies this distribution. The full text of the license may be found at
12 # http://opensource.org/licenses/bsd-license.php
13 #
14 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #
17 # Module Name:
18 #
19 # DivError.asm
20 #
21 # Abstract:
22 #
23 # Set error flag for all division functions
24 #
25 #------------------------------------------------------------------------------
26
27 .globl ASM_PFX(InternalMathDivRemU64x32)
28
29 #------------------------------------------------------------------------------
30 # UINT64
31 # EFIAPI
32 # InternalMathDivRemU64x32 (
33 # IN UINT64 Dividend,
34 # IN UINT32 Divisor,
35 # OUT UINT32 *Remainder
36 # );
37 #------------------------------------------------------------------------------
38 ASM_PFX(InternalMathDivRemU64x32):
39 movl 12(%esp), %ecx
40 movl 8(%esp), %eax
41 xorl %edx, %edx
42 divl %ecx
43 push %eax
44 movl 8(%esp), %eax
45 divl %ecx
46 movl 20(%esp), %ecx
47 jecxz L1
48 movl %edx, (%ecx)
49 L1:
50 pop %edx
51 ret