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