208
Flags ER (A50003): Content of *DM word is not BCD when set for BCD.
GR (A50005): Cp1+1 and Cp1 is greater than Cp2+1 and Cp2.
EQ (A50006): Cp1+1 and Cp1 equals Cp2+1 and Cp2.
LE (A50007): Cp1+1 and Cp1 is less than Cp2+1 and Cp2.
When CIO 000000 is ON in the following example, the eight-digit content of
CIO 0011 and CIO 0010 is compared to the eight-digit content of CIO 0009 and
CIO 0008 and the result is output to the GR, EQ, and LE Flags. The results re-
corded in the GR, EQ, and LE Flags are immediately saved to CIO 000200
(Greater Than), CIO 000201 (Equals), and CIO 000202 (Less Than).
Address Instruction Operands
00000 LD 000000
00001 CMPL(021)
0010
0008
00002 OUT TR0
00003 AND A50005
00004 OUT 000200
00005 LD TR0
00006 AND A50006
00007 OUT 000201
00008 LD TR0
00009 AND A50007
00010 OUT 000202
5-16-3 BLOCK COMPARE: BCMP(022)
Variations
j BCMP(022)
(022)
BCMP S CB R
CB: 1
st
block word CIO, G, A, T, C, DM
R: Result word CIO, G, A, T, C, DM, DR, IR
S: Source data CIO, G, A, T, C, #, DM, DR, IR
Operand Data AreasLadder Symbol
When the execution condition is OFF, BCMP(022) is not executed. When the
execution condition is ON, BCMP(022) compares S to the ranges defined by a
block consisting of of CB, CB+1, CB+2, ..., CB+32. Each range is defined by two
words, the first one providing the lower limit and the second word providing the
upper limit. If S 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 that are
made and the corresponding bit in R that is set for each true comparison are
shown below. The rest of the bits in R will be turned OFF.
CB ≤ S ≤ CB+1 Bit 00
CB+2 ≤ S ≤ CB+3 Bit 01
CB+4 ≤ S ≤ CB+5 Bit 02
CB+6 ≤ S ≤ CB+7 Bit 03
CB+8 ≤ S ≤ CB+9 Bit 04
CB+10 ≤ S ≤ CB+11 Bit 05
CB+12 ≤ S ≤ CB+13 Bit 06
CB+14 ≤ S ≤ CB+15 Bit 07
CB+16 ≤ S ≤ CB+17 Bit 08
CB+18 ≤ S ≤ CB+19 Bit 09
CB+20 ≤ S ≤ CB+21 Bit 10
CB+22 ≤ S ≤ CB+23 Bit 11
Example
Description
Comparison Instructions Section 5-16
0000
00
A500
05(>)
A500
06(=)
0002
00
0002
01
A500
07(<)
0002
02
TR0
(021)
CMPL 0010 0008