280
Comparison Instructions
Section 5-19
Description
When the execution condition is OFF, XFRB(––) is not executed. When the
execution condition is ON, XFRB(––) copies the specified source bits to the
specified destination bits. The two rightmost digits of C specify the starting
bits in S and D and the leftmost two digits indicate the number of bits that will
be copied.
Note
Up to 255 (FF) bits can be copied at one time.
Example
In the following example, XFRB(––) is used to transfer 5 bits from IR 020 and
IR 021 to LR 00 and LR 01. The starting bit in IR 020 is D (13), and the start-
ing bit in LR 00 is E (14), so IR 02013 to IR 02101 are copied to LR 0014 to
LR 0102.
Flags
ER:
The specified source bits are not all in the same data area.
The specified destination bits are not all in the same 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.)
5-19 Comparison Instructions
5-19-1 COMPARE – CMP(20)
Limitations
When comparing a value to the PV of a timer or counter, the value must be in
BCD.
First bit of S (0 to F)
First bit of D (0 to F)
Number of bits (00 to FF)
LSB
MSB
C
XFRB(
−−
)
#05ED
020
LR 00
00001
Address Instruction
Operands
00000
LD
00001
00001
XFRB(
−−
)
#
05ED
020
LR
00
1 0 1 0 0 0 0 0
0 0 0 1 0
0 0 0 1
Bit
15
Bit
15
Bit
00
Bit
00
1 0 1
1 1
S: 020
D: LR 00
0 1 0 1 0 1 0 0 0 0 0
1 1 1 0 0 0 0
1
Bit
15
Bit
15
Bit
00
Bit
00
S+1: 021
D+1: LR 01
1 1 1
0 1 0 1 0
0 0 0 1 0
0 0 1 1
1
0 0
1 0 1
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
CMP(20)
Cp1
Cp2