          ;Experiment-7 for "5x7 Video Screen" Project      
             ;PIC16F84 and only F84 chip         
             ;Column shift right

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

Shift   MOVLW 05
	MOVWF 19h	;Put 5 in the Count file for 5 columns
	BSF 05h,1        ;Reset 4017
        BCF 05h,1        ;allow 4017 to clock via clock line
	
Shift1	MOVLW 7F
	MOVWF 06h	;Turn on 7 outputs for LEDs
	CALL Delay
	MOVLW 00	;Turn off LEDs to prevent mirroring
	MOVWF 06h
	CALL Clock	;Clock the 4017
	DECFSZ 19h,1	;Decrement the count file
	GOTO Shift1
	GOTO Shift	

Clock	BCF 05,0	;Clock the 4017
	NOP
	BSF 05,0
	RETURN
	
Delay   MOVLW 03
        MOVWF 1Ah
Delay1  DECFSZ 1Bh,1
        GOTO Delay1
        DECFSZ 1Ch,1
        GOTO Delay1
        DECFSZ 1Ah,1
        GOTO Delay1
        RETURN

        END

 