          ;Experiment-5A for "5x7 Video Screen" Project      
             ;PIC16F84 and only F84 chip         
             ;Toggling a LED (no de-bounce) 

Start   ORG 0x00
        BSF 03,5        ;Go to page1 for setting-up the ports
	MOVLW 04h       ;Load W with 04           
        MOVWF 05h       ;Make RA2 input for button A    
	MOVLW 00h       ;Put 00 into W      
        MOVWF 06h       ;Make all RB lines output
        BCF 03,5        ;Go to Page0 for programming
	
	MOVLW 00
	MOVWF 06	;Zero the output port
        MOVLW 02h       ;Put 02 into W to
        MOVWF 05h       ;    Reset the 4017

SwLoop1	BTFSS 05,2	;Is switch A pressed?
	GOTO SwLoop1	;YES. Go to SwLoop1		
	CALL Delay
SwLoop2	BTFSC 05,2	;Is switch A pressed?
	GOTO SwLoop2	;NO.  Go to SwLoop2
	MOVLW 01	;YES. 
	XORWF 06,1	;Toggle the LED
	CALL Delay
	GOTO SwLoop1	
	
Delay   DECFSZ 1Bh,1
        GOTO Delay
        DECFSZ 1Ch,1
        GOTO Delay        
        RETURN

        END

 