Double Binary Subtract - Sbbl - Omron SYSMAC C200HS Operation Manual

Programmable controllers
Hide thumbs Also See for SYSMAC C200HS:
Table of Contents

Advertisement

Binary Calculations
+
5-20-6 DOUBLE BINARY SUBTRACT – SBBL(––)
Limitations
Description
In the case below, 1,799,100,099 + (–282,751,929) = 1,516,348,100
(6B3C167D + EF258C47 = 5A61A2C4). Neither OF nor UF are turned ON.
Au : LR 20
Au + 1 : LR 21
6
B
3
C
1
Ad + 1 : DM 0011
Ad : DM 0010
8
E
F
2
5
R + 1 : DM 0021
R : DM 0020
5
A
6
1
A
Note The status of the CY flag can be ignored when adding signed binary data since it
is relevant only in the addition of normal hexadecimal values.
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.
When the execution condition is OFF, SBBL(––) is not executed. When the ex-
ecution 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 re-
sult is placed in R+1 and R. Use the DOUBLE 2's COMPLEMENT instructions to
convert the 2's complement to the true result.
CY
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 ex-
ceeded the lower or upper limits of the 32-bit signed binary data range. Refer to
page 29 for details on signed binary data.
6
7
D
C
4
7
0
CY (Cleared with CLC(41))
2
C
4
0
UF (SR 25405)
0
OF (SR 25404)
@SBBL(––)
Mi
Su
R
Mi + 1
Mi
Su + 1
Su
CY
R + 1
R
Section 5-20
Operand Data Areas
Mi: First minuend word (binary)
IR, SR, AR, DM, HR, TC, LR
Su: First subtrahend word (binary)
IR, SR, AR, DM, HR, TC, LR
R: First result word
IR, SR, AR, DM, HR, LR
227

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents