Download ColdFire Family Programmer`s Reference Manual

Transcript
MAC
MAC
Multiply Accumulate with Load
ACC + (Ry * Rx){<< | >>} SF → ACC
(<ea>y) → Rw
Operation:
Assembler syntax: MAC.sz Ry.{U,L},Rx.{U,L}SF,<ea>y&,Rw
where & enables the use of the MASK
Attributes:
Size = word, longword
Description: Multiply two 16- or 32-bit numbers to yield a 32-bit result, then add this product, shifted as
defined by the scale factor, to the accumulator. If 16-bit operands are used, the upper or lower word of each
register must be specified. In parallel with this operation, a 32-bit operand is fetched from the memory
location defined by <ea>y and loaded into the destination register, Rw. If the MASK register is specified
to be used, the <ea>y operand is ANDed with MASK prior to being used by the instruction.
Condition
Codes
(MACSR):
Instruction
Format:
N
∗
Z
∗
V
∗
N Set if the msb of the result is set; cleared otherwise
Z Set if the result is zero; cleared otherwise
V Set if an overflow is generated; unchanged otherwise
15
14
13
12
1
0
1
0
11
10
9
8
7
6
Register, Rw
0
1
Rw
5
4
3
sz
Scale
Factor
0
U/Lx U/Ly Mask
1
0
Source Effective Address
Mode
Register, Rx
2
0
Register
Register, Ry
Instruction Fields:
•
•
Register Rw[6,11–9] field— Specifies the destination register, Rw, where 0x0 is D0,..., 0x7 is D7,
0x8 is A0,..., 0xF is A7. Note that bit 6 of the operation word is the msb of the register number field.
Source Effective Address field specifies the source operand, <ea>y; use addressing modes in the
following table:
Addressing Mode
Mode
Register
Addressing Mode
Mode
Register
Dy
—
—
(xxx).W
—
—
Ay
—
—
(xxx).L
—
—
(Ay)
010
reg. number:Ay
#<data>
—
—
(Ay) +
011
reg. number:Ay
– (Ay)
100
reg. number:Ay
(d16,Ay)
101
reg. number:Ay
(d16,PC)
—
—
(d8,Ay,Xi)
—
—
(d8,PC,Xi)
—
—
ColdFire Family Programmer’s Reference Manual, Rev. 3
5-4
Freescale Semiconductor