list p=16F872
include "P16F872.inc"
__config 0x3F3A
cblock
d1
d2
d3
endc
org 0x0000
CLRF CCP1CON ; Turn CCP module off
bcf STATUS, RP0
bcf STATUS, RP1
clrf PORTA
; clrf PORTB
bsf STATUS, RP0 ; select bank 1
clrw
movwf ADCON0
movlw 0x06
movwf ADCON1
movlw 0x00
movwf TRISA ; in bank 1
movwf TRISB ; in bank 1
movwf TRISC
bcf STATUS, RP0
clrf PORTA
; clrf PORTB
clrf PORTC
MainLoop
; incf count1
movlw 0xff
movwf PORTA
bsf PORTB, 5
bsf PORTB, 4
movwf PORTC
call Delay
bcf PORTB, 5
bcf PORTB, 4
movlw 0x00
movwf PORTC
call Delay
goto MainLoop
Delay
;2499992 cycles
movlw 0x15
movwf d1
movlw 0x74
movwf d2
movlw 0x06
movwf d3
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_0
;4 cycles
goto $+1
goto $+1
;4 cycles (including call)
return
end