Michael, Let me try to explain what is going wrong by rewriting the comments in your code. I have not changed or removed any commands, just the comments. pascnt1 movlw 0x05 movwf C1 ;counter contains value 5 setbitaf clrf PORTB ;portb leds all off bsf PORTA,0 ;first led of porta is lit pointaf decf C1,f ;decrease counter by one call delay ;wait a bit bcf STATUS,C rlf PORTA,same ;change to the next led in porta btfsc PORTA,3 ;if the fourth led is lit goto pascnt2 ;time to switch ports ;but hang on we only just lit the ;fourth led. Don't we need to wait ;a bit? movf C1,f ;when PORTA,3 is lit, C1=2 so Z will ;never be set by this command btfss STATUS,Z ;Z is never set so we always execute ;the next instruction goto pointaf ;keep processing porta pascnt2 movlw 0x09 ;switching to portb so movwf C1 ;load counter with 9 setbitbf clrf PORTA ;turn all porta off ;remember this is only 5 instructions ;since we turned it on!! bsf PORTB,0 ;turn on portb's first led ..........etc Do you see how your delays are misplaced? A simple fix would be to insert another "call delay" immediately after pascnt2. You'll need to modify your reverse routines in a similar way. Also, to tidy up your code, ask yourself these questions; What does the counter do? What does checking PORTA,3 do? If the answers to these are the same then you most likely only need one of them. When will the Z flag be set? Can this ever happen? I hope all this is helpful. PICs are great fun to work with. Out of interest, what are you using to program them? Rob -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics