3. Instructions
270
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Function
TCMP(085) compares the source data (S) to each of
the 16 words T through T+15 and turns ON the
corresponding bit in word R when the data are equal.
Bit n of R is turned ON if the content of T+n is equal
to S and it is turned OFF if they are not equal.
S is compared to the content of T and bit 00 of R is
turned ON if they are equal or OFF if they are not
equal, S is compared to the content of T+1 and bit 01
of R is turned ON if they are equal or OFF if they are
not equal, ..., and S is compared to the content of
T+15 and bit 15 of R is turned ON if they are equal or OFF if they are not equal.
Example Programming
When CIO 0.00 is ON in the following example, TCMP(085) compares the content of D100 with the
contents of words D200 through D215 and turns ON the corresponding bits in D300 when the contents
are equal or OFF when the contents are not equal.
T
T+1
T+14
T+15
S0
1
14
15
R
1: Data are equal.
0: Data aren't equal.
Comparison
TCMP
D100
D200
D300
0.00
S
T
D
S: D100
Comparison
03A1 T: D200
D201
D202
D203
D204
D205
D206
D207
D208
D209
D210
D211
D212
D213
D214
D215
0 0
0 1
0 2
1 3
0 4
0 5
0 6
0 7
0 8
0 9
1 10
0 11
0 12
0 13
0 14
1 15
02A1
0000
0120
03A1
0000
02A1
1234
5678
9ABC
DEF0
03A1
1234
5678
9ABC
DEF0
03A1
R: D300