Double Bcd Subtract With Carry: -Bcl(417) - Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual

Sysmac cs/cj/one nsj series programmable controllers
Table of Contents

Advertisement

Symbol Math Instructions
Description
Flags
Precautions
Examples
3-11-16 DOUBLE BCD SUBTRACT WITH CARRY: –BCL(417)
Purpose
Ladder Symbol
458
–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
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.
Note To clear the Carry Flay (CY), execute the Clear Carry (CLC(041)) instruction.
When CIO 000000 is ON in the following example, D00110 and CY will be
subtracted from D00100 as 4-digit BCD values, and the result will be output to
D00120.
Subtracts 8-digit (double-word) BCD data and/or constants with the Carry
Flag (CY).
–BCL(417)
Mi
Su
R
(BCD)
Mi
(BCD)
Su
CY
(BCD)
R
Label
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.
Mi: 1st minuend word
Su: 1st subtrahend word
R: 1st result word
Section 3-11
Operation

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents