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