387
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Conversion Instructions
3
NEG/NEGL
NEG/NEGL
Applicable Program Areas
Operands
z Operand Specifications
Flags
Instruction Mnemonic Variations
Function
code
Function
2'S COMPLEMENT NEG @NEG 160
Calculates the 2's complement of a word of hexa-
decimal data.
DOUBLE 2'S COMPLEMENT NEGL @NEGL 161
Calculates the 2's complement of two words of
hexadecimal data.
Symbol
NEG NEGL
Area
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or
transition programs
Usage OK OK OK OK OK OK
Operand Description
Data type Size
NEG NEGL NEG NEGL
S
NEG: Source word
NEGL: First source word
WORD DWORD 1 2
R
NEG: Result word
NEGL: First result word
UINT UDINT 1 2
Area
Word addresses
Indirect DM/EM
addresses
Con-
stants
Registers Flags
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
TK CF
NEG
S
OK OK OK OK OK OK OK OK OK OK
OK
OK --- OK --- --- --- ---
R ---
NEGL
S
OK OK OK OK OK OK OK OK OK OK
OK
--- --- OK --- --- --- ---
R ---
Name Label Operation
Error Flag ER OFF
Equals Flag = • ON if the result is 0000/0000 0000.
• OFF in all other cases.
Negative Flag N • ON if bit 15 of the result is ON.
• OFF in all other cases.
S: Source word
R: Result word
NEG(160)
S
R
S: First source word
R: First result word
NEGL(161)
S
R