On Thu, May 01, 2014 at 03:52:14PM -0400, Larry Bradley wrote: > Can anyone point me to some examples of in-line assembly code for the > XC16 compiler (I'm using a PIC24H ...). The Microchip docs don't tell me > much, and I've Googled until my fingers are sore! >=20 > What I'm trying to do is make up for the fact the C doesn't give you > access to the bits of a byte. To determine if a bit is set, one has to > use a mask, as in=20 >=20 > if (mybyte & 0b00100000) { } >=20 > This generates a lot messier code than if one could just test a bit > directly using BTST, for example. What you are looking for are bit-fields. They are described in section 8.6.2 on page 119 of the XC16 manual. Your code above would be something like: if (mybyte.redflag) { } where you'd define mybyte as a struct with bit-fields. BAJ >=20 > --=20 > Larry Bradley =20 > Orleans (Ottawa) Canada=20 >=20 > --=20 > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 Byron A. Jeff Chair: Department of Computer Science and Information Technology College of Information and Mathematical Sciences Clayton State University http://faculty.clayton.edu/bjeff --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .