source: trunk/BOOTCODE/REGULAR/MATH.ASM@ 30

Last change on this file since 30 was 30, checked in by Ben Rietbroek, 14 years ago

AiR-BOOT v1.07 -- As released with eCS v2.1. [2011-05-06]
Signature-date: 2006-03-13. (incorrect)
Trunk contains buildable v1.07 version as distributed with eCS v2.1.
Directory 'tags' contains v1.06 & v1.07 reference versions
built for all languages. Note that language ID for 'Dutch' changed
from 'DT' to 'NL' in v1.07 and that the v1.06 reference version also
uses 'NL' for 'Dutch'.
Also note that helper programs like the installer and setaboot are
are only modified for the OS/2 versions in v1.07.
The signature-date for v1.07 incorrectly states the same
date as for v1.06. The signature-version is correct.
Removed other binaries. (cd-rom images, old releases, etc.)
The tags serve as reference versions:

  • v1.06: rebuilt from source. (tags/v1.06r)
  • v1.07: built as released with eCS v2.1. (tags/v1.07r)
File size: 2.5 KB
Line 
1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
2;
3; This file is part of AiR-BOOT
4;
5; AiR-BOOT is free software: you can redistribute it and/or modify it under
6; the terms of the GNU General Public License as published by the Free
7; Software Foundation, either version 3 of the License, or (at your option)
8; any later version.
9;
10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
11; WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
12; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13; details.
14;
15; You should have received a copy of the GNU General Public License along with
16; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
17;
18;---------------------------------------------------------------------------
19; AiR-BOOT / MATH
20;---------------------------------------------------------------------------
21
22
23; ----------------------
24; Rousseau: # MATH.ASM #
25; ----------------------
26; This module contains 32-bit multiply.
27; Other math-stuff should be placed here.
28
29
30IFDEF ModuleNames
31DB 'MATH',0
32ENDIF
33
34; Multiply two 32-bit operands
35; In: DX:AX - operand 1
36; BX:CX - operand 2
37; Out: BX:CX:DX:AX 64-bit result
38MATH_Mul32 Proc Near
39 local p3:word
40 local p2:word
41 local p1:word
42 local p0:word
43 local fb1:word
44 local fb0:word
45 local fa1:word
46 local fa0:word
47
48 ; Save parameters
49 mov [fb1],bx
50 mov [fb0],cx
51 mov [fa1],dx
52 mov [fa0],ax
53
54 ; Clear return value
55 xor ax,ax
56 mov [p3],ax
57 mov [p2],ax
58 mov [p1],ax
59 mov [p0],ax
60
61 ; Multiply high words
62 mov ax,[fa1]
63 mul [fb1]
64 mov [p2],ax
65 mov [p3],dx
66
67 ; Multiply high with low
68 mov ax,[fa1]
69 mul [fb0]
70 add [p1],ax
71 adc [p2],dx
72 adc [p3],0
73
74
75 ; Multiply low with high
76 mov ax,[fa0]
77 mul [fb1]
78 add [p1],ax
79 adc [p2],dx
80 adc [p3],0
81
82 ; Multiply low words
83 mov ax,[fa0]
84 mul [fb0]
85 mov [p0],ax
86 add [p1],dx
87 adc [p2],0
88 adc [p3],0
89
90 ; Return value BX:CX:DX:AX is QWORD result
91 mov bx,[p3]
92 mov cx,[p2]
93 mov dx,[p1]
94 mov ax,[p0]
95
96 ret
97MATH_Mul32 Endp
Note: See TracBrowser for help on using the repository browser.