
Chapter 5. Application instructions
5-126
5.19 Sign inversion instruction
5.19.1 NEG, NEGP, DNEG, DNEGP
NEG
(Sign inverse)
FUN(240) NEG
FUN(242) DNEG
FUN(241) NEGP
FUN(243) DNEGP
Applicable
CPU
K200S
K300S
K1000S
Available Device
Flag
Instructions
M
P
K
L
F
T
C
S
D
#D Integer
Steps
Error
(F110)
Zero
(F111)
Carry
(F112)
NEG(P)
DNEG(P)
O O O O*
O O
O O
1
O
* Available only when do not use computer link module or data link module
1) Functions
-
NEG(P) : Re verses the sign of the 16 bits data of device specified as [ D ] and stores the result in
the device specified as [ D ].
-
DNEG(P) : Reversees the sign of the 32 bits data of device specified as [ D+1, D ] and stores the
result in the device specified as [ D+1, D ].
-
Used to reverse the positive sign to the negative sign or vice versa.
Operand setting
NEG
NEGP
DNEG
DNEGP
D
D
The device which stores the
data to be inversed.
D
D
16 bits
0
0
1
1
1
0
1
0
1
1
0
1
0
0
1
1
Before execution
D
0
0
1
1
1
0
1
0
1
1
0
1
0
0
1
1
h3AD3
Sign inversion
(2’s complement)
1
1
0
0
0
1
0
1
0
0
1
0
1
1
0
1
hC52D
After execution
D
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
–
= 15059
= –15059
16bits