80
6-2
Programs in Two-word Mode
The following programs are executed with the ASCII Unit set in two-word mode.
For all of the following examples:
•
printer is connected to port 2
•
8 bits/ no parity/ 2 stop bits
Example 1
Purpose:
To write data from the PC using WRIT(87/191) and to the
ASCII Unit using the PC READ statement.
Equals Flag
To next process
Number of words to be transferred
First word to transfer (DM 000)
Destination word address
PC Program
ASCII Unit Program
WRIT(87/191)
#0005
DM000
00
PC READ “5I4” ;A, B, C, D, E
Execution condition
#0005:
DM000:
00:
Remarks:
When the execution condition goes ON, WRIT(87/191) is executed. The ASCII
Unit reads five words of data starting at DM 000, converts them into BCD, and
assigns them to the variables A through E. When execution of WRIT(87/191) is
completed, the Equals Flag is turned ON.
Example 2
Purpose:
To write data from the ASCII Unit using the PC WRITE
statement to the PC using the READ(88/190) instruction.
Equals Flag
To next process
Number of words to be transferred
First word to transfer
Destination word address
PC Program
ASCII Unit Program
READ(88/190)
#0003
01
DM010
PC WRITE “3I4”;P,Q,R
#0003:
01:
DM010:
Remarks:
When the ASCII Unit executes the PC WRITE statement, the variables P, Q, and
R are converted into BCD and stored in DM 010, 011, and 012.
Programs in Two-word Mode
Section 6-2
Содержание C500-ASC04
Страница 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Страница 5: ...iv ...
Страница 7: ...vi ...