Searching \ for 'Code problem..bcf,bsf,btfss...' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=code+problembcfbsfbtfss
Search entire site for: 'Code problem..bcf,bsf,btfss...'.

Truncated match.
PICList Thread
'Code problem..bcf,bsf,btfss...'
1997\04\07@040745 by joha1359

flavicon
face
Hi
I have problem bcf,bsf,btfss,btfsc. The problem is that I want to have
a variable bit position in these commands.
       ex      bsf     PORTA,num            ; num is 0,1,2
mpasm comes up with warnings that says that the value is too big and it
will use the least significant bits, but it don't work in mpsim. I use '84
                               thanks
                                              Johan

1997\04\07@043235 by Robert Lunn

flavicon
face
>I have problem bcf,bsf,btfss,btfsc. The problem is that I want to have
> a variable bit position in these commands.
>        ex      bsf     PORTA,num            ; num is 0,1,2

       You cannot have a variable bit position in these commands.  The
       bit field is a fixed value only (it is hard coded into the command
       byte).

       Presumably 'num' in the above example is the name of a variable.
       MPASM is giving you an error because the bit field can only have
       a constant value in the range 0..7, and the constant value of
       'num' is the address of the allocated data byte in memory.

___Bob

More... (looser matching)
- Last day of these posts
- In 1997 , 1998 only
- Today
- New search...