David Olson wrote: > start movlw b'11111111' ;set porta for input > tris porta > movlw b'11110111' ;set bit 3 for output > tris portb > clrf swst ;clear switch register Welcome to the wonder world of PIC's! I notice you Tris all the unused pins as inputs, did you connect them to ground? If not, Tris all your unused pins as outputs, and do not tie them to ground. There is an ongoing discussion about whether to make unused pins as inputs and tie them to ground, or tris the pins as outputs and just let them float. Find out what works best for you. Also, your input pin for the switch, did you use a pull up resistor to keep the input pin high when the switch is not made? The rest of your code is fine. You can make the code a whole lot shorter, but as you are still learning, I am not going to tell you, figure it out yourself. Tip: PortA and PortB are also registers. Quentin