569
Appendix B
Error and Arithmetic Flag Operation
The following table shows the instructions that affect the ER, CY, GR, LE, EQ, OF, UF, and N flags. In general,
ER indicates that operand data is not within requirements. CY indicates arithmetic or data shift results. GR
indicates that a compared value is larger than some standard, LE that it is smaller, EQ that it is the same. EQ
also indicates a result of zero for arithmetic operations. N generally indicates that bit 15 of the result word is
ON. OF indicates that the results was greater than could be stored in memory; UF indicates that the results
was less than could be stored in memory. Refer to subsections of
Section 5 Instruction Set
for details.
A set value (SV) BCD check is carried out at the time of resetting (TIM, CNT, TIMH(015), TIML(121),
TCNT(123), TIMW<013>, CNTW<014>, and TMHW<015>), or counting (CNTR(012), TTIM(120), and
MTIM(122)).
When CCL(172) is executed, the status of these flags will return to the status when CCS(173) was last
executed. CCL(172), STC(078), and CLC(079) are the only instructions that can directly change the status of
the arithmetic flags.
“ON/OFF” in the table indicate the flags that are turned ON and OFF according to the result of the instruction.
Although ladder diagram instructions, TIM, CNT, TIMH(015), CNTR(012), TIML(121), TIMW<013>,
CNTW<014>, and TMHW <015> are executed when ER is ON, other instructions with “ON/OFF” under the
Error Flag (A50003) column are not executed if ER is ON. All of the other flags in the following table will also
not operate when ER is ON.
Instructions not shown do not affect any of the flags in the table. Although only the non-differentiated form of
each instruction is shown, all variations of an instructions affect flags in exactly the same way.
Instructions marked with an asterisk (*) are supported by version-2 CVM1 CPUs only.
The status of the ER, CY, GT, LT and EQ Flags is affected by instruction execution and will change each time an
instruction that affects them is executed. Differentiated instructions are executed only once when their execution
condition changes (ON to OFF or OFF to ON) and are not executed again until the next specified change in their
execution condition. The status of the ER, CY, GT, LT and EQ Flags is thus affected by a differentiated instruction
only when the execution condition changes and is not affected during scans when the instruction is not executed,
i.e., when the specified change does not occur in the execution condition. When a differentiated instruction is not
executed, the status of the ER, CY, GT, LT and EQ Flags will not change and will maintain the status produced by
the last instruction that was executed.
Instructions A50003
(ER)
A50004
(CY)
A50005
(GR)
A50006
(EQ)
A50007
(LE)
A50008
(N)
A50009
(OF)
A50010
(UF)
TIM
ON/OFF
CNT
JMP(004)
ON/OFF
FAL(006)
FALS(007)
CNTR(012)
TIMH(015)
CMP(020)
ON/OFF ON/OFF ON/OFF ON/OFF
CMPL(021)
BCMP(022)
ON/OFF ON/OFF
TCMP(023)
MCMP(024)
EQU(025) ON/OFF
CPS(026)*
ON/OFF ON/OFF ON/OFF ON/OFF
CPSL(027)*
CMP(028)*
CMPL(029)*
Note “ON/OFF” means that the flag is affected by the result of instruction execution.