250
Comparison Instructions Section 5-18
Example The following example shows the comparisons made and the results provided
for TCMP(85). Here, the comparison is made during each cycle when IR
00000 is ON.
5-18-3 BLOCK COMPARE – BCMP(68)
Note BCMP(68) is an expansion instruction for the SRM1. The function code 68 is
the factory setting and can be changed for the SRM1 if desired.
Limitations Each lower limit word in the comparison block must be less than or equal to
the upper limit.
DM 6144 to DM 6655 cannot be used for R.
Description When the execution condition is OFF, BCMP(68) is not executed. When the
execution condition is ON, BCMP(68) compares CD to the ranges defined by
a block consisting of CB, CB+1, CB+2, ..., CB+31. Each range is defined by
two words, the first one providing the lower limit and the second word provid-
ing the upper limit. If CD is found to be within any of these ranges (inclusive of
the upper and lower limits), the corresponding bit in R is set. The comparisons
CD: 001 Upper limits R: 216
IR 001 0210 DM 0000 0100 IR 21600 0
DM 0001 0200 IR 21601 0
DM 0002 0210 IR 21602 1
DM 0003 0400 IR 21603 0
DM 0004 0500 IR 21604 0
DM 0005 0600 IR 21605 0
DM 0006 0210 IR 21606 1
DM 0007 0800 IR 21607 0
DM 0008 0900 IR 21608 0
DM 0009 1000 IR 21609 0
DM 0010 0210 IR 21610 1
DM 0011 1200 IR 21611 0
DM 0012 1300 IR 21612 0
DM 0013 1400 IR 21613 0
DM 0014 0210 IR 21614 1
DM 0015 1600 IR 21615 0
TCMP(85)
001
DM 0000
216
00000
Compare the data in IR 001
with the given ranges.
Address Instruction Operands
00000 LD 00000
00001 TCMP(85)
001
DM 0000
216
CD: Compare data
IR, SR, AR, DM, HR, TC, LR, #
CB: First comparison block word
IR, SR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
R: Result word
IR, SR, AR, DM, HR, TC, LR
BCMP(68)
CD
CB
R
@BCMP(68)
CD
CB
R