Does your count go past 30? If you just need to detect when the count is 30, then it is better to XOR your counter with 30 and check if the result is zero: (assuming you are using a regular PIC device) movlw 30 xorwf counter,w btfsc STATUS,Z goto do_something The test you suggested will do the something for counter values of 30 and 31 (0x1e and 0x1f), because you are ignoring bit zero. If your counter goes past 30, your test will succeed again for values of 62 and 63 (0x3e and 0x3f), and also for 0x5e, 0x5f, 0x7e, 0x7f, 0x9e, 0x9f, 0xbe, 0xbf, 0xde, 0xdf, 0xfe, 0xff. Isaac Em 10/02/2013 17:34, mircea2012 escreveu: > Hy.=20 > For example if I have a variable count =3D 30.=20 > In binary sistem 30 =3D 11110.=20 > I must do something like that :=20 > if bit 4 is logic one=20 > AND=20 > bit 3 is logic one=20 > AND=20 > bit 2 is logic one=20 > AND=20 > bit 1 is logic one=20 > DO SOMETHING.=20 > Thank you. > > > > -- > View this message in context: http://microcontrollers.2385.n7.nabble.com/= PIC-How-to-ANDed-bitwise-in-assembler-tp180767.html > Sent from the MicroControllers - PIC mailing list archive at Nabble.com. --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .