Its not a stupid question, its just an FAQ (Frequently Asked Question)... ...and that being the case, it is answered in the FAQ at http://www.piclist.com/faq specifically at http://www.piclist.com/techref/microchip/math/bit/setbit.htm which is the second item that appears if you type "set bit" into the search field at the FAQ site or the archive site or right at piclist.com which is referenced in the welcome email you got when you subscribed as being the place to go look for things before you post a question to the list. If that seemed harsh in any way it is not meant to be... ...I'm just proud of the site and it's ability to help answer questions. P.S. its [pic]: rather than [pic] in the subject line which is also in the welcome email, list FAQ, etc. James Newton, PICList Admin #3 mailto:jamesnewton@piclist.com 1-619-652-0593 phone http://www.piclist.com ----- Original Message ----- From: Robert Shady To: Sent: Saturday, February 10, 2001 08:22 Subject: [PICLIST] [PIC] Easy way to convert # to bit position? I'm pretty sure this is a stupid question, but is there an easy way to convert a number into it's appropriate bit position? For example, say I have 3 stored in the variable BLAH. How can I turn on bit #3 on PORTB? 4=4, 5=5, etc... I've tried bsf PORTB,BLAH and that obviously isn't correct.. (It appears to set PORTB = address of BLAH.. -- Rob __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu