Omron C28K Video Game Controller User Manual


 
76
Any output bit can be used in only one instruction that controls its status. See
3-3 Internal Relay (IR) Area
for details.
DIFU(13) and DIFD(14) are used to turn the designated bit ON for one cycle
only.
Whenever executed, DIFU(13) compares its current execution with the previ-
ous execution condition. If the previous execution condition was OFF and
and current one is ON, DIFU(13) will turn ON the designated bit. If the previ-
ous execution condition was ON and the current execution condition is either
ON or OFF, DIFU(13) will turn the designated bit OFF or do nothing (i.e., if
the designated bit is already OFF). The designated bit will thus never be ON
for longer than one cycle assuming it is executed each cycle (see Precau-
tions, below).
Whenever executed, DIFD(14) compares its current execution with the previ-
ous execution condition. If the previous execution condition was ON and the
current one is OFF, DIFD(14) will turn ON the designated bit. If the previous
execution condition was OFF and the current execution condition is either
ON or OFF, DIFD(14) will turn the designated bit OFF or do nothing (i.e., if
the designated bit is already OFF). The designated bit will thus never be ON
for longer than one cycle.
These instructions are used when a single-cycle execution of a particular in-
struction is desired. Examples of these are shown below.
DIFU(13) and DIFD(14) operation can be tricky when used in programming
between IL and ILC, between JMP and JME, or in subroutines. Refer to
5-7
INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03)
and
5-8 JUMP
and JUMP END – JMP(04)/JME(05)
for details. A total of 48
DIFU(13)/DIFD(14) can be used in a program. If more than 48 are used in a
program only the first 48 will be executed and all others will be ignored.
DIFU(13)/DIFD(14) are useful when used in conjunction with CMP(20) or
MOV(21), see
Example
below.
There are no flags affected by these instructions.
In diagram A, below, CMP(20) will compare the contents of the two operand
words (HR 1 and DM 00) whenever it is executed with an ON execution con-
dition and set the arithmetic flags (GR, EQ, and LE) accordingly. If the execu-
tion condition remains ON, flag status may be changed each cycle if the con-
tents of one or both operands change. Diagram B, however, shows how
DIFU(13) can be used to ensure that CMP(20) is executed only once each
time the desired execution condition goes ON.
0000
CMP(20)
HR 1
DM 00
Diagram A
1000
CMP(20)
HR 1
DM 00
Diagram B
DIFU(13) 1000
0000
Address Instruction Operands
0000 LD 0000
0001 CMP(20)
HR 1
DM 00
Address Instruction Operands
0000 LD 0000
0001 DIFU(13) 1000
0002 LD 1000
0003 CMP(20)
HR 1
DM 00
Limitations
Description
Flags
Example
Bit Control Instructions Section 5-6