1039
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Other Instructions
3
STC/CLC
Other Instructions
STC/CLC
Applicable Program Areas
Flags
*1 In CJ2, CS1-H, CJ1-H, CJ1M, and CS1D (for Single-CPU System) CPU Units, these Flags are left unchanged.
In CS1 and CJ1 CPU Units, these Flags are turned OFF.
Function
z STC
When the execution condition is ON, STC(040) turns ON the Carry Flag (CY). Although STC(040) turns
the Carry Flag ON, the flag will be turned ON/OFF by the execution of subsequent instructions which
affect the Carry Flag.
ROL(027), ROLL(572), ROR(028), and RORL(573) make use of the Carry Flag in their rotation shift
operations. When using any of these instructions, use STC(040) and CLC(041) to set and clear the
Carry Flag.
z CLC
When the execution condition is ON, CLC(040) turns OFF the Carry Flag (CY). Although CLC(040)
turns the Carry Flag OFF, the flag will be turned ON/OFF by the execution of subsequent instructions
which affect the Carry Flag.
+C(402), +CL(403), +BC(406), +BCL(407), -C(412), -CL(413), -BC(416), and -BCL(417) make use of
the Carry Flag in their addition operations. Use CLC(041) just before any of these instructions to
prevent any influence from other preceding instructions.
ROL(027), ROLL(572), ROR(028), and RORL(573) make use of the Carry Flag in their rotation shift
operations. When using any of these instructions, use STC(040) and CLC(041) to set and clear the
Carry Flag.
Hint
The +(400), +L(401), +B(404), +BL(405), -(410), -L(411), -B(414), and -BL(415) instructions do no
include the Carry Flag in their addition and subtraction operations. In general, use these instructions
when performing addition or subtraction.
Instruction Mnemonic Variations
Function
code
Function
SET CARRY STC @STC 040 Sets the Carry Flag (CY).
CLEAR CARRY CLC @CLC 041 Turns OFF the Carry Flag (CY).
Symbol
STC CLC
Area
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or transition
programs
Usage OK OK OK OK OK OK
Operand Description
Data type
STC CLC
Error Flag ER
Unchanged*
1
Unchanged*
1
Equals Flag =
Unchanged*
1
Unchanged*
1
Carry Flag CY ON ON
Negative Flag N
Unchanged*
1
Unchanged*
1
STC(040) CLC(041)