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 Hi Jay. In bcf PORT,test construction test can only be literal in range from 0 to 7 i.e. you tell to compiler with one bit exactly you need to clear. If you need to clear differences bits every time you should apply another idea. 1. Load W register with value with zeroes bits in required positions. For instance you need to suppress bit 0 and 2. Load 0xFA (11111010b) There was some discussion sometime ago related to this topic, try to search through PICLIST archive. 2. ANDWF PORTB,F and that's it! (Sometimes it's better to make operations under shadow copy of port in memory and after that copy result to port) WBR Dmitry.