> ... This all works just fine, but now and then I wish the architecture would > allow the bit-ordinal value to be expressed in 'W', (i.e. as a "computed" > value, rather than a compiled constant in the code), so I could do something > like: > > btfsc FLAGS, W ; (NOT a valid instruction :^( > ... > This one is a perennial question. Check the archives: Basic technique: ; turn on a bit call get_bitmask iorwf FLAGS,F ; toggle a bit call get_bitmask xorwf FLAGS,F ; turn off a bit call get_bitmask xorlw 0xFF andwf FLAGS,F ; sub to get the mask ... make sure PCLATH is right, look out for page crossing ... get_bitmask: addwf pcl,f retlw 1 retlw 2 retlw 4 retlw 8 retlw 16 retlw 32 retlw 64 retlw 128 Bob Ammerman RAm Systems -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.