hi,i'm doing a project using pic(16f84) to control a dc motor. there are 3 position sensors....i have set three switch to input and my sensors should detect the position accordingly...for example if i press switch 1 it should rotate until position sensor 1 is on then it will stop the motor. the problem is i use port b to set all my inputs RB0-RB2(switch) and RB3-RB5(sensors)....how do i write the program so that when both are match,it will stop the motor....i have try to use BTFSS and ANDLW but i stuck...due to the numbers of bit involved i,m stucked... can i group a number of bits ANDLW with a group of bits??for example from port b pin 0-2 a group and again port b pin 3-5 a group i'm still a newbies in pic programming.....pls help me.....thanks