
226
5-18-15 2’S COMPLEMENT – NEG(––)
S
: Source word
IR, SR, AR, DM, HR, TC, LR, #
Ladder Symbols
Operand Data Areas
R
: Result word
IR, SR, AR, DM, HR, LR
NEG(––)
S
R
Description
Converts the four-digit hexadecimal content of the source word (S) to its 2’s
complement and outputs the result to the result word (R). This operation is effec-
tively the same as subtracting S from 0000 and outputting the result to R.
If the content of S is 0000, the content of R will also be 0000 after execution, and
EQ (SR 25506) will be turned on.
If the content of S is 8000, the content of R will also be 8000 after execution, and
UF (SR 25405) will be turned on.
Note
Refer to page 27 for details on 16-bit signed binary data.
Flags
ER:
Indirectly addressed DM word is non-existent. (Content of
DM word is
not BCD, or the DM area boundary has been exceeded.)
EQ:
ON when the content of S is 0000; otherwise OFF.
UF:
ON when the content of S is 8000; otherwise OFF.
N:
ON when bit 15 of R is set to 1; otherwise OFF.
Example
The following example shows how to use NEG(––) to find the 2’s complement of
the hexadecimal value 001F and output the result to DM 0020.
NEG(––)
#001F
DM 0020
---
00000
Address
Instruction
Operands
00000
LD
00000
00001
NEG(––)
#
001F
DM
0020
#0000
#001F
#FFE1
–
Output to DM 0020.
Data Conversion
Section 5-18
Summary of Contents for SYSMAC C200HE
Page 1: ...Cat No W303 E1 09 OPERATION MANUAL Programmable Controllers C200HX C200HG C200HE ...
Page 2: ......
Page 3: ...C200HX C200HG C200HE Programmable Controllers Operation Manual Revised August 2004 ...
Page 6: ...vi ...
Page 10: ......
Page 12: ......
Page 380: ......
Page 410: ......
Page 438: ......
Page 464: ......
Page 474: ......
Page 522: ......
Page 538: ......
Page 552: ...534 Programmer Program Date Page Word Contents Notes Word Contents Notes Data Storage ...
Page 554: ......
Page 560: ......
Page 584: ......
Page 585: ......
Page 586: ...W303 E1 09 ...