No you can't do that. The bit number is actually part of the [BSF, BCF etc.] instruction an= d is created at compile time. Clayton Mellina wrote: >=20 > Yes it is possible. Use the "equ" directive like this: >=20 > DSBIT equ "bit number goes here" >=20 > There are many other directives that you can use with MPASM and it = can get > complicated. > For more information download the MPASM User's Guide from the Micro= chip > website. > Good luck! >=20 > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Dave Gomez > Sent: Sunday, September 08, 2002 7:45 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: Variables >=20 > Hi, > it=B9s the newbie again, I got a potentially silly question, bu= t here > goes. >=20 > I have a working program to read a temperature sensor, but I wo= uld like > to add more. The issue is, I was thinking to save coding, and redu= ndancy by > using a variable to describe what portb bit I=B9m working with, so = I could > reuse the subroutines but setting a variable to the current bit to = work > with. An example of this would be to make something like DSBIT a v= ariable, > and then swap the value of the bit to work with. Is this possible? >=20 > BSF TRISB,DSBIT ;make RAx an input > ;where DSBIT can be variab= le >=20 > Thanks, > Dave Gomez >=20 > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu >=20 > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu --=20 Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu