On August 19 (sorry, I'm behind on PICLIST!) Yves Heilig wrote: > I'm a beginner in programming of PIC, somebody can it come to my > help? Here my problem: I want to test the contents of an indexed > table of the form flag(Y), Y being a variable > > Example: > The variable Y=2 > How to test bit 2 of flag ? A handy subroutine: ;---------- ; TWO_POWER: two raised to the power of W ;---------- two_power: addwf pcl, f retlw b'00000001' retlw b'00000010' retlw b'00000100' retlw b'00001000' retlw b'00010000' retlw b'00100000' retlw b'01000000' retlw b'10000000' So, you'd do something like: movf Y, w call two_power andwf flag, w btfss status, z goto bit_y_is_set Brian