list p=16f877a
include p16f877a.inc
__CONFIG _CP_OFF & _WDT_OFF & _HS_OSC & _PWRTE_ON
cblock 0X30
d1
d2
d3
COUNT
endc
org 00
; goto START
CLRF PORTB
CLRF PORTD
CLRF PORTC
BANKSEL TRISA
MOVLW B'1111000'
MOVLW TRISA
CLRF TRISB
CLRF TRISD
CLRF TRISC
BSF TRISC, 7
BANKSEL PORTA
MOVLW D'4'
MOVWF COUNT
STYLE1 MOVLW B'11111111'
MOVWF PORTB
MOVWF PORTD
BSF PORTC,0
CALL DELAY1
BCF PORTC,0
BSF PORTC,1
CALL DELAY1
BCF PORTC,1
BSF PORTC,2
CALL DELAY1
BCF PORTC,2
BSF PORTC,3
CALL DELAY1
BSF PORTC,2
CALL DELAY1
BSF PORTC,1
CALL DELAY1
BSF PORTC,0
CALL DELAY1
BCF PORTC,3
CALL DELAY1
BCF PORTC,2
CALL DELAY1
BCF PORTC,1
CALL DELAY1
BCF PORTC,0
CALL DELAY1
BSF PORTC,0
CALL DELAY1
BSF PORTC,1
CALL DELAY1
BSF PORTC,2
CALL DELAY1
BSF PORTC,3
CALL DELAY1
BCF PORTC,3
CALL DELAY1
BCF PORTC,2
CALL DELAY1
BCF PORTC,1
CALL DELAY1
BCF PORTC,0
CALL DELAY1
DECFSZ COUNT
LGOTO STYLE1
MOVLW D'4'
MOVWF COUNT
STYLE2 MOVLW B'11111111'
MOVWF PORTC
MOVLW B'10001000'
MOVWF PORTB
MOVWF PORTD
CALL DELAY1
MOVLW B'01000100'
MOVWF PORTB
MOVWF PORTD
CALL DELAY1
MOVLW B'00100010'
MOVWF PORTB
MOVWF PORTD
CALL DELAY1
MOVLW B'00010001'
MOVWF PORTB
MOVWF PORTD
CALL DELAY1
CLRF PORTB
CLRF PORTD
CLRF PORTC
CALL DELAY1
DECFSZ COUNT
LGOTO STYLE2
MOVLW D'4'
MOVWF COUNT
STYLE3 MOVLW B'11111111'
MOVWF PORTC
MOVLW B'11110000'
MOVWF PORTB
CALL DELAY1
MOVLW B'00001111'
MOVWF PORTB
CALL DELAY1
CLRF PORTB
MOVLW B'11110000'
MOVWF PORTD
CALL DELAY1
MOVLW B'00001111'
MOVWF PORTD
CALL DELAY1
CLRF PORTD
CLRF PORTC
DECFSZ COUNT
GOTO STYLE3
MOVLW D'4'
MOVWF COUNT
STYLE4 MOVLW B'00001001'
MOVWF PORTD
MOVLW B'10010000'
MOVWF PORTB
BSF PORTC, 0
CALL DELAY1
BSF PORTC, 1
CALL DELAY1
BSF PORTC, 2
CALL DELAY1
BSF PORTC, 3
CALL DELAY1
BCF PORTC, 3
CALL DELAY1
BCF PORTC, 2
CALL DELAY1
BCF PORTC, 1
CALL DELAY1
BCF PORTC, 0
CALL DELAY1
BSF PORTC, 0
CALL DELAY1
BSF PORTC, 1
CALL DELAY1
BSF PORTC, 2
CALL DELAY1
BSF PORTC, 3
CALL DELAY1
BCF PORTC, 3
CALL DELAY1
BCF PORTC, 2
CALL DELAY1
BCF PORTC, 1
CALL DELAY1
BCF PORTC, 0
CALL DELAY1
DECFSZ COUNT
LGOTO STYLE4
MOVLW D'4'
MOVWF COUNT
STYLE5 MOVLW B'11111111'
MOVWF PORTC
BSF PORTD, 7
CALL DELAY1
BCF PORTD, 7
BSF PORTD, 6
CALL DELAY1
BCF PORTD, 6
BSF PORTD, 5
CALL DELAY1
BCF PORTD, 5
BSF PORTD, 4
CALL DELAY1
BCF PORTD, 4
BSF PORTD, 0
CALL DELAY1
BCF PORTD, 0
BSF PORTB, 4
CALL DELAY1
BCF PORTB, 4
BSF PORTB, 0
CALL DELAY1
BCF PORTB, 0
BSF PORTB, 1
CALL DELAY1
BCF PORTB, 1
BSF PORTB, 2
CALL DELAY1
BCF PORTB, 2
BSF PORTB, 3
CALL DELAY1
BCF PORTB, 3
BSF PORTB, 7
CALL DELAY1
BCF PORTB, 7
BSF PORTD, 3
CALL DELAY1
BCF PORTD, 3
BSF PORTD, 2
CALL DELAY1
BCF PORTD, 2
BSF PORTD, 1
CALL DELAY1
BCF PORTD, 1
BSF PORTB, 5
CALL DELAY1
BCF PORTB, 5
BSF PORTB, 6
CALL DELAY1
BSF PORTB, 5
CALL DELAY1
BSF PORTD, 1
CALL DELAY1
BSF PORTD, 2
CALL DELAY1
BSF PORTD, 3
CALL DELAY1
BSF PORTB, 7
CALL DELAY1
BSF PORTB, 3
CALL DELAY1
BSF PORTB, 2
CALL DELAY1
BSF PORTB, 1
CALL DELAY1
BSF PORTB, 0
CALL DELAY1
BSF PORTB, 4
CALL DELAY1
BSF PORTD, 0
CALL DELAY1
BSF PORTD, 4
CALL DELAY1
BSF PORTD, 5
CALL DELAY1
BSF PORTD, 6
CALL DELAY1
BSF PORTD, 7
CALL DELAY1
BCF PORTB, 6
CALL DELAY1
BCF PORTB, 5
CALL DELAY1
BCF PORTD, 1
CALL DELAY1
BCF PORTD, 2
CALL DELAY1
BCF PORTD, 3
CALL DELAY1
BCF PORTB, 7
CALL DELAY1
BCF PORTB, 3
CALL DELAY1
BCF PORTB, 2
CALL DELAY1
BCF PORTB, 1
CALL DELAY1
BCF PORTB, 0
CALL DELAY1
BCF PORTB, 4
CALL DELAY1
BCF PORTD, 0
CALL DELAY1
BCF PORTD, 4
CALL DELAY1
BCF PORTD, 5
CALL DELAY1
BCF PORTD, 6
CALL DELAY1
BCF PORTD, 7
CALL DELAY1
CLRF PORTC
CALL DELAY1
DECFSZ COUNT
LGOTO STYLE5
MOVLW D'4'
MOVWF COUNT
GOTO STYLE1
DELAY1
movlw 0x23
movwf d1
movlw 0xB9
movwf d2
movlw 0x09
movwf d3
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_0
;6 cycles
goto $+1
goto $+1
goto $+1
END