Assembly Language Example - Omron SYSMAC C200H-ASC02 Operation Manual

Ascii unit
Hide thumbs Also See for SYSMAC C200H-ASC02:
Table of Contents

Advertisement

Assembly Language Example

Example 6
PC Program
10308
04000
04001
04001
04002
10008
1, 2, 3... 1.
6-3
Assembly Language Example
102
4.
ASCII: Exits the interrupt service routine and waits for the next interrupt.
Purpose:
To process data using the PC
Remarks:
In this example, data is entered through the ASCII Unit keyboard and trans-
ferred to the PC. The PC performs some computations on the data and then
sends it back to the ASCII Unit.
DIFU 04000
04002
04001
Data Processing
04002
13000
10008
Execution Sequence:
ASCII: The PC is initialized with the PC PUT 0 statement. Data is en-
tered via the keyboard and read with the INPUT statement. The data is
then written to the PC with the PC WRITE "@..." statement. PC process-
ing is then initiated with the PC PUT 1 statement.
2.
PC: When data processing is complete, the self-holding circuit (10008)
is set requesting the ASCII Unit to read the processed data.
3.
ASCII: Polls PC bit 10008, waiting for it to be set (it is set when data pro-
cessing is complete) and then reads the data with the PC READ "@..."
statement. The data is then displayed.
This section presents an assembly language program that is called from a
BASIC program running on the ASCII Unit.
BASIC Program:
100
DEF USR0=&H2000
110
INPUT A$
120
A$=USR0(A$)
ASCII Unit Program
100
PC PUT 0
110
INPUT A,B,C
1
120
PC WRITE "AD,100,3,3I4"; A1,A2,A3
130
PC PUT 1
I40
PC GET I,J
150
K=J AND 1
2
160
IF K<>1 THEN I40
3
170
PC READ ":D,200,4,4I4"; B1,B2,B3,B4
180
PRINT B1,B2,B3,B4
190
GOTO 100
Section 6-3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents