From: "Peter Stewart" Newsgroups: comp.os.msdos.djgpp Subject: bit masking Date: Sat, 4 Mar 2000 13:01:17 -0000 Organization: RemarQ http://www.remarQ.com Lines: 31 Message-ID: <89od42$bvp$1@supernews.com> NNTP-Posting-Host: 195.72.160.126 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: 952088514 5YRYRMC7OA07EC348C uk25.supernews.com X-Complaints-To: newsabuse AT remarq DOT com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com int err; . . . data=_bios_serialcom(_COM_RECEIVE,0,0); /*read from com1*/ if(err=(data&0x1300)) { switch(err) { case 0x0100: /* bit 9 */ break; case 0x0200: /* bit 10 */ break; case 0x0300: /* bit 11 */ break; case 0x1000: /* bit 15 */ break; default: /* eek some other top bit */ break; } } else { /* data OK */ } Regards, Peter