4 hardware multiplier special function bits, 5 hardware multiplier software restrictions – Texas Instruments MSP430x1xx User Manual
Page 98

Hardware Multiplier Special Function Bits
6-10
6.4
Hardware Multiplier Special Function Bits
Because the hardware multiplier module completes all multiplication
operations quickly, without interrupt intervention, no special function bits are
used.
6.5
Hardware Multiplier Software Restrictions
Two restrictions require attention when the hardware multiplier is used:
-
The indirect or indirect autoincrement address mode used to process the
result
-
The hardware multiplier used in an interrupt routine
6.5.1
Hardware Multiplier Software Restrictions—Address Mode
The result of the multiplication operation can be accessed in indexed, indirect,
or indirect autoincrement mode. The result registers may be accessed without
any restrictions if you use the indexed address mode including the symbolic
and absolute address modes. However, when you use the indirect and indirect
autoincrement address modes to access the result registers, you need at least
one instruction between loading the second operand and accessing one of the
result registers.
**********************************************************
*
EXAMPLE: MULTIPLY OPERAND1 AND OPERAND2
**********************************************************
RESLO
.SET
013AH
; RESLO = ADDRESS OF RESLO
PUSH
R5
; R5 WILL HOLD THE ADDRESS OF
MOV
#RESLO,R5
; THE RESLO REGISTER
MOV
&OPER1,&MPY ; LOAD 1ST OPERAND,
; DEFINES ADD. UNSIGNED MULTIPLY
MOV
&OPER2,&OP2 ; LOAD 2ND OPERAND AND START
; MULTIPLICATION
**********************************************************
*
EXAMPLE TO ADD THE RESULT OF THE HARDWARE
*
*
MULTIPLICATION TO THE RAM DATA, 64BITS
*
**********************************************************
NOP
; MIN. ONE CYCLES BETWEEN MOVING
; THE OPERAND2 TO HW–MULTIPLIER
; AND PROCESSING THE RESULT WITH
; INDIRECT ADDRESS MODE
ADD
@R5+,&RAM
; ADD LOW RESULT TO RAM
ADDC
@R5,&RAM+2
; ADD HIGH RESULT TO RAM+2
ADC
&RAM+4
; ADD CARRY TO EXTENSION WORD
ADC
&RAM+6
; IF 64 BIT LENGTH IS USED
POP
R5
The previous example shows that the indirect or indirect autoincrement
address modes, when used to transfer the result of a multiplication operation
to the destination, need more cycles and code than the absolute address
mode. There is no need to access the hardware multiplier using the indirect
addressing mode.