]>
Commit | Line | Data |
---|---|---|
b341712e | 1 | #/*++\r |
2 | #\r | |
4ea9375a HT |
3 | #Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r |
4 | #This program and the accompanying materials \r | |
b341712e | 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 | #include "EfiBind.h"\r | |
24 | #---------------------------------------------------------------------------\r | |
25 | .686: \r | |
26 | #.MODEL flat,C\r | |
27 | .code: \r | |
28 | \r | |
29 | .globl ASM_PFX(DivU64x32)\r | |
30 | #---------------------------------------------------------------------------\r | |
31 | #\r | |
32 | #UINT64\r | |
33 | #MultU64x32 (\r | |
34 | # IN UINT64 Multiplicand,\r | |
35 | # IN UINTN Multiplier\r | |
36 | # );\r | |
37 | #\r | |
38 | #UINT64\r | |
39 | #Power10U64 (\r | |
40 | # IN UINT64 Operand,\r | |
41 | # IN UINTN Power\r | |
42 | # )\r | |
43 | #/*++\r | |
44 | #\r | |
45 | #Routine Description:\r | |
46 | #\r | |
47 | # Raise 10 to the power of Power, and multiply the result with Operand\r | |
48 | #\r | |
49 | #Arguments:\r | |
50 | #\r | |
51 | # Operand - multiplicand\r | |
52 | # Power - power\r | |
53 | #\r | |
54 | #Returns:\r | |
55 | #\r | |
56 | # Operand * 10 ^ Power\r | |
57 | #\r | |
58 | #--*/\r | |
59 | ASM_PFX(Power10U64):\r | |
60 | pushl %ebp\r | |
61 | movl %esp, %ebp\r | |
62 | movl 8(%ebp), %eax # dword ptr Operand[0]\r | |
63 | movl 0xC(%ebp), %edx # dword ptr Operand[4]\r | |
64 | movl 0x10(%ebp), %ecx #Power\r | |
65 | jcxz _Power10U64_Done\r | |
66 | \r | |
67 | _Power10U64_Wend: \r | |
3e99020d | 68 | pushl %ecx\r |
b341712e | 69 | pushl $10\r |
70 | push 0xC(%ebp)\r | |
71 | push 0x8(%ebp)\r | |
72 | call ASM_PFX(MultU64x32)\r | |
73 | addl $0xc, %esp\r | |
3e99020d | 74 | popl %ecx\r |
b341712e | 75 | movl %eax, 8(%ebp) # dword ptr Operand[0]\r |
76 | movl %edx, 0xC(%ebp) # dword ptr Operand[4]\r | |
77 | loopl _Power10U64_Wend\r | |
78 | \r | |
79 | _Power10U64_Done: \r | |
80 | \r | |
81 | popl %ebp\r | |
82 | ret\r | |
83 | #Power10U64 ENDP\r | |
84 | \r |