286
Comparison Instructions
Section 5-19
Flags
ER:
One of the tables (i.e., TB1 through TB1+15, or TB2 through TB2+15)
exceeds the data area.
Indirectly addressed EM/DM word is non-existent.
(Content of
*
EM/
*
DM word is not BCD, or the EM/DM area boundary
has been exceeded.)
EQ:
ON if the entire contents of both tables are equal and R=0000.
Example
The following example shows the comparisons made and the results provided
for MCMP(19). Here, the comparison is made during each cycle when 00000
is ON.
5-19-6 SIGNED BINARY COMPARE – CPS(––)
Description
When the execution condition is OFF, CPS(––) is not executed. When the exe-
cution condition is ON, CPS(––) compares the 16-bit (4-digit) signed binary
contents in Cp1 and Cp2 and outputs the result to the GR, EQ, and LE flags in
the SR area.
IR 100
0100
DM 0200
0100
DM 030000
0
IR 101
0200
DM 0201
0200
DM 030001
0
IR 102
0210
DM 0202
0210
DM 030002
0
IR 103
ABCD
DM 0203
0400
DM 030003
1
IR 104
ABCD
DM 0204
0500
DM 030004
1
IR 105
ABCD
DM 0205
0600
DM 030005
1
IR 106
ABCD
DM 0206
0700
DM 030006
1
IR 107
0800
DM 0207
0800
DM 030007
0
IR 108
0900
DM 0208
0900
DM 030008
0
IR 109
1000
DM 0209
1000
DM 030009
0
IR 110
ABCD
DM 0210
0210
DM 030010
1
IR 111
ABCD
DM 0211
1200
DM 030011
1
IR 112
ABCD
DM 0212
1300
DM 030012
1
IR 113
1400
DM 0213
1400
DM 030013
0
IR 114
0210
DM 0214
0210
DM 030014
0
IR 115
1212
DM 0215
1600
DM 030015
1
MCMP(19)
100
DM 0200
DM 0300
00000
TB1: IR 100
Address Instruction
Operands
00000
LD
00000
00001
MCMP(19)
100
DM
0200
DM
0300
TB2: DM 0200
R: DM 0300
Cp1
: First compare word
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Cp2
:
Second compare word
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Ladder Symbols
Operand Data Areas
CPS(
−−
)
Cp1
Cp2
000
000
Not used. Set to 000.