> What I want to do exactly is to have to variables, one with the port I >want to use (let4s call it "port") and another one with the bit I want to >read (let4s call it "bit") then use the instruccion btfss. > > Something like this: > > porta --> port > 3 --> bit > > btfss port, bit > > What should mean btfss porta, 3 > > Is it possible? I don't believe you can use a file (e.g. "bit") as a variable in this instance. It would return the location of the register, not the contents. You would have to set "bit EQU 0x03" to make it work in this case. Even so, you couldn't change it by incrementing the register. You'd have to use "bit + 1" next time around and have already defined "bit + 1 EQU 0x04" or whatever bit you want to test. You'd be better off just saving the contents of the port to a temporary register and checking the bits by shifting them into carry: movf PORTB, 0 movwf port_contents movf bit_to_test, 0 ; check whatever bit # you want movwf count sublw 0x07 ; must be <= 7 btfss STATUS, C goto skip_check incf count ; bit 0 needs one rrf clrc Loop rrf port_contents decfsz count goto Loop btfss STATUS, C ; check the desired bit goto bit_was_clear goto bit_was_set skip_check .... Hope this is what you need. --Andrew _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.