Well I4ve found FSR and INDF, but that can solve half my problem... with this I can select porta, portb or portc easily, but what about bits, how can I choose between them? Petra: I should use any port, and any bit... my idea is to make a subrutine to read a bit using sofware filter... Regards, Gonzalo ----- Mensaje original ----- De: "Olin Lathrop" Para: Enviado: Jueves 4 de Enero de 2001 2:31 PM Asunto: Re: [PIC]: Not use the address but what is inside that address | > 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? | | If "bit" and "port" are assembler variables, then yes. No matter how you | may try to disguise it, the register and bit referenced by a BTFSS | instruction are hard coded into the instruction, and therefore must be known | at assembly time. | | If you need to dynamically select a register at runtime, use an FSR. There | are more options for dynamically selecting a bit, most of which require bit | shifting or mask selecting. | | | ***************************************************************** | Olin Lathrop, embedded systems consultant in Devens Massachusetts | (978) 772-3129, olin@embedinc.com, http://www.embedinc.com | | -- | http://www.piclist.com hint: The PICList is archived three different | ways. See http://www.piclist.com/#archives for details. | | | -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.