![background image](http://html1.mh-extra.com/html/omron/srm1-programing-02-2001/srm1-programing-02-2001_programming-manual_742414486.webp)
7-22
Section
Binary Calculation Instructions
468
Example
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.
CLC(41)
00000
ADB(50)
200
DM 0100
HR 10
MOV(21)
#0000
HR 11
MOV(21)
#0001
HR 11
TR 0
25504
25504
= R
= R+1
= R+1
Address
Instruction
Operands
00000
LD
00000
00001
OUT
TR
0
00002
CLC(41)
00003
ADB(50)
200
DM
0100
HR
10
00004
AND NOT
25504
00005
MOV(21)
#
0000
HR
11
00006
LD
TR
0
00007
AND
25504
00008
MOV(21)
#
00001
HR
11
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.
R+1: HR 11
R: HR 10
0
0
0
1
2
7
A
7
Au: IR 200
A
6
E
2
Ad: DM 0100
8
0
C
5
+
Note
For signed binary calculations, the status of the UF and OF flags indicate wheth-
er the result has exceeded the signed binary data range (–32,768 (8000) to
+32,767 (7FFF)).
7-22-2 BINARY SUBTRACT – SBB(51)
Mi
: Minuend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
Su
: Subtrahend word (binary)
IR, SR, AR, DM, HR, TC, LR, #
Ladder Symbols
Operand Data Areas
R
: Result word
IR, SR, AR, DM, HR, LR
SBB(51)
Mi
Su
R
@SBB(51)
Mi
Su
R
DM 6144 to DM 6655 cannot be used for R.
Limitations
Содержание SRM1 - PROGRAMING 02-2001
Страница 1: ...Programmable Controllers Cat No W353 E1 06 SYSMAC CPM1 CPM1A CPM2A CPM2C SRM1 V2 PROGRAMMING MANUAL ...
Страница 2: ...CPM1 CPM1A CPM2A CPM2C SRM1 V2 Programmable Controllers Programming Manual Revised February 2008 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 9: ...x ...
Страница 15: ...xvi ...