You see the red high lights.movlw B'00000111'
movwf CMCON ; disable comparator
clrf PORTA
clrf PORTB
movlw B'00001111' ; set PortA directions
tris PORTA
movlw B'00000001' ; set PortB directions
tris PORTB
Why did no tut thought of explain "tris" doing there?
Does it have to be so complicated?