          ;Experiment-4 for "5x7 Video Screen" Project      
             ;PIC16F84 and only F84 chip         
             ;LEDs scan up and down at 2Hz. 

Start   ORG 0x00
        BSF 03,5        ;Go to page1 for setting-up the ports
        MOVLW 00h       ;Put 00 into W             
        MOVWF 05h       ;Make all RA lines output        
        MOVWF 06h       ;Make all RB lines output
        BCF 03,5        ;Go to Page0 for programming
        MOVLW 02h       ;Put 02 into W to
        MOVWF 05h       ;    Reset the 4017

 
UpDown  BCF 03h,0       ;clear the carry flag
        MOVLW 01h	;Turn on the bottom LED
        MOVWF 06h	;   and output a HIGH
        CALL Delay
UpDown1 RLF 06h,1	;Shift the HIGH up the column
        CALL Delay
	BTFSS 06h,6	;Has it reached the top?
        GOTO UpDown1	;NO.
UpDown2	RRF 06h,1	;YES. Shift the HIGH down
	CALL Delay
	BTFSS 06h,0	;Has it reached the bottom?
	GOTO UpDown2	;NO.
	GOTO UpDown1	;YES. Repeat the cycle


Delay   MOVLW 03
        MOVWF 1Ah
Delay1  DECFSZ 1Bh,1
        GOTO Delay1
        DECFSZ 1Ch,1
        GOTO Delay1
        DECFSZ 1Ah,1
        GOTO Delay1
        RETURN


        END

 
