Omron CP1H CPU Operation Manual page 214

Cp1h cpu unit
Hide thumbs Also See for CP1H CPU:
Table of Contents

Advertisement

Condition Flags
Name
Carry Flag
P_CY
Greater Than Flag P_GT
Equals Flag
P_EQ
Less Than Flag
P_LT
Negative Flag
P_N
Overflow Flag
P_OF
Underflow Flag
P_UF
Greater Than or
P_GE
Equals Flag
Not Equal Flag
P_NE
Less Than or
P_LE
Equals Flag
Always ON Flag
P_On
Always OFF Flag
P_Off
Using the Condition Flags
180
Symbol
Turned ON when there is a carry in the result of an arithmetic opera-
tion or a "1" is shifted to the Carry Flag by a Data Shift instruction.
The Carry Flag is part of the result of some Data Shift and Symbol
Math instructions.
Turned ON when the first operand of a Comparison Instruction is
greater than the second or a value exceeds a specified range.
Turned ON when the two operands of a Comparison Instruction are
equal the result of a calculation is 0.
Turned ON when the first operand of a Comparison Instruction is less
than the second or a value is below a specified range.
Turned ON when the most significant bit (sign bit) of a result is ON.
Turned ON when the result of calculation overflows the capacity of the
result word(s).
Turned ON when the result of calculation underflows the capacity of
the result word(s).
Turned ON when the first operand of a Comparison Instruction is
greater than or equal to the second.
Turned ON when the two operands of a Comparison Instruction are
not equal.
Turned ON when the first operand of a Comparison Instruction is less
than or equal to the second.
Always ON. (Always 1.)
Always OFF. (Always 0.)
The Condition Flags are shared by all of the instructions, so their status may
change often in a single cycle. Be sure to read the Condition Flags immedi-
ately after the execution of instruction, preferably in a branch from the same
execution condition.
Instruction A
The result from instruction A is
reflected in the Equals Flag.
Condition Flag,
e.g., =
Instruction B
Since the Condition Flags are shared by all of the instructions, program oper-
ation can be changed from its expected course by interruption of a single task.
Be sure to consider the effects of interrupts when writing the program. Refer
to SECTION 2 Programming of CS/CJ Series Programming Manual (W394)
for more details.
The Condition Flags are cleared when the program switches tasks, so the sta-
tus of a Condition Flag cannot be passed to another task. For example the
status of a flag in task 1 cannot be read in task 2.
Function
Instruction
Operand
LD
Instruction A
=
AND
Instruction B
Section 4-18

Advertisement

Table of Contents
loading

Table of Contents