![background image](http://html1.mh-extra.com/html/omron/sysmac-c200h/sysmac-c200h_operation-manual_742423182.webp)
169
Second Subtraction
0000
HR 20 –7577
CY
–0
HR 20 2423
(0000 + (10000 – 7577))
CY
1
(negative result)
In the above case, the program would turn ON HR 2100 to indicate that the
value held in HR 20 is negative.
5-17-8
DOUBLE BCD SUBTRACT – SUBL(55)
Mi: First minuend word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
Su: First subtrahend word (BCD)
IR, SR, AR, DM, HR, TC, LR, #
Ladder Symbols
Operand Data Areas
R: First result word
IR, AR, DM, HR, LR
SUBL(55)
Mi
Su
R
@SUBL(55)
Mi
Su
R
When the execution condition is OFF, SUBL(55) is not executed. When the
execution condition is ON, SUBL(55) subtracts CY and the 8-digit contents of
Su and Su+1 from the 8-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 10’s complement of the
actual result is placed in R. To convert the 10’s complement to the true result,
subtract the content of R from zero. Since an 8-digit constant cannot be di-
rectly entered, use the BSET(71) instruction (see Section 5-14-5) to create
an 8-digit constant.
Mi + 1
Mi
Su + 1
Su
R + 1
R
–
CY
CY
Flags
ER:
Mi, M+1,Su, or Su+1 are not BCD.
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.
EQ:
ON when the result is 0.
The following example works much like that for single-word subtraction. In
this example, however, BSET(71) is required to clear the content of DM 0000
Description
Example
BCD Calculations
Section 5-17
Содержание SYSMAC C200H
Страница 1: ...OPERATION MANUAL C200H CPU01 E 03 E 11 E SYSMAC Programmable Controllers Cat No W130 E1 05 ...
Страница 2: ...C200H Programmable Controllers CPU01 E 03 E 11 E Operation Manual Revised June 2003 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 8: ...TABLE OF CONTENTS ix Glossary 345 Index 363 Revision History 369 ...
Страница 342: ...336 Programmer Program Date Page Word Contents Notes Word Contents Notes Data Storage ...
Страница 374: ...Cat No W130 E1 05 C200H Programmable Controllers CPU01 E 03 E 11 E OPERATION MANUAL ...