Somasundaram wrote: > Sorry, I didn't put it clear. *I* knew what you were getting at! > Say value 5 is stored in the file register 0x27 > I would like to test the bit of . This is a FAQ. The PIC does not provide for this (and I don't recall any other processor doing so either). If that's *all* you need and you want to do it fast (bad luck - it isn't!), then the suggested method is to use a table either of the masks (DB 1,2,4,8,16,32,64,128) which you access via a ADDWF,PCL call as a subroutine, or you use an "action table" accessed in the same fashion, but with the index multiplied by two or four and separate test procedures in each entry. Use macros! > Something like: I would like to count the number of 1's in the value > (at 0x26) using btfss instruction. Ah! That's a separate FAQ. I was thinking of the parity calculation that usually goes like: SWAPF value,W XORWF value,W MOVWF temp RRF temp,W RRF temp,W XORWF temp,F RRF temp,W XORWF temp,F and now you test bit 0 of temp for the parity. If however you want the overall sum of the bits, that is slightly different. I'm sure there is a *terribly* clever way to do that too, but I think I better go to bed now before I send any more private messages such as the one I thought I sent to Russell McMahon, to the list! -- Cheers, Paul B.