Omron C60K Video Game Controller User Manual


 
29
The program is input into addresses in Program Memory. Addresses in Pro-
gram Memory are slightly different to those in other memory areas because
each address does not necessarily hold the same amount of data. Rather,
each address holds one instruction and all of the definers and operands (de-
scribed in more detail later) required for that instruction. Because some in-
structions require no operands, while others require up to three operands,
Program Memory addresses can be from one to four words long.
Program Memory addresses start at 0000 and run until the capacity of Pro-
gram Memory has been exhausted. The first word at each address defines
the instruction. Any definers used by the instruction are also contained in the
first word. Also, if an instruction requires only a single bit operand (with no
definer), the bit operand is also programmed on the same line as the instruc-
tion. The rest of the words required by an instruction contain the operands
that specify what data is to be used. When converting to mnemonic code, all
but ladder diagram instructions are written in the same form, one word to a
line, just as they appear in the ladder diagram symbols. An example of mne-
monic code is shown below. The instructions used in it are described later in
the manual.
Address Instruction Operands
0000 LD HR 001
0001 AND 0001
0002 OR 0002
0003 LD NOT 0200
0004 AND 0201
0005 AND LD 0102
0006 MOV(21)
00
DM 00
0007 CMP(20)
DM 00
HR 0
0008 LD 0205
0009 OUT 0101
0010 MOV(21)
DM 00
DM 05
0011 DIFU(13) 0002
0012 AND 0005
0013 OUT 0103
The address and instruction columns of the mnemonic code table are filled in
for the instruction word only. For all other lines, the left two columns are left
blank. If the instruction requires no definer or bit operand, the operand col-
umn is left blank for first line. It is a good idea to cross through any blank
data column spaces (for all instruction words that do not require data) so that
the data column can be quickly cycled to see if any addresses have been left
out.
When programming, addresses are automatically displayed and do not have
to be input unless for some reason a different location is desired for the in-
struction. When converting to mnemonic code, it is best to start at Program
Memory address 0000 unless there is a specific reason for starting else-
where.
Program Memory Structure
The Ladder Diagram Section 4-3