]> git.proxmox.com Git - mirror_edk2.git/blob - StdLib/LibC/CRT/Ia32/mulll.S
Standard Libraries for EDK II.
[mirror_edk2.git] / StdLib / LibC / CRT / Ia32 / mulll.S
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
4 # This program and the accompanying materials are licensed and made available
5 # under the terms and conditions of the BSD License which accompanies this
6 # 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 # MathMultS64x64.S
15 #
16 # Abstract:
17 #
18 # 64-bit Math Worker Function.
19 # Multiplies a 64-bit signed or unsigned value by a 64-bit signed or unsigned value
20 # and returns a 64-bit result
21 #
22 #------------------------------------------------------------------------------
23
24 .686:
25 .code:
26
27 ASM_GLOBAL ASM_PFX(_mulll), ASM_PFX(MultS64x64)
28
29 #------------------------------------------------------------------------------
30 #
31 # void __cdecl __mulll (void)
32 #
33 #------------------------------------------------------------------------------
34 ASM_PFX(__mulll):
35 # Original local stack when calling __mulll
36 # -----------------
37 # | |
38 # |---------------|
39 # | |
40 # |--Multiplier --|
41 # | |
42 # |---------------|
43 # | |
44 # |--Multiplicand-|
45 # | |
46 # |---------------|
47 # | ReturnAddr** |
48 # ESP---->|---------------|
49 #
50
51 #
52 # Set up the local stack for Multiplicand parameter
53 #
54 movl 16(%esp), %eax
55 push %eax
56 movl 16(%esp), %eax
57 push %eax
58
59 #
60 # Set up the local stack for Multiplier parameter
61 #
62 movl 16(%esp), %eax
63 push %eax
64 movl 16(%esp), %eax
65 push %eax
66
67 #
68 # Call native MulS64x64 of BaseLib
69 #
70 jmp ASM_PFX(MultS64x64)
71
72 #
73 # Adjust stack
74 #
75 add $16, %esp
76
77 ret $16