delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/02/15:16:26

From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: _bios_serialcom() in djgpp
Date: 2 Mar 2000 16:23:51 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 24
Message-ID: <89m4in$jf$1@antares.lu.erisoft.se>
References: <89m367$mjn$1 AT nnrp1 DOT deja DOT com>
NNTP-Posting-Host: mars.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

wsimpson AT my-deja DOT com wrote:
: char data;
: ...
: data=_bios_serialcomm(_COM_INIT,0,0); /*read from com1*/
: then data will contain the word (8 bits) I read from com1. If
: unsuccessful, bit 9, 10, 11, or 15 is set. I don't know how to check
: this. Please show me how (code fragment).

I don't know anything about _bios_serialcomm but the bit thing can be
accomplished like this (untested):

short data;
...
data=_bios_serialcomm( something here );

if( data & ( (1<<9) | (1<<10) | (1<<11) | (1<<15) ) )
{
	printf("At least one of the bits were set.\n");
}


Right,

							MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019