Infineon Technologies C166S V2 User Manual page 335

16-bit microcontroller
Table of Contents

Advertisement

CoMACM
Group
Syntax
Source Operand(s)
Destination Operand(s)
Operation
IF (MP = 1) THEN
ELSE
END IF
(MAL) ← 0
((IDXi(-*))) ← ((IDXi))
Description
Multiplies the two signed 16-bit source operands op1 and op2. The resulting signed
32-bit product is first sign-extended; then, if the MP flag is set, it is one-bit left shifted;
and next, it is added to the 40-bit ACC register contents. Finally, the result is 2s
complement rounded before being stored in the 40-bit ACC register. The MAL register
is cleared. In parallel to the arithmetic operation and to the two parallel reads, the data
pointed to by IDXi overwrites another data located in memory (DPRAM). The address
of the overwritten data depends on the operation executed on IDXi.
MAC Flags
MV
MSL
*
*
MV
Set if an arithmetic overflow occurred, i.e. the result cannot be
represented in the 40-bit data type. Cleared otherwise.
MSL
Set if the contents of ACC is automatically saturated. Not affected
otherwise.
ME
Set if the MAE is used. Cleared otherwise.
MSV Set if an arithmetic overflow occurred. Not affected otherwise.
MC
Set if a carry is generated. Cleared otherwise.
MZ
Set if result equals zero. Cleared otherwise.
User Manual
Multiply-Accumulate & Move & Round
Multiply/Multiply-Accumulate Instructions
CoMACM op1, op2, rnd
op1, op2 → WORD
ACC → 40-bit signed value
(tmp) ← (((op1)) * ((op2))) <<1
(ACC) ← (ACC) + (tmp) + 00 0000 8000h
(tmp) ← ((op1))*((op2))
(ACC) ← (ACC) + (tmp) + 00 0000 8000h
ME
MSV
*
*
Detailed Instruction Description
MC
MZ
*
*
8-335
User Manual
C166S V2
CoMACM
MN
Sat.
*
yes
V 1.7, 2001-01

Advertisement

Table of Contents
loading

Table of Contents