NEG (NEGate)
NEG
<Description>
This instruction replaces the contents of an 8-bit general register with its two's complement.
(subtracts the register contents from H'00).
If the original contents of the destination register was H'80, the register value remains H'80
and the overflow flag is set.
<Instruction Formats>
<Operation>
0 – Rd
→
Rd
<Assembly-Language Format>
NEG
Rd
<Examples>
NEG R0L
<Operand Size>
Byte
<Condition Code>
I: Previous value remains unchanged.
H: Set to "1" when there is a borrow from
bit 3; otherwise cleared to "0."
N: Set to "1" when the result is negative;
otherwise cleared to "0."
Z: Set to "1" when the result is zero;
otherwise cleared to "0."
V: Set to "1" if an overflow occurs (the
previous contents of the destination
register was H'80); otherwise cleared to
"0."
C: Set to "1" if there is a borrow from bit 7
(the previous contents of the destination
register was not H'00); otherwise
cleared to "0."
I
H
N
Z
V
C
—
—
↕
—
↕
↕
↕
↕
Register direct
NEG
Rd
1
7
8
rd
2
Addressing
mode
Mnem.
Operands
1st byte
Instruction code
No. of
states
2nd byte
3rd byte
4th byte
91
Содержание H8/300 Series
Страница 2: ...H8 300 Programming Manual...