Last change
on this file since 7c5def4 was 4f508e6, checked in by Thomas Lopatic <thomas@…>, 7 years ago |
Converted assembly language files.
|
-
Property mode
set to
100644
|
File size:
732 bytes
|
Line | |
---|
1 | | ------------------------------------------------------------------------------
|
---|
2 | | lmul.s -- long multiply
|
---|
3 | | Version 2 -- 1989-07-18
|
---|
4 | | ------------------------------------------------------------------------------
|
---|
5 | .text
|
---|
6 |
|
---|
7 | .xdef lmul
|
---|
8 |
|
---|
9 | ARG1 = 8
|
---|
10 | ARG2 = 12
|
---|
11 |
|
---|
12 | TEMP = -4
|
---|
13 |
|
---|
14 | lmul: link a6,#-4
|
---|
15 | clr.w d2
|
---|
16 | tst.l ARG1(a6)
|
---|
17 | bge lmul1
|
---|
18 |
|
---|
19 | neg.l ARG1(a6)
|
---|
20 | addq.w #1,d2
|
---|
21 |
|
---|
22 | lmul1: tst.l ARG2(a6)
|
---|
23 | bge lmul2
|
---|
24 |
|
---|
25 | neg.l ARG2(a6)
|
---|
26 | addq.w #1,d2
|
---|
27 |
|
---|
28 | lmul2: move.w ARG1+2(a6),d0
|
---|
29 | mulu ARG2+2(a6),d0
|
---|
30 | move.l d0,TEMP(a6)
|
---|
31 | move.w ARG1(a6),d0
|
---|
32 | mulu ARG2+2(a6),d0
|
---|
33 | move.w ARG2(a6),d1
|
---|
34 | mulu ARG1+2(a6),d1
|
---|
35 | add.w d1,d0
|
---|
36 | add.w TEMP(a6),d0
|
---|
37 | move.w d0,TEMP(A6)
|
---|
38 | move.l TEMP(a6),d0
|
---|
39 | btst #0,d2
|
---|
40 | beq lmul3
|
---|
41 |
|
---|
42 | neg.l d0
|
---|
43 |
|
---|
44 | lmul3: unlk a6
|
---|
45 | rts
|
---|
46 |
|
---|
47 | .end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.