;Program for PIC16F84 and only F84 chip
;Takes data from Table1 and runs it across the screen
Start ORG 0x00 ;This sets up the ports
BSF 03,5
MOVLW 00h
MOVWF 05h
MOVWF 06h
BCF 03,5
GOTO Run1
;Table1 holds the hex values for each column of LEDs
Table1 ADDWF 02h,1 ;Add W to Program Counter
RETLW 00h
RETLW 3eh
RETLW 41h
RETLW 41h
RETLW 22h
RETLW 00h
RETLW 00h
RETLW 3fh
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3fh
RETLW 00h
RETLW 00h
RETLW 7fh
RETLW 48h
RETLW 4ch
RETLW 4ah
RETLW 31h
RETLW 00h
RETLW 00h
RETLW 40h
RETLW 40h
RETLW 7fh
RETLW 40h
RETLW 40h
RETLW 00h
RETLW 00h
RETLW 3fh
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3fh
RETLW 00h
RETLW 00h
RETLW 3eh
RETLW 41h
RETLW 49h
RETLW 49h
RETLW 2eh
RETLW 00h
RETLW 00h
RETLW 7fh
RETLW 49h
RETLW 49h
RETLW 41h
RETLW 00h
RETLW 00h
RETLW 7fh
RETLW 20h
RETLW 1ch
RETLW 02h
RETLW 7fh
RETLW 00h
RETLW 00h
RETLW 3fh
RETLW 48h
RETLW 48h
RETLW 48h
RETLW 3fh
RETLW 00h
RETLW 00h
RETLW 0FFh
Run1 CLRF 11h ;Clear the Ghost locations ready for starting
CLRF 12h
CLRF 13h
CLRF 14h
CLRF 15h
MOVLW 00
MOVWF 19h ;File 19h is the jump value for table
Run2 MOVLW 40h
MOVWF 18h ;File 18h counts the number of scans
CALL Shift ; and controls the "run speed"
INCF 19h,1
MOVF 19h,0 ;Put jump value into W
CALL Table1
MOVWF 15h ;W contains table data - put it in 15h
XORLW 0FFh ;If table value is FF,
BTFSC 03,2 ; bit 2 of file 3 will be SET (=1)
GOTO Run1 ;Start Table1 again
Run3 DECFSZ 18h,1 ;Scan the display 40h times
GOTO Run4
GOTO Run2
Run4 CALL Scan
GOTO Run3
Scan BSF 05,1 ;Reset 4017
NOP
BCF 05,1
MOVF 11h,0 ;Output the data at the 5 Ghost
MOVWF 06h ; locations to the display
CALL DelD
MOVF 12h,0
MOVWF 06h
CALL DelD
MOVF 13h,0
MOVWF 06h
CALL DelD
MOVF 14h,0
MOVWF 06h
CALL DelD
MOVF 15h,0
MOVWF 06h
CALL DelD
RETURN
;SHIFT moves the data one place to the left to give the "movement"
; effect on the screen
Shift MOVF 12h,0 ;Move file 12h to W
MOVWF 11h ;Move W to file 11h
MOVF 13h,0 ;Move file 13h to W
MOVWF 12h ;Move W to file 12h
MOVF 14h,0 ;Move file 14h to W
MOVWF 13h ;Move W to file 13h
MOVF 15h,0 ;Move file 15h to W
MOVWF 14h ;Move W to file 14h
RETURN
DelD DECFSZ 1Bh,1 ;Delay for viewing the
GOTO DelD ; column of LEDs
MOVLW 00h
MOVWF 06
Clk BSF 05,0 ;Clock the 4017 to
NOP ; the next output
BCF 05,0
RETURN
END