![](http://datasheet.mmic.net.cn/380000/-PD784928Y_datasheet_16744934/-PD784928Y_332.png)
332
CHAPTER 7 DESCRIPTION OF INSTRUCTIONS
Multiply and Accumulate Word
Word Data Sum of Products Operation
[Instruction format]
MACW dst
[Operation]
AXDE
←
(B)
×
(C) + AXDE, B
←
B + 2, C
←
C + 2, byte
←
byte – 1
End if (byte = 0 or P/V = 1)
[Operands]
Mnemonic
Operands (dst, src)
MACW
byte
[Flags]
S
Z
AC
P/V
CY
×
×
×
V
×
[Description]
Signed multiplication is performed of the contents of the 2-byte area addressed by the B register and the contents
of the 2-byte area addressed by the C register, and binary addition is performed of the result and the contents
of the AXDE register.
After the result of the addition is stored in the AXDE register, the contents of the B register and C register are
incremented by 2.
The above operations are repeated the number of times equal to the 8-bit immediate data written in the operand.
If overflow or underflow is generated as a result of the addition, the value of the AXDE register is undefined.
Also, the B register and C register keep their values prior to overflow.
The area addressed by the MACW instruction is limited to addresses 0FE00H to 0FEFFH when the LOCATION
0 instruction is executed, or addresses 0FFE00H to 0FFEFFH when the LOCATION 0FH instruction is executed.
The lower byte of the address is specified by the B register and C register. Addresses FE80H to FEFFH (FFE80H
to FFEFFH when the LOCATION 0FH instruction is executed) are also used as general registers.
Interrupts and macro service requests are not acknowledged during execution of the MACW instruction.
The MACW instruction does not clear the value of the AXDE register pair automatically, and therefore this should
be cleared by the program if necessary.
The S, Z, AC, and CY flags are undefined as a result of the operation.
The P/V flag is set (1) if overflow or underflow occurs, and cleared (0) otherwise.
MACW