ST10 FAMILY PROGRAMMING MANUAL
134/172
CoMAC(R/-)
Multiply-Accumulate & Optional Round
Group
Multiply/Multiply-Accumulate Instructions
Syntax
CoMAC op1,
op2
Operation
IF (MP = 1) THEN
(tmp) <-- ((op1) * (op2)) << 1
(ACC) <-- (ACC) + (tmp)
ELSE
(tmp) <-- (op1) * (op2)
(ACC) <-- (ACC) + (tmp)
END IF
Syntax
CoMAC op1, op2, rnd
Operation
IF (MP = 1) THEN
(tmp) <-- ((op1) * (op2)) << 1
(ACC) <-- (ACC) + (tmp) + 00 0000 8000
h
ELSE
(tmp) <-- (op1) * (op2)
(ACC) <-- (ACC) + (tmp) + 00 0000 8000
h
END IF
(MAL) <-- 0
Syntax
CoMAC- op1, op2
Operation
IF (MP = 1) THEN
(tmp) <-- ((op1) * (op2)) << 1
(ACC) <-- (ACC) - (tmp)
ELSE
(tmp) <-- (op1) * (op2)
(ACC) <-- (ACC) - (tmp)
END IF
Syntax
CoMACR op1, op2
Operation
IF (MP = 1) THEN
(tmp) <-- ((op1) * (op2)) << 1
(ACC) <-- (tmp) - (ACC)
ELSE
(tmp) <-- (op1) * (op2)
(ACC) <-- (tmp) - (ACC)
END IF
Syntax
CoMACRop1, op2, rnd
Operation
IF (MP = 1) THEN
(tmp) <-- ((op1) * (op2)) << 1
(ACC) <-- (tmp) - (ACC) + 00 0000 8000
h
ELSE
(tmp) <-- (op1) * (op2)
(ACC) <-- (tmp) - (ACC) + 00 0000 8000
h
END IF
(MAL) <-- 0
Data Types
DOUBLE WORD
Result
40-bit signed value
Description
Multiplies the two signed 16-bit source operands “op1” and “op2”. The obtained signed 32-bit product is first
sign-extended, then the condition MP flag is set, it is one-bit left shifted, then it is optionally negated prior
being added/subtracted to/from the 40-bit ACC register content. Finally, the obtained result is optionally
rounded before being stored in the 40-bit ACC register. The “-” option is used to negate the specified product,
the “R” option is used to negate the accumulator content, and finally the “rnd” option is used to round the
result using two’s complement rounding. The default sign option is “+” and the default round option is “no
round”. When “rnd” option is used, MAL register is automatically cleared. Note that “rnd” and “-” are exclusive
as well as “-” and “R”. This instruction might be repeated and allows up to two parallel memory reads.
Содержание ST10 Series
Страница 2: ......
Страница 4: ...ST10 FAMILY PROGRAMMING MANUAL 2 172...