Appendix
COM-2(PC)F 51
Sample Program 7
This GW-BASIC sample program demonstrates the
receive/transmit-data capability of COM-2(PC)F in Enhanced mode
with interrupt input. It calls a machine language program to
register and handle interrupt input. One channel's receive/transit-
data routine is processed in the interrupt handler. The received
data is stored in the data buffer. Data to be transmitted is read
from the data buffer.
None Key
In Key
No
Line Status
D5 bit = 1
Yes
1
Data Transmission
A$=INKEY$
No
Line Status
D0 bit = 1
Yes
Receive Data
START
Register
Machine Language Area
1
1
Set Segment
Load Interrupt
Handling Program
Set Baud Rate
Generator
Set
Interrupt Enable Register
Set Transmission Format
(Line Control Register)
Set Modem Control
Output
Read
Line Status Register
Read
Received Data Register
Read
Interrupt ID Register
Read
Modem Status Register
Interrupt Control Port
D7 bit ON
Wait Time
(After Initialization)
1
Note:
Wait Time =
(sec)
Data Length
Baud Rate
Figure 6.9. Flowchart of Sample Program 7