261
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Comparison Instructions
3
CMP/CMPL
CMP/CMPL
Applicable Program Areas
Operands
z Operand Specifications
Instruction Mnemonic Variations
Function
code
Function
COMPARE CMP !CMP 020
Compares two unsigned binary values (constants
and/or the contents of specified words) and out-
puts the result to the Arithmetic Flags in the Auxil-
iary Area.
DOUBLE COMPARE CMPL --- 060
Compares two double unsigned binary values
(constants and/or the contents of specified words)
and outputs the result to the Arithmetic Flags in
the Auxiliary Area.
Symbol
CMP CMPL
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
CMP CMPL CMP CMPL
S1
CMP: Comparison data 1
CMPL: Comparison data 1, rightmost word address
UINT UDINT 1 2
S2
CMP: Comparison data 2
CMPL: Comparison data 2, rightmost word address
UINT UDINT 1 2
Area
Word addresses
Indirect
DM/EM
addresses
Con-
stants
Registers
TK CF
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
CMP
S1, S2
OK OK OK OK OK OK OK OK OK OK OK
OK ---
OK --- --- --- ---
CMPL
S1, S2
--- OK
CMP(020)
S
1
S
2
S1: Comparison data 1
S
2: Comparison data 2
CMPL(060)
S
1
S
2
S1: Comparison data 1
S
2: Comparison data 2