App
-
31
(c) Program after replacement
In the sequence program after replacement, three programs are required as shown below.
1) Main routine program
• Replace the PR instruction with the CALL instruction so that a subroutine program is called.
• Output string storage device ("D0" in the program below) cannot be specified directly with the CALL
instruction.
• Use the ADRSET instruction to acquire the indirect address for the CALL instruction.
• Y device ("Y100" in the program before replacement shown in (b)) cannot be specified directly as output
Y number with the CALL instruction. Specify the output Y number in integer.
• An interrupt program is used to output character codes via the output module. Enable the execution of
interrupt programs using the EI instruction.
Figure App.7 Program execution
Figure App.8 Sample program
FEN
D
R
ET
I
R
ET
EN
D
P1
I
31
<
After
trans
i
t
i
on
>
EN
D
<
Before
trans
i
t
i
on
>
O
utput
str
i
ngs
and
output
str
i
ng
storage
address
are
set
.
I
n
i
t
i
a
l
process
i
ng
T
he
str
i
ngs
stored
i
n
D0
are
output
.
M
a
i
n
rout
i
ne
program
M
a
i
n
rout
i
ne
program
Subrout
i
ne
program
II
nterrupt
program
T
he
str
i
ngs
stored
i
n
D0
and
l
ater
are
output
from
Y
100
to
Y
108
.
An
e
x
ecut
i
on
of
i
nterrupt
program
i
s
enab
l
ed
.