NEG

NEG, NEGP, DNEG, DNEGP

 

NEG instruction changes the sign of the value and save the result in Destination (assigned device address).

If you negate a negative value, the result is positive. If you negate a positive value, the result is negative.

 

 

D

Destination

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

 

Error

Zero

Carry

NEG(P)

DNEG(P)

D

o

-

o

o

o

-

o

o

-

o

o

o

-

2

o

-

-

 

Example)

If X01 is ON, change the sign of DO(H3321) value to minus value and save it in D0 again.