77
Whenever executed, DIFD(11) compares its current execution with the pre-
vious execution condition. If the previous execution condition is ON and the
current one is OFF, DIFD(11) will turn ON the designated bit. If the previous
execution condition was OFF and the current execution condition is either
ON or OFF, DIFD(11) will either turn the designated bit OFF or leave it OFF.
The designated bit will thus never be ON for longer than one scan, assuming
it is executed each scan (see Precautions, below).
There are no flags affected by these instructions.
DIFU(10) and DIFD(11) operation can be uncertain when the instructions are
programmed between IL and ILC. Refer to 3-7-10 INTERLOCK and INTER-
LOCK CLEAR - IL(02) and ILC(03) for details.
In diagram A, below, whenever CMP(32) is executed with an ON execution
condition it will compare the contents of the two operand words (DR 10 and
DR 00) and set the arithmetic flags (GR, EQ, and LE) accordingly. If the ex-
ecution condition remains ON, flag status may be changed each scan if the
content of one or both operands change. Diagram B, however, is an example
of how DIFU(10) can be used to ensure that CMP(32) is executed only once
each time the desired execution condition goes ON.
0000
CMP(32)
DR 10
DR 00
Diagram A
0215
CMP(32)
DR 10
DR 00
Diagram B
DIFU(10) 0215
0000
Address Instruction Operands
000 LD 0000
001 CMP(32)
DR 10
DR 00
Address Instruction Operands
000 LD 0000
001 DIFU(10) 0215
002 LD 0215
003 CMP(32)
DR 10
DR 00
The following diagram would be very complicated to draw without using
DIFU(10) because only one of the conditions determining the execution con-
dition for MOV(30) requires differentiated treatment.
0215
MOV(30)
DR 10
DR 00
DIFU(10) 0215
0000
0001 0002 0003
0004 0005
Address Instruction Operands
000 LD 0000
001 DIFU(10) 0215
002 LD 0215
003 LD 0001
004 AND NOT 0002
005 AND NOT 0003
006 OR LD ---
007 LD 0004
008 AND NOT 0005
009 OR LD ---
010 MOV(30)
DR 10
DR 00
Flags
Precautions
Example 1: One-time
Execution of Other
Instructions
Example 2: Use to Simplify
Programming
Instruction Set Section 3-7