EasyManua.ls Logo

Omron SYSMAC CV Series - Binary Subtract: Sbb(081)

Omron SYSMAC CV Series
636 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
262
Examples The following example shows a four-digit addition with CY used to place either
0000 or 0001 into R+1 to ensure that any carry is preserved.
(079)
CLC
(080)
ADB 0010 D00100 1210
(030)
MOV #0000 1211
0000
00
A500
04
= R
= R+1
00000 LD 000000
00001 OUT TR0
00002 CLC(079)
00003 ADB(080)
0010
D00100
1210
00004 AND NOT A50004
00005 MOV(030)
#0000
1211
00006 LD TR0
00007 AND A50004
00008 MOV(030)
#0001
1211
Address Instruction Operands
(030)
MOV #0001 1211
A500
04
TR0
= R+1
In the following example, A6E2 + 80C5 = 127A7. The result is a five-digit num-
ber, so CY (A50004) = 1, and the content of R + 1 becomes 0001.
R+1: D01001 R: D01000
000127A7
Au: CIO 0010
A6E2
Ad: D00100
80C5
+
Eight-digit binary numbers can be added more quickly and easily using the
DOUBLE BINARY ADD: ADBL(084) instruction instead of a combination of
ADB(080) instructions.
5-19-2 BINARY SUBTRACT: SBB(081)
Variations
j SBB(081)
(081)
SBB Mi Su R
Operand Data AreasLadder Symbol
Mi: Minuend word CIO, G, A, T, C, #, DM, DR, IR
R: Result word CIO, G, A, DM, DR, IR
Su: Subtrahend word CIO, G, A, T, C, #, DM, DR, IR
When the execution condition is OFF, SBB(081) is not executed. When the
execution condition is ON, SBB(081) 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. To obtain the true answer when the
result is negative, the 2’s complement placed in R must be subtracted from
0000.
Mi Su CY CY R
Description
Binary Calculation Instructions Section 5-19

Table of Contents

Related product manuals