|I like it. How 'bout: | | rlf test,W | andlw 0x0e | addwf pcl,f | bcf PORTB,0 | return | bcf PORTB,1 | return | . | . | . | bcf PORTB,7 | return | |7-iso cycles. Nice. If code space is a bit tight, an alternative would be... MaskTbl: ; Put this part in low 256 bytes andlw 7 addwf PC db 1,2,4,8,16,32,64,128 RoutineThatNeedsToClearBit: ... movf BitNum,w call MaskTbl xorlw 255 andwf PORTB,f 10 cycles as written; each of the following will save a cycle: -1- If you have the table values complemented, you can eliminate the xorlw 255 instruction. The table is written as it is to allow use in bit-setting or bit-toggling applications as well as bit- clearing ones. -2- Skipping the andlw 7 at MaskTbl. Of course, you'd better make sure your bit address is 0-7 if you do that. -3- Starting with the bit number in W instead of a file register. Thus, this version--while not as fast as the other one--uses less code space. Note that the table in this version may be used by many inst- ances of the code below. If there are several places in the program where you need to selectively clear bits from different registers, that could be a major asset. Note also that this version requires one layer of stack depth; the version posted previously does not [the 'returns' could be replaced by 'goto's if desired].