Symbol Math Instructions
Description
Flags
Precautions
Note
Examples
3-10-16 DOUBLE BCD SUBTRACT WITH CARRY: –BCL(417)
Purpose
Ladder Symbol
–BC(416) subtracts BCD values in Su and CY from Mi and outputs the result
to R. If the result is negative, it is output to R as a 2's complement.
–
CY will turn
CY
ON when there
is a borrow.
Name
Label
Error Flag
ER
Equals Flag
=
Carry Flag
CY
If Mi and/or Su are not BCD, an error is generated and the Error Flag will turn
ON.
If as a result of the subtraction, the content of R is 0000 hex, the Equals Flag
will turn ON.
If an addition results in a borrow, the Carry Flag will turn ON.
To clear the Carry Flay (CY), execute the Clear Carry (CLC(041)) instruction.
When CIO 0.00 is ON in the following example, D110 and CY will be sub-
tracted from D100 as 4-digit BCD values, and the result will be output to
D120.
0.00
D100
D110
D120
Subtracts 8-digit (double-word) BCD data and/or constants with the Carry
Flag (CY).
–BCL(417)
Mi: 1st minuend word
Mi
Su: 1st subtrahend word
Su
R
R: 1st result word
(BCD)
Mi
(BCD)
Su
CY
(BCD)
R
Operation
ON when Mi is not BCD.
ON when Su is not BCD.
OFF in all other cases.
ON when the result is 0.
OFF in all other cases.
ON when the subtraction results in a borrow.
OFF in all other cases.
Section 3-10
367
Need help?
Do you have a question about the CP - PROGRAMMING MANUAL 05-2007 and is the answer not in the manual?
Questions and answers