> Van: Jay Couture > Aan: PICLIST@MITVMA.MIT.EDU > Onderwerp: Using a variable to clear a bit > Datum: zondag 9 mei 1999 5:24 > > Hello, Hello Jay, > I am trying to use a file register as a mask to clear a bit on > PORTB. I do get a warning when I compile: > > Warning[202] E:\PIC\CODE\test.ASM 113 : Argument out of range. Least > significant bits used. > bcf PORTB, test ;clear PORTB.0 > It doesn't matter what bit I want to clear, bit five is the only one that > is ever cleared regardless of the value of test. I should point out that > test is in files register 0x015, so it makes sense why bit 5 (the lower > nybble) is the only one cleared, but why is it using it's address and not > it's value? You where on the right way finding the source of your troubles ! 1) There is no command (AFAIK) that accepts _two_ File-Registers as arguments. 2) The second argument of the B?F command is a _constant_ , ranging from 0 to 7 The warning that you are getting is that the _value_ "test" (aka 0x15) is too large. So, only the relevant bits ( bits 0, 1 & 2) are used. Resulting in the ,observed by you, number 0x5. Greetz, Rudy Wieser