piclist 2001\01\04\153438a >
Thread: Not use the address but what is inside that address
www.piclist.com/techref/microchip/devices.htm?key=pic
face picon face BY : Olin Lathrop email (remove spam text)



>     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, spam_OUTolin@spam@spamembedinc.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.


<000b01c07684$f99efa00$260bf6cd@pc> 7bit

See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Not use the address but what is inside that address

month overview.

new search...