Binary Calculation Instructions
+
CY
1
Note
5-22-6 DOUBLE BINARY SUBTRACT – SBBL(––)
Limitations
Description
Au: LR 00
Au + 1: LR 01
8
0
0
0
0
Ad + 1: DM 0011
Ad: DM 0010
F
F
F
F
F
R + 1: DM 0021
R: DM 0020
7
F
F
F
F
1. For unsigned binary addition, CY indicates that the sum of the two values
exceeds FFFF FFFF. (UF and OF can be ignored.)
2. For signed binary addition, the UF flag indicates that the sum of the two
values is below –2,147,483,648 (8000 0000). (CY can be ignored.)
Ladder Symbols
SBBL(−−)
Mi
Su
R
Mi and Mi+1 must be in the same data area, as must Su and Su+1, and R and
R+1.
DM 6142 to DM 6655 cannot be used for R.
When the execution condition is OFF, SBBL(––) is not executed. When the
execution condition is ON, SBBL(––) subtracts CY and the eight-digit value in
Su and Su+1 from the eight-digit value in Mi and Mi+1, and places the result
in R and R+1. If the result is negative, CY is set and the 2's complement of the
actual result is placed in R+1 and R. Use NEGL(––) to convert the 2's comple-
ment to the true result.
SBBL(––) can also be used to subtract signed binary data. The Overflow and
Underflow Flags (SR 25404 and SR 25405) indicate whether the result has
exceeded the lower or upper limits of the 32-bit signed binary data range.
0
0
0
F
F
0
0
CY (Cleared with CLC(41))
F
F
0
1
UF (SR 25405)
0
OF (SR 25404)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
@SBBL(−−)
Su: First subtrahend word (binary)
Mi
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Su
R
Mi + 1
Su + 1
−
CY
R + 1
Section 5-22
Operand Data Areas
Mi: First minuend word (binary)
R: First result word
IR, SR, AR, DM, EM, HR, LR
Mi
Su
CY
R
333
Need help?
Do you have a question about the CQM1H - PROGRAM and is the answer not in the manual?