Omron CVM1D Operation Manual page 274

Hide thumbs Also See for CVM1D:
Table of Contents

Advertisement

Symbol Math Instructions
Precautions
Flags
Example
DOUBLE BCD SUBTRACT WITHOUT CARRY
When the execution condition is OFF, –BL(415) is not executed. When the
execution condition is ON, –BL(415) subtracts the 8-digit BCD content of Su and
Su+1 from the 8-digit BCD content 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 0000 0000.
BCD SUBTRACT WITH CARRY
When the execution condition is OFF, –BC(416) is not executed. When the
execution condition is ON, –BC(416) subtracts the BCD contents of Su and CY
from Mi, and places the result in R. 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 0000.
DOUBLE BCD SUBTRACT WITH CARRY
When the execution condition is OFF, –BCL(417) is not executed. When the
execution condition is ON, –BCL(417) subtracts CY and the 8-digit BCD content
of Su and Su+1 from the 8-digit BCD content in Mi and Mi+1, and places the re-
sult 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 0000 0000.
Mi and Su (or Mi, Mi+1, Su, and Su+1) must be BCD. If any other data is used,
the Error Flag (A50003) will turn ON and the instruction will not be executed.
Note Refer to page 101 for general precautions on operand data areas.
ER (A50003):
Mi and Su (or Mi, Mi+1, Su, and Su+1) are not BCD.
The content of a*DM word is not BCD when set for BCD.
CY (A50004):
Subtraction result exceed the digits.
EQ(A50006):
The result after the subtraction is all zeros.
–BL Operation
When CIO 000000 is ON in the following example, the content of D00111 and
D00110 is subtracted from the content of D00101 and D00100, and the result is
output in eight-digit BCD to D00121 and D00120. CY is set if the result is nega-
tive
Mi + 1
Su + 1
CY
R + 1
Mi
– Su
– CY
Mi + 1
Su + 1
CY
R + 1
Section 5-20
Mi
Su
R
CY
R
Mi
Su
CY
R
269

Advertisement

Table of Contents
loading

Table of Contents