Extension Instruction Specifications
3-21
SAT16 (16-bit saturation operation instruction)
[Instruction Format (Macro Name)]
SAT16 Dm, Dn
[Assembler Mnemonic]
udf04 Dm, Dn
[Operation]
When Dm is a 16-bit signed number which is the maximum positive value (0x00007fff) or more, the maximum
positive value (0x00007fff) is written into Dn. When Dm is a 16-bit signed number which is the maximum negative
value (0xffff8000) or less, the maximum negative value (0xffff8000) is stored in Dn. In all other cases, the contents
of Dm are written into Dn.
[Flag Changes]
Flag Change Condition
V * Undefined
C * Undefined
N + 1 when MSB of the operation results is 1; 0 in all other cases
Z + 1 when the operation results are 0; 0 in all other cases
[Programming Cautions]
PSW updating by flag changes is delayed by one instruction.
However, Bcc and Lcc instructions can evaluate flags without waiting for flag reflection to PSW.
The operations of "udf04 imm8, Dn", "udf04 imm16, Dn" and "udf04 imm32, Dn" are not assured. In addition, a
system error interrupt does not occur in these cases.