Xref: news2.mv.net comp.os.msdos.djgpp:8227 From: "Mike Marcelais" Newsgroups: comp.os.msdos.djgpp Subject: Re: int86() Date: 3 Sep 1996 17:02:04 GMT Organization: Microsoft Corporation Lines: 23 Message-ID: <01bb99ba$59cb8ee0$ba27379d@michmarc2> References: <50g2vc$2ct AT parlor DOT hiwaay DOT net> NNTP-Posting-Host: 157.55.39.186 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp | I'm trying to test a single bit as per a bios interrupt. | Using the int86() function , how can I test to see if an particular | bit is set = 1 or not = 0 . | | ex. outregs.h.al | | I need to test bit 7 of this register for 1 or 0. Well, just mask it off using the `and' operator: bit = outregs.h.al & 0x80; [If you actually need the value to be 1 or 0, rather than non-0, or 0, you can shift the bit to the right spot: bit = outregs.h.al >> 7; ] -- +------------------------+----------------------+ | Mike Marcelais | Excel Developer and | | michmarc AT microsoft DOT com | Magic Rules Guru | +------------------------+----------------------+ | Opinions expressed in this post are mine, and | | do not necessarily reflect those of Microsoft | +--= Moonstone Dragon =---------------= UDIC =--+