332
Binary Calculation Instructions
Section 5-22
5-22-5 DOUBLE BINARY ADD – ADBL(––)
Limitations
Au and Au+1 must be in the same data area, as must Ad and Ad+1, and R
and R+1.
DM 6142 to DM 6655 cannot be used for R.
Description
When the execution condition is OFF, ADBL(––) is not executed. When the
execution condition is ON, ADBL(––) adds the eight-digit contents of Au+1
and Au, the eight-digit contents of Ad+1 and Ad, and CY, and places the result
in R. CY will be set if the result is greater than FFFF FFFF.
ADBL(––) can also be used to add 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.
Flags
ER:
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.)
CY:
ON when the result is greater than FFFF FFFF.
EQ:
ON when the result is 0.
OF:
ON when the result e2,147,483,647 (7FFF FFFF).
UF:
ON when the result is below –2,147,483,648 (8000 0000).
Example
The following example shows an eight-digit addition with CY (SR 25504) used
to represent the status of the 9th digit. The status of the UF and OF flags indi-
cate whether the result has exceeded the signed binary data range (–
2,147,483,648 (8000 0000) to +2,147,483,647 (7FFF FFFF)).
Au
:
First augend word (binary)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Ad
:
First addend 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
ADBL(
−−
)
Au
Ad
R
@ADBL(
−−
)
Au
Ad
R
Au + 1
Au
Ad + 1
Ad
R + 1
R
+
CY
CY
CLC(41)
00100
ADBL(
−−
)
LR 00
DM 0010
DM 0020
Address Instruction
Operands
00000
LD
00100
00001
CLC(41)
00002
ADBL(
−−
)
LR
20
DM
0010
DM
0020