302
Binary Calculation Instructions Section 5-21
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 underflow and
overflow 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 DM word is non-existent. (Content of *DM word
is not BCD, or the 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 exceeds +2,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 subtraction with CY (SR 25504)
used to indicate a negative result (with unsigned data). The status of the UF
and OF flags indicate whether the result has exceeded the signed binary data
range (–2,147,483,648 (8000 0000) to +2,147,483,647 (7FFF FFFF)).
Note 1. For unsigned binary data, CY indicates that the result is negative. Take the
2’s complement using NEGL(––) to obtain the absolute value of the true
result. (UF and OF can be ignored.)
2. For signed binary data, the OF flag indicates that the result exceeds
+2,147,483,647 (7FFF FFFF). (CY can be ignored.)
Mi + 1 Mi
Su + 1 Su
R + 1 R
–
CY
CY
CLC(41)
00101
SBBL(––)
LR 02
DM 0012
DM 0022
Address Instruction Operands
00000 LD 00101
00001 CLC(41)
00002 SBBL(––)
LR 22
DM 0012
DM 0022
Mi + 1 : LR 03 Mi : LR 02
Su + 1 : DM 0023 Su : DM 0022
FFFF
FFF0
0
–
R + 1 : LR 03 R : LR 02
0
CY (Cleared with CLC(41))
UF (SR 25405)
1
OF (SR 25404)
1
CY
FFF07FFF
8000 0000
–