Hello guys...i am a novice in picbasic
Just a little question...
For increasing speed i want to write a simple cyle in ASM:
i want to read a pin (example PORTB.4) for x times and put the read state in the bits of a variabile (example CODE).
This is the PICbasic code:

for i=0 to 7
x=0
while x<10
if in then
CODE.0[i]=1
else
code.0[i]=0
endif
x=x+1
wend
next i

This is the ASM idea:

for i=0 to 7
ASM
movlw 0 ;
movwf _x ;x=0
movlw 10
movwf _y ;y=10
TEST
btfss PORTB, 4
goto ZERO
goto UNO
ZERO
bcf _CODE,_i
goto INC
UNO
bsf _CODE,_i
INC
incf _x,1 ;x=x+1
movf _x,W ;x->w
sublw 10 ;w=10-w
subwf _y,1 ;y=y-w
decfsz _y,0 ;w=y-1
goto TEST
endasm
next i

I know the problem is that the "bsf _CODE,_i" and "bcf _CODE, _i" are wrong (8 bit _i variabile respect of 3 bit code).

The question is: how can i increment the value of the CODE bit with a variabile?

thank you for help!!!