]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.asm
1) Sync EdkCompatibilityPkg with EDK 1.04. The changes includes:
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BaseLib / Ia32 / MultU64x64.asm
CommitLineData
3eb9473e 1; Copyright (c) 2004, Intel Corporation \r
2; All rights reserved. This program and the accompanying materials \r
3; are licensed and made available under the terms and conditions of the BSD License \r
4; which accompanies this distribution. The full text of the license may be found at \r
5; http://opensource.org/licenses/bsd-license.php \r
6; \r
7; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
8; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
9;\r
10; Module Name:\r
11;\r
12; MultU64x64.asm\r
13;\r
14; Abstract:\r
15;\r
16; Calculate the product of a 64-bit integer and another 64-bit integer\r
17;\r
18;------------------------------------------------------------------------------\r
19\r
20 .386\r
21 .model flat,C\r
22 .code\r
23\r
24;------------------------------------------------------------------------------\r
25; UINT64\r
26; EFIAPI\r
27; InternalMathMultU64x64 (\r
28; IN UINT64 Multiplicand,\r
29; IN UINT64 Multiplier\r
30; );\r
31;------------------------------------------------------------------------------\r
32InternalMathMultU64x64 PROC USES ebx\r
33 mov ebx, [esp + 8] ; ebx <- M1[0..31]\r
34 mov edx, [esp + 16] ; edx <- M2[0..31]\r
35 mov ecx, ebx\r
36 mov eax, edx\r
37 imul ebx, [esp + 20] ; ebx <- M1[0..31] * M2[32..63]\r
38 imul edx, [esp + 12] ; edx <- M1[32..63] * M2[0..31]\r
39 add ebx, edx ; carries are abandoned\r
40 mul ecx ; edx:eax <- M1[0..31] * M2[0..31]\r
41 add edx, ebx ; carries are abandoned\r
42 ret\r
43InternalMathMultU64x64 ENDP\r
44\r
45 END\r