home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16519 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.1 KB  |  32 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!gumby!wupost!monsanto.com!skcla.monsanto.com!sbgros
  3. From: sbgros@skcla.monsanto.com
  4. Subject: looking at bits
  5. Message-ID: <1992Nov18.105341.1@skcla.monsanto.com>
  6. Lines: 21
  7. Sender: news@tin.monsanto.com (USENET News System)
  8. Organization: Searle, Skokie, IL
  9. Date: Wed, 18 Nov 1992 10:53:41 GMT
  10.  
  11. I'm using borland c++ to perform some communication functions.
  12. I'm only experimenting right now though.  I'm using the bioscom
  13. function to test for different conditions.  The qeustion I have is.
  14. How to I read the bits of a 16-bit integer.  The example in the
  15. book shows that 0x100 is bit 5 (I think that what its refering to),
  16. but anyway how do I figure out what the hex address is for the bits 
  17. 0-15?  
  18.  
  19.   the next part of my problem for the future is.
  20.  
  21.   the function returns this 16-bit integer what I store in a register,
  22.   for quick access, then I use an if statement to see if something
  23.   is true  if (status & 0x100)  how do these compare to give me a true 
  24.   or false.  I've looked in the book but very vaige (sp) .
  25.  
  26. any and all help would be super !!
  27.  
  28. thanks
  29.  
  30. scott
  31.  
  32.