cncst@unix.cis.pitt.edu (Christophe N. Christoff) (09/05/90)
Since I post the question of emptying COM1 port, I got
several replies. And the following are the very helpful
summary from two people:
1. From Lance Bresee (lance%helios.UCSC.EDY@ucscc.ucsc.edu)
For COM1, to empty it, two lines code will do it
PORT[$3FC] := PORT[$3FC] or $3
Byte_to_get := PORT[$3FB]
I tried above method before, but I didn't add the first line,
so the program would not work since modem still held the character
until something like the first line is given.
2. From Marko Jauhiainen (mark@vehka.cs.uta.fi)
He mailed me the programs he used, I tested it, it works fine.
The primary difference between the program he uses and the one
I downloaded from SIMTEL is that his program does not set the
head pointer and the tail pointer at the same place once
the port is initialized, but the program COMM_TP4 I downloaded did.
I also noticed that his program does not show me some characters
(initialization characters an external machine sends once turned on)
right away until a key is pressed. A little strange to me since
inside his program, once a character is ready, the character would
be printed immediately.
I used some other programs, I can get these characters right away,
but I have to press a key to get these characters when I run his program.
For those who write program based on COMM_TP4, the first method
is very useful in case there is something in COM port once the PC
is turned on. For those who start to write the communication program,
you can use the second program (I guess you can request from Marko to
get a copy) to avoid the similar problem.
Thanks a lot for those replied.