2474
|
1 ***********************************
|
|
2
|
|
3 * 16 x 8 Multiply (24 bit result)
|
|
4
|
|
5 * OTHER MODULES NEEDED: none
|
|
6
|
|
7 * ENTRY: A = multiplier
|
|
8 * X = multiplicand
|
|
9
|
|
10 * EXIT: A = product byte 1
|
|
11 * X = product bytes 2 & 3
|
|
12
|
|
13 nam 16x8 bit Multiply
|
|
14 ttl Assembler Library Module
|
|
15
|
|
16
|
|
17 psect MULT168,0,0,0,0,0
|
|
18
|
|
19 MULT168:
|
|
20 PSHS A,X save numbers
|
|
21 LEAS -3,S room for product
|
|
22 LDB 5,S get lsb of multiplicand
|
|
23 MUL
|
|
24 STD 1,S save partial product
|
|
25 LDD 3,S get mupltiplier & msb of multp.
|
|
26 MUL
|
|
27 ADDB 1,S add lsb to msb
|
|
28 ADCA #0 add carry
|
|
29 STD 0,S save sum of partial products
|
|
30 LDX 1,S get 2 lsb's
|
|
31 LEAS 6,S clean stack
|
|
32 RTS
|
|
33
|
|
34 endsect
|
|
35
|