;Switch-2 Program for 5x7 Video Screen
;PIC16F84 and only F84 chip
;Detects Buttons A, B and C and illuminates LEDs


Start   ORG 0x00
	BSF 03,5
	MOVLW 1Ch	;Make RA2, RA3 and RA4 inputs
	MOVWF 05h
	MOVLW 00h	;Put 00 into W	
	MOVWF 06h	;Make all RB lines output
	BCF 03,5	;Go to Page0 for programming

	MOVWF 06h	;Put 00 into output port to
                        ;    turn off all LEDs

Loop1	BTFSC 05,2	;Test button A to see if line is LOW
	GOTO Loop2	;   
	MOVLW 01h	;Put 1 into W to turn on lower LED
	MOVWF 06h	;output 1 to the display	
Loop2	BTFSC 05,3	;Test button B to see if line is LOW
	GOTO Loop3 		
	MOVLW 08h	;Put 08 into W to turn on middle LED
	MOVWF 06h	;Output 08 to display	
Loop3	BTFSC 05,4	;Test button C to see if line is LOW
	GOTO Loop1
	MOVLW 40h	;Put 40h into W to turn on top LED
	MOVWF 06h
	GOTO Loop1	
	
	END
		