Hi Jay, You can't set bit position using register (or even W). It must be a literal. bcf PORTB, 0 is ok, but bcf PORTB, test is not since test is a register. If it did anything, it would operate on address of test and not test content. I'm guessing the address of test is greater than 7, so the compiler is giving you a warning. Also, don't use bit operations on PORT. Instead of bcf, you might do movf PORTB, W movwf tempB bcf tempB, 0 ;must use literal as bit position movf tempB, W movwf PORTB Jay Couture wrote: > > Hello, 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. > > Here is the code: > Let's say test = 1 for argument's sake (I've tested this and it does) > movwf test ;save request > movlw .1 ;need to subtract 1 so range is from 0 to 7 > subwf test, W ;w = test - 1 > movwf test ;test = test - 1 test = 0 > 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? > > Thanks, Jay