
94
10
PC GET I, J
20
K = J AND 3
30
IF K = 1 GOTO 100
40
IF K = 2 GOTO 200
50
IF K = 3 GOTO 300
60
GOTO 10
0008
PC Program
ASCII Unit Program
Condition 1
Condition 3
Condition 2
Condition 3
0009
Remarks:
The PC GET statement reads bits 10008 to 10015 of the PC as a word. The word
is logically ANDed with 3 (00000011) and the result of this operation is used to
branch the program. When bit 10008 is turned ON, k will be equal to 1 and the
program will branch to line 100. If bit 10009 is turned ON, k will be equal to 2 and
the program will branch to line 200.
Example 3
Purpose: To control execution of the PC from the ASCII Unit using the
PC PUT statement
Remarks:
Using the PC PUT statement, the ASCII Unit can write data to bits 08 to 15 of
word n+3 of the PC. If the value of this data matches a condition set in the PC
program, a corresponding branch instruction will be executed.
PC Program
ASCII Unit Program
Execution
condition
0108
0109
0110
Processing
Processing
Processing
10
OPEN #2, “KYBD:”
20
INPUT #2, A
30
PC PUT A
1
2
3
Remarks:
In the above program, the ASCII Unit accepts external input from a keyboard
using the INPUT statement and transfers that data to the PC with the PC PUT
statement.
If the number “1” is input by the device which is connected to port #2 (A=1), bit
0108 of the PC is turned ON, allowing process 1 to be executed.
If the number “2” is input by the device which is connected to port #2 (A=2), bit
0109 of the PC is turned ON, allowing process 2 to be executed.
If the number “3” is input by the device which is connected to port #2 (A=3), bit
0110 of the PC is turned ON, allowing process 3 to be executed.
Programs in Four-word Mode
Summary of Contents for C500-ASC04
Page 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Page 5: ...iv ...
Page 7: ...vi ...