🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.asm
Article #181

Re: How do i open a COM port from a dos C-program

#181
From: Mark Nelson
Date: Thu, 29 Feb 1996 01:01
34 lines
1770 bytes
Lars Oehlenschlaeger wrote:
> 
> In microsoft basic, it is possible to open a COM port with a lot of options
> (baudrate, parity, databits, stopbits and the options RS,CS,DS and CD).
> 
> Is it possible to open a COM port with the last four options (RS,CS,DS and CD)
> from a DOS C or assembler program - and how ???
> 
> Thanks in advance.
> 
> Lars

Hi Lars,

Microsoft was nice enough to include a COM port driver in their BASIC 
interpreter.  Unfortunately, they did not think to include one in either
their C compiler or MS-DOS itself.  This means that C programmers have
only a few options. 

The first option is to use the BIOS.  This is okay for output only apps,
but forget trying to keep up with input with only polling on your side.

Shareware, freeware, or commercial libraries.

Or.. write to a Windows target. Windows supplies a COM port API that works
pretty well.

My Web page has an article I wrote on incorporating RS-232 interrupt handlers 
into your C application.  I also have pointers to my book on serial port 
programming under MS-DOS and Windows.  Check those out for either free or
low-cost solutions.

Mark Nelson
http://web2.airmail.net/markn
Technical Details
Message-ID: <3134FAFF.694D@airmail.net>
Path: arc1-ca.pugleaf.net!news.iadfw.net!usenet
References: <N.022896.231415.00@ip71.image.dk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.iadfw.net!usenet
From: Mark Nelson <markn@airmail.net>
Newsgroups: alt.lang.asm,comp.lang.c
Subject: Re: How do i open a COM port from a dos C-program
Date: Wed, 28 Feb 1996 19:01:51 -0600
Organization: customer of Internet America
Message-ID: <3134FAFF.694D@airmail.net>
References: <N.022896.231415.00@ip71.image.dk>
NNTP-Posting-Host: dal03-21.ppp.iadfw.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
To: Lars Oehlenschlaeger <lars_oeh@image.dk>