Intel 210200-002 Baby Furniture User Manual


 
NEG
NEGATE
NEG
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
o and 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.
Encoding:
11111
011
w 1 mod a 11 rIm 1
if w = a
then
SRC =
FFH
else SRC = FFFFH
Flags Affected:
AF, CF, OF,
PF,
SF, ZF
Attempting to negate a byte containing
-128
or a word containing
-32,768
causes no
change to the operand and sets
OF. NEG
updates AF, CF,
OF,
PF,
SF and ZF. CF
is
always set except when the operand
is
zero,
in
which case it
is
cleared.
NEG
Operands
Clocks·
Transfers
Bytes
NEG
Coding
Example
register
3
- 2
NEGAL
memory
16(24)
+ EA 2
2-4
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.
2-120