329
Binary Calculation Instructions
Section 5-22
In the case below, A6E2 + 80C5 = 127A7. The result is a 5-digit number, so
CY (SR 25504) = 1, and the content of R + 1 becomes #0001.
Note
For signed binary calculations, the status of the UF and OF flags indicate
whether the result has exceeded the signed binary data range (–32,768
(8000) to +32,767 (7FFF)).
5-22-2 BINARY SUBTRACT – SBB(51)
Limitations
DM 6144 to DM 6655 cannot be used for R.
Description
When the execution condition is OFF, SBB(51) is not executed. When the exe-
cution condition is ON, SBB(51) subtracts the contents of Su and CY from Mi
and places the result in R. If the result is negative, CY is set and the 2’s com-
plement of the actual result is placed in R.
SBB(51) 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 16-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 negative, i.e., when Mi is less than Su plus CY.
EQ:
ON when the result is 0.
OF:
ON when the result e32,767 (7FFF).
UF:
ON when the result is below –32,768 (8000).
R+1: HR 11
R: HR 10
0
0
0
1
2
7
A
7
Au: IR 010
A
6
E
2
Ad: DM 0100
8
0
C
5
+
Mi
:
Minuend word (binary)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Su
:
Subtrahend word (binary)
IR, SR, AR, DM, EM, HR, TIM/CNT, LR, #
Ladder Symbols
Operand Data Areas
R
:
Result word
IR, SR, AR, DM, EM, HR, LR
SBB(51)
Mi
Su
R
@SBB(51)
Mi
Su
R
Mi
−
Su
−
CY
CY
R