Neg (Negate) - Hitachi H8/300L Series Programming Manual

Hide thumbs Also See for H8/300L Series:
Table of Contents

Advertisement

2.2.34 NEG (negate)

Operation
0 - Rd → Rd
Assembly-Language Format
NEG Rd
Operand Size
Byte
Condition Code
I
H
— —
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 when an overflow occurs (the previous contents of the destination register was
H'80); otherwise cleared to 0.
C:
Set to 1 when there is a borrow from bit 7 (the previous contents of the destination register
was not H'00); otherwise cleared to 0.
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 and Number of Execution States
Addressing
mode
Mnem.
Register direct NEG
N
Z
V
C
Instruction code
Operands 1st byte 2nd byte
Rd
1
7
3rd byte 4th byte
8
rd
No. of
states
2
99

Advertisement

Table of Contents
loading

Table of Contents