Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rlgvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!sdcsvax!dcdwest!ittvax!decvax!genrad!panda!talcott!harvard!seismo!trwatf!rlgvax!geller From: geller@rlgvax.UUCP (David Geller) Newsgroups: net.micro.pc Subject: Re: Pascal and C access to com ports Message-ID: <591@rlgvax.UUCP> Date: Mon, 25-Mar-85 13:29:03 EST Article-I.D.: rlgvax.591 Posted: Mon Mar 25 13:29:03 1985 Date-Received: Thu, 28-Mar-85 06:32:02 EST References: <1383@sunybcs.UUCP> Distribution: net Organization: CCI Office Systems Group, Reston, VA Lines: 24 > I have decided to write it in either Turbo Pascal, or Lattice C. My main > problem right now is sending and receiving data from the com1: port. I > have only played around with it in Turbo Pascal, and can send data ok (I > think) to the port, but how can I tell if there is data 'waiting' in the > port to print? > I cant do a read from the port to check; otherwise it will just sit there > and wait for data to come in. What I would like to know is how to do > some sort of a status on the port. Can anyone help me? You should refer to the IBM PC Technical reference manual. It will describe the status ports for the asychronous communications adaptor. By "polling" the status port you can tell if there is something available in the single-character input buffer. If you would like to avoid a great deal of work you might consider using The GreenLeaf Comm Library (see current magazine for more complete description). This library provide the C program with all of the necessary hooks and functions for both "polled" and interupt driven serial I/O. Do check the Tech Ref however. David Geller rlgvax!geller "If I mentioned a company or product name I did so without any intention of implying I was connected to or affiliated with the said company or product"