2) Neg (W) - Hitachi H8/300H Series Programming Manual

Table of Contents

Advertisement

2.2.40 (2) NEG (W)

NEG (NEGate)
Operation
0 – Rd → Rd
Assembly-Language Format
NEG.W Rd
Operand Size
Word
Description
This instruction takes the two's complement of the contents of a 16-bit register Rd (destination
operand) and stores the result in the 16-bit register Rd (subtracting the register contents from
H'0000). If the original contents of Rd was H'8000, however, the result remains H'8000.
Available Registers
Rd: R0 to R7, E0 to E7
Operand Format and Number of States Required for Execution
Addressing
Mnemonic
Mode
Register direct
NEG.W
Notes
An overflow occurs if the previous contents of Rd was H'8000.
Condition Code
H: Set to 1 if there is a borrow at bit 11;
N: Set to 1 if the result is negative; otherwise
Z: Set to 1 if the result is zero; otherwise
V: Set to 1 if an overflow occurs; otherwise
C: Set to 1 if there is a borrow at bit 15;
Operands
1st byte
Rd
1
7
133
Negate Binary Signed
I
UI H
U
— —
otherwise cleared to 0.
cleared to 0.
cleared to 0.
cleared to 0.
otherwise cleared to 0.
Instruction Format
2nd byte
3rd byte
9
rd
N
Z
V
C
No. of
States
4th byte
2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents