253
Comparison Instructions Section 5-18
of TR 0 unnecessary. With this type of programming, 10000, 10001, and
10002 are changed only when CMPL(60) is executed.
5-18-5 MULTI-WORD COMPARE – MCMP(19)
Limitations This instruction is available in the CQM1 only.
TB1 and TB1+15 must be in the same data area.
TB2 and TB2+15 must be in the same data area.
DM 6144 to DM 6655 cannot be used for R.
Description When the execution condition is OFF, MCMP(19) is not executed. When the
execution condition is ON, MCMP(19) compares the content of TB1 to TB2,
TB1+1 to TB2+1, TB1+2 to TB2+2, ..., and TB1+15 to TB2+15. If the first pair
is equal, the first bit in R is turned OFF, etc., i.e., if the content of TB1 equals
the content of TB2, bit 00 is turned OFF, if the content of TB1+1 equals the
content of TB2+1, bit 01 is turned OFF, etc. The rest of the bits in R will be
turned ON.
Flags ER: One of the tables (i.e., TB1 through TB1+15, or TB2 through TB2+15)
exceeds the data area.
Indirectly addressed DM word is non-existent. (Content of *DM word
is not BCD, or the DM area boundary has been exceeded.)
EQ: ON if the entire contents of both tables are equal and R=0000.
CMPL(60)
010
HR 09
00000
25505
10000
25507
10002
TR
0
25506
10001
Greater Than
Equal
Less Than
---
Address Instruction Operands
00000 LD 00000
00001 OUT TR 0
00002 CMPL(60)
HR 09
010
00003 AND 25505
00004 OUT 10000
00005 LD TR 0
00006 AND 25506
00007 OUT 10001
00008 LD TR 0
00009 AND 25507
00010 OUT 10002
TB1: First word of table 1
IR, SR, AR, DM, HR, TC, LR
TB2: First word of table 2
IR, SR, AR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
R: Result word
IR, SR, AR, DM, HR, TC, LR
MCMP(19)
TB1
TB2
R
@MCMP(19)
TB1
TB2
R