I tried but I actually didn't really understand how BTFSC and BTFSS instructions work. The manual syntax and description are:
BTFSC f,b
If bit ’b’ in register ’f’ is ’1’, the next instruction is executed. If bit ’b’ in register ’f’ is ’0’, the next instruction is discarded, and a NOP is executed instead, making this a 2TCY instruction.
If bit 'b' in register 'f' is '0', the next instruction is executed. If bit 'b' is '1', then the next instruction is discarded and a NOP is executed instead, making this a 2TCY instruction
What I didn't understand is what the heck should the b value do. As from the name (Bit Test File Skip Clear/Set) the instruction should check if the specified file f is set or clear and if it's set (BTFSS) or clear (BTFSC) skip next instruction.
So, what does this b bit do exactly?
Oh.. yup, it does make sense now.
What if I wanted to test the whole file, should I go through all the bits of it or is there any other faster way that does that in one move?
Well, in that case (if you want to test the whole byte) it would be better to subtract a certain number (in binary form, of course) from the byte you want to test.
If the result is zero (chech the STATUS,Z control bit) than the byte you are testing is equal to the one that is used as a subtractor.
Oh, right! I remember now that I've also seen some code somewhere on the forum, that moved the file on itself whilst triggering Z when 0, I've got to look for that.
Thanks!