
Originally Posted by
breeno
I know the problem is that the "bsf _CODE,_i" and "bcf _CODE, _i" are wrong
I have no idea why anyone would want to do what you are doing. Further, I have not tested your ASM code. See my additions to your ASM code to address the bsf and bcf issues you noted above. Someone else might have a more elegant way to solve this??
Code:
BitUpdate = $80 ;b10000000 (Added line and variable)
for i=0 to 7
ASM
movlw 0 ;
movwf _x ;x=0
movlw 10
movwf _y ;y=10
rlf _BitUpdate, W ;(Added line)
rlf _BitUpdate, F ;(Added line)
TEST
btfss PORTB, 4
goto ZERO
goto UNO
ZERO
;bcf _CODE,_i ;(commented out)
comf _BitUpdate,W ;(Added line)
andwf _CODE,F ;(Added line)
goto INC
UNO
;bsf _CODE,_i ;(commented out)
movf _BitUpdate,W ;(Added line)
iorwf _CODE,F ;(Added line)
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
Good Luck,
Paul Borgmeier
Salt Lake City, Utah
USA
Bookmarks