#include <P16F887.INC>
cblock 0x20
Delay1
Delay2
Counter
endc

Org 0

Pinset:
banksel		TRISD
clrf		TRISD
banksel		PORTD
clrf		PORTD
bsf			PORTD,0

Main:
call		Alap

Elore:
call		Delay
rlf			PORTD
decfsz		Counter,f
goto		Elore
call		Alap

Hatra:
call		Delay
rrf			PORTD
decfsz		Counter,f
goto 		Hatra
goto		Main

Alap:
movlw		0x07
movwf		Counter
return


Delay:
	decfsz		Delay1,f
	goto		Delay
	decfsz		Delay2,f
	goto		Delay
return
end