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