Neg (Negate) - Renesas H8/300 Series Programming Manual

Table of Contents

Advertisement

NEG (NEGate)

<Operation>
0 – Rd → Rd
<Assembly-Language Format>
NEG Rd
<Examples>
NEG R0L
<Operand Size>
Byte
<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>
Addressing
mode
Register direct
Mnem.
Operands
NEG
Rd
<Condition Code>
I
— —
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."
Instruction code
1st byte
2nd byte
1
7
8
rd
91
H
N
Z
3rd byte
4th byte
NEG
V
C
No. of
states
2

Advertisement

Table of Contents
loading

Table of Contents