Last change
on this file since b8080f6 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
Imported original source code.
|
-
Property mode
set to
100755
|
File size:
799 bytes
|
Line | |
---|
1 | * ------------------------------------------------------------------------------
|
---|
2 | * lmul.s -- long multiply
|
---|
3 | * Version 2 -- 1989-07-18
|
---|
4 | * ------------------------------------------------------------------------------
|
---|
5 | .text
|
---|
6 | *
|
---|
7 | .xdef lmul
|
---|
8 | *
|
---|
9 | ARG1 .equ 8
|
---|
10 | ARG2 .equ 12
|
---|
11 | *
|
---|
12 | TEMP .equ -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.