Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 364

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Increment/Decrement Instructions
Description
Flags
Precautions
Examples
0.01
Area
Index Registers
Indirect addressing
using Index Registers
The ++BL(595) instruction adds 1 to the 8-digit BCD content of Wd+1 and
Wd. The content of the specified words will be incremented by 1 every cycle
as long as the execution condition of ++BL(595) is ON. When the up-differen-
tiated variation of this instruction (@++BL(595)) is used, the content of the
specified words is incremented only when the execution condition has gone
from OFF to ON.
Wd+1
Wd
The Equals Flag will be turned ON if the result is 0000 0000 and the Carry
Flag will be turned ON when a digit changes from 9 to 0.
Both the Equals Flag and the Carry Flag will be turned ON when the content
of changes from 9999 9999 to 0000 0000.
Name
Label
Error Flag
ER
Equals Flag
=
Carry Flag
CY
The content of Wd+1 and Wd must be BCD. If it is not BCD, an error will occur
and the Error Flag will be turned ON.
Operation of ++BL(595)
In the following example, the 8-digit BCD content of D201 and D200 will be
incremented by 1 every cycle as long as CIO 0.01 is ON.
D200
Wd+1:
D201
CIO 0.01
---
,IR0 to ,IR15
–2048 to +2047, IR0 to –2048 to +2047, IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
Wd+1
Wd
ON if the content of Wd+1 and Wd is not BCD.
OFF in all other cases.
ON if the result is 0000 0000 after execution.
OFF in all other cases.
ON if a digit in Wd+1 or Wd went from 9 to 0 during exe-
cution.
OFF in all other cases.
Incremented every cycle
while CIO 0.01 is ON.
Wd:
D200
Wd+1:
: Execution of ++BL(595)
Increment Increment
Increment Increment
Section 3-9
Wd
Operation
D201
Wd:
D200
331

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents