NEG
NEGATENEG
Operation:
(EA) +- SRC - (EA)
(EA) +- (EA) + 1 (affecting flags)
Description:
NEG destination
NEG (Negate) subtracts the destination operand, which may be a byte or a word, from oand returns the result to the destination. This forms the two's complement of the number, effectively reversing the sign of an integer. If the operand is zero, its sign is not changed.
Flags Affected:
AF, CF, OF, PF, SF, ZF
Attempting to negate a byte containing
Encoding:
11111 011 w 1mod a11 rIm 1
if w = athen SRC = FFH else SRC = FFFFH
NEG Operands | Clocks· | Transfers | Bytes | NEG Coding Example |
register | 3 | - | 2 | NEGAL |
memory | 16(24) + EA | 2 | NEG MULTIPLIER |
*b(w): where b denotes the number of clock cycles for byte operands and w denotes the number of clock cycles for word operands.