Omron C20K Video Game Controller User Manual


 
61
4-8 Work Bits (Internal Relays)
In programming, combining conditions to directly produce execution condi-
tions is often extremely difficult. These difficulties are easily overcome, how-
ever, by using certain bits to trigger other instructions indirectly. Such pro-
gramming is achieved by using work bits. Sometimes entire words are re-
quired for these purposes. These words are referred to as work words.
Work bits are not transferred to or from the PC. They are bits selected by the
programmer to facilitate programming as described above. I/O bits and other
dedicated bits cannot be used as works bits. All bits in the IR area that are
not allocated as I/O bits, and certain unused bits in the AR area, are avail-
able for use as work bits. Be careful to keep an accurate record of how and
where you use work bits. This helps in program planning and writing, and
also aids in debugging operations.
Work Bit Applications Examples given later in this subsection show two of the most common ways
to employ work bits. These should act as a guide to the almost limitless num-
ber of ways in which the work bits can be used. Whenever difficulties arise in
programming a control action, consideration should be given to work bits and
how they might be used to simplify programming.
Work bits are often used with the OUTPUT, OUTPUT NOT, DIFFERENTIATE
UP, DIFFERENTIATE DOWN, and KEEP instructions. The work bit is used
first as the operand for one of these instructions so that later it can be used
as a condition that will determine how other instructions will be executed.
Work bits can also be used with other instructions, e.g., with the SHIFT REG-
ISTER instruction (SFT(10)). An example of the use of work words and bits
with the SHIFT REGISTER instruction is provided in
5-12-1 SHIFT REGIS-
TER - SFT(10)
.
Although they are not always specifically referred to as work bits, many of the
bits used in the examples in
Section 5 Instruction Set
use work bits. Under-
standing the use of these bits is essential to effective programming.
Work Bits (Internal Relays) Section 4-8