333
Binary Calculation Instructions
Section 5-22
Note
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.)
5-22-6 DOUBLE BINARY SUBTRACT – SBBL(––)
Limitations
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.
Description
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.
Au + 1: LR 01
Au: LR 00
Ad + 1: DM 0011
Ad: DM 0010
8
0
0
0
0
0
0
0
F
F
F
F
F
F
F
0
0
+
R + 1: DM 0021
R: DM 0020
F
F
F
0
7
F
F
F
1
CY (Cleared with CLC(41))
UF (SR 25405)
0
OF (SR 25404)
1
CY
Mi
:
First minuend word (binary)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Su
:
First subtrahend word (binary)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Ladder Symbols
Operand Data Areas
R
:
First result word
IR, SR, AR, DM, EM, HR, LR
SBBL(
−−
)
Mi
Su
R
@SBBL(
−−
)
Mi
Su
R
Mi + 1
Mi
Su + 1
Su
R + 1
R
−
CY
CY