6 BASIC INSTRUCTIONS
6.5 Data Conversion Instructions
283
6
Two's complement of 32-bit binary data (sign inversion)
DNEG(P)
These instructions invert the sign of the 32-bit binary data in the device specified by (d), and store the resultant data in the
device specified by (d).
■Descriptions, ranges, and data types
■Applicable devices
• These instructions invert the sign of the 32-bit binary data in the device specified by (d), and store the resultant data in the
device specified by (d).
• They are used when a positive or negative sign is to be inverted.
Note that data is inverted in every operation cycle in a continuous operation type (DNEG) instruction.
There is no operation error.
Ladder diagram Structured text
ENO:=DNEG(EN,d);
ENO:=DNEGP(EN,d);
Operand Description Range Data type Data type (label)
(d) Head device for storing the data that performs two's
complement
-2147483648 to +2147483647 32-bit signed binary ANY32
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(d)
1
(d)
(d)
···b31 b0
111 1111 10 00100
···b31 b0
000 00 0 001 11100
111 1111 10 00100
000 0000 00 00000
-
··· -218460
··· 218460
Before execution
Sign conversion
After execution
32 bits