2 Instruction Descriptions
2-370
NJ-series Instructions Reference Manual (W502)
The following example is for when In is INT#123.
The following example is for when In is UINT#123.
If you use a different data type for In and Out, make sure the valid range of Out includes the valid range
of In. Otherwise, an error will not occur and the value of Out will be an illegal value. For example, if the
value of In is SINT#-128 and the data type of Out is INT, the value of Out will be INT#-128 instead of
INT#128.
Precautions for Correct Use
abc:=Neg(INT#123);
LD ST
abc
INT#123
Neg
EN ENO
In
Out = abc
123(2#0000_0000_0111_1011)
−123(2#1111_1111_1000_0101)
In
Bits reversed and 1 added.
Out = abc
123(2#0000_0000_0111_1011)
65413(2#1111_1111_1000_0101)
In
Bits reversed and 1 added.
2#1000_0000
2#0000_0000_1000_0000
2#1111_1111_1000_0000
In=SINT#−128
Out=INT#−128
Bits reversed and 1 added.
Expanded to INT data.