DOUBLE PRECISION MULTIPLY MODE
MOTOROLA DATA ARITHMETIC LOGIC UNIT 3 - 17
one instruction cycle. The ANDI instruction clears the DM mode bit, but, due to the
instruction execution pipeline, the Data ALU leaves the mode after one instruction cycle.
The double precision multiply algorithm uses the Y0 register at all stages. If the use of
the Data ALU is required in an interrupt service routine, Y0 should be saved together
with other Data ALU registers to be used, and should be restored before leaving the
interrupt routine.
If just single precision times double precision multiply is desired, two of the multiply oper-
ations may be deleted and replaced by suitable initialization and clearing of the accumu-
lator and Y0. Figure 3-12 shows the single precision times double precision algorithm.
Figure 3-13 shows a single precision times double precision multiply-accumulate algo-
rithm. First, the least significant parts of the double precision values are multiplied by the
single precision values and accumulated in the “Double Precision Multiply” mode. Then
the DM bit is cleared and the least significant part of the result is saved to memory. The
most significant parts of the double precision values are then multiplied by the single pre-
Y:X:
R5
SPMSP1
LSP1
R1
DP2DP3
DP1 R0
R0
DP3_DP2_DP1 = MSP1_LSP1 x SP
clr a #0,y0 ;clear a and y0
ori #$40,mr ;enter DP mode
move x:(r1)+,x0 y:(r5)+,y1 ;load LSP1 and SP
mac x0,y1,a x:(r1)+,x1 ;LSP1*SPa,
;load MSP1
mac y1,x1,a a0,x:(r0)+ ;shifted(a)+
; SP*MSP1a,
;save DP1
move a,l:(r0)+ ;save DP3_DP2
andi #$bf,mr ;exit DP mode
non-Data ALU operation ;pipeline delay
Figure 3-12 Single × Double Multiply Algorithm