MessUpMymind
New Member
hi there,
Hey , i got stuck in some problem that i dont understand what is going on actually..
i got the following code:
what i got is , the first time it loop .. it work perfectly fine, but when come to second time it only keep looping on the first decfsz loop and it wont go to second decfsz in short it will only display Run2 forever and wont goes to Run3 and Run4.
Help is much appreciated =)
Hey , i got stuck in some problem that i dont understand what is going on actually..
i got the following code:
Code:
Start: movlw b'11111000'
movwf col1
MOVLW b'00100000'
MOVWF col2
MOVLW b'00100000'
MOVWF col3
movlw b'00100000'
movwf col4
movlw b'11111000'
movwf col5
GOTO Run1
Run4: bsf PORTB,1
call CLK
call DELAY
bcf PORTB,1
goto $+2
Run3: bsf PORTB,1
call CLK
call DELAY
bcf PORTB,1
goto $+2
Run2:
bsf PORTB,1
call CLK
call DELAY
bcf PORTB,1
goto $+8
Run1: bsf PORTB,1
movlw d'2'
movwf shift1
movlw d'2'
movwf shift2
movlw d'2'
movwf shift3
movf col1,w
movwf PORTD
CALL CLK ; call clock to move the data to collumns
call DELAY
bcf PORTB,1
movf col2,w
movwf PORTD
CALL CLK
call DELAY
movf col3,w
movwf PORTD
call CLK
call DELAY
movf col4,w
movwf PORTD
call CLK
call DELAY
movf col5,w
movwf PORTD
call CLK
call DELAY
bcf PORTB,2
bsf PORTB,2
clrf PORTD
call DELAYLONG
[COLOR="Red"]decfsz shift1,f
GOTO Run2 ;can
decfsz shift2,f
GOTO Run3
decfsz shift3,f
GOTO Run4
GOTO Run1[/COLOR]
what i got is , the first time it loop .. it work perfectly fine, but when come to second time it only keep looping on the first decfsz loop and it wont go to second decfsz in short it will only display Run2 forever and wont goes to Run3 and Run4.
Help is much appreciated =)