]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EfiCommonLib / Ia32 / Power10U64.c
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Power10U64.c
15
16 Abstract:
17
18 Calculates Operand * 10 ^ Power
19
20 --*/
21
22 #include "Tiano.h"
23
24 UINT64
25 MultU64x32 (
26 IN UINT64 Multiplicand,
27 IN UINTN Multiplier
28 );
29
30 UINT64
31 Power10U64 (
32 IN UINT64 Operand,
33 IN UINTN Power
34 )
35 /*++
36
37 Routine Description:
38
39 Raise 10 to the power of Power, and multiply the result with Operand
40
41 Arguments:
42
43 Operand - multiplicand
44 Power - power
45
46 Returns:
47
48 Operand * 10 ^ Power
49
50 --*/
51 {
52 __asm {
53 mov ecx, Power
54 jcxz _Power10U64_Done
55
56 _Power10U64_Wend:
57 push 10
58 push dword ptr Operand[4]
59 push dword ptr Operand[0]
60 call MultU64x32
61 mov dword ptr Operand[0], eax
62 mov dword ptr Operand[4], edx
63 loop _Power10U64_Wend
64
65 _Power10U64_Done:
66 }
67 }