335
CHAPTER 7 DESCRIPTION OF INSTRUCTIONS
Multiply and Accumulate with Saturation Word
Sum of Products Operation with Saturation Function
[Instruction format]
MACSW byte
[Operation]
AXDE
←
(B)
×
(C) + AXDE, B
←
B + 2, C
←
C + 2, byte
←
byte – 1 if byte = 0 then End,
if P/V = 1, then if overflow AXDE
←
7FFFFFFFH, end, if underflow AXDE
←
80000000H,
end
[Operands]
Mnemonic
Operands ($addr16)
MACSW
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 is generated as a result of the addition, the P/V flag is set (1) and the value of the AXDE register
is 7FFFFFFFH. If underflow is generated, the P/V flag is set (1) and the AXDE register value is 80000000H.
The B register and C register keep their values prior to overflow or underflow.
The area addressed by the MACSW 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 MACSW instruction.
The MACSW 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.
MACSW