ON 20091208@9:51:35 AM at page: On a web page you were interested in at: http://techref.massmind.org/microchip/math/radix/ah2b-1d4b.htm#40154.9770486111 James Newton[JMN-EFP-786] published post 40154.9770486111 I read this last suggestion to use this instruction and ended up spending a few days trying to figure out why it is unpredictable. This does not work (at least not on a 12F629 *and* the assembler does not even generate a warning):

btfsc WREG,6 ; not all pics can do this...

That assembles to 1A00 == "btfsc 0, 6" and since W is a SFR (special function register 0) and NOT a File Register which btfsc operates on, it tests the correct bit in the wrong register. "btfsc 0,6" references INDF (File Register 0, the register pointed at by FSR), not W.

There is no place in the instruction encoding for this bit test instruction to specify the difference between WREG at 0 and INDF at 0. so that code "btfsc WREG, 6" really executes as "btfsc INDF, 6". Compact, but broken.

best regard from Barry L. Kramer in Mohnton PA
|Delete 'P-' before: '' but after: ' Perfect, thank you all!
|Delete 'P-' before: '' but after: '