Other Instructions; Stc/Clc - Omron SYSMAC CP Series Instruction & Reference Manual

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 Instructions

Other Instructions

STC/CLC

Instruction
SET CARRY
CLEAR CARRY
Symbol
Applicable Program Areas
Area
Usage
Flags
Operand
Carry Flag
P_CY
Function
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) and ROR(028) make use of the Carry Flag in their rotation shift operations.
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 pre-
vent any influence from other preceding instructions.
ROL(027) and ROR(028) make use of the Carry Flag in their rotation shift operations.
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.
2-398
Mnemonic
Variations
STC
@STC
CLC
@CLC
STC
STC(040)
Step program areas
OK
Description
ON
Function
code
040
Sets the Carry Flag (CY).
041
Turns OFF the Carry Flag (CY).
Subroutines
OK
Data type
STC
OFF
CP1E CPU Unit Instructions Reference Manual(W483)
Function
CLC
CLC(041)
Interrupt tasks
OK
CLC

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents