3. Instructions
364
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Example Programming
If the result of the subtraction is a negative number (Mi<Su or Mi+1, Mi <Su+1, Su), the result is output
as a 2's complement. The Carry Flag (CY) will turn ON. To convert the 2's complement to the true
number, a program which subtracts the result from 0 is necessary, as an input condition of the Carry
Flag (CY). The Carry Flag turning ON thus indicates that the result of the subtraction is negative.
–C
D100
D110
D120
0.00
When CIO 0.00 is ON in the following example, D110 and CY will be
subtracted from D100 as 4-digit signed binary values and the result will
be output to D120.
–CL
D100
D110
D120
0.00
When CIO 0.00 is ON in the following example, D111, D110 and CY will be
subtracted from D101 and D100 as 8-digit signed binary values, and the
result will be output to D121 and D120.