EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c

Go to the documentation of this file.
00001 /*++
00002 
00003 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
00004 This program and the accompanying materials                          
00005 are licensed and made available under the terms and conditions of the BSD License         
00006 which accompanies this distribution.  The full text of the license may be found at        
00007 http://opensource.org/licenses/bsd-license.php                                            
00008                                                                                           
00009 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
00010 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
00011 
00012 Module Name:
00013 
00014   Power10U64.c
00015 
00016 Abstract:
00017 
00018   Calculates Operand * 10 ^ Power
00019 
00020 --*/
00021 
00022 #include "Tiano.h"
00023 
00024 UINT64
00025 MultU64x32 (
00026   IN UINT64   Multiplicand,
00027   IN UINTN    Multiplier
00028   );
00029 
00030 UINT64
00031 Power10U64 (
00032   IN UINT64   Operand,
00033   IN UINTN    Power
00034   )
00035 /*++
00036 
00037 Routine Description:
00038 
00039   Raise 10 to the power of Power, and multiply the result with Operand
00040 
00041 Arguments:
00042 
00043   Operand  - multiplicand
00044   Power    - power
00045 
00046 Returns:
00047 
00048   Operand * 10 ^ Power
00049 
00050 --*/
00051 {
00052   __asm {
00053   mov    eax, dword ptr Operand[0]
00054   mov    edx, dword ptr Operand[4]
00055   mov    ecx, Power
00056   jcxz   _Power10U64_Done
00057   
00058 _Power10U64_Wend:
00059   push   ecx
00060   push   10
00061   push   dword ptr Operand[4]
00062   push   dword ptr Operand[0]
00063   call   MultU64x32
00064   add    esp, 0Ch
00065   pop    ecx
00066   mov    dword ptr Operand[0], eax
00067   mov    dword ptr Operand[4], edx
00068   loop   _Power10U64_Wend
00069 
00070 _Power10U64_Done:
00071   }
00072 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines