	list	p = 16f877
	
	#include	<p16f877.inc>
	#include	<config_16f877.cfg>
	
	
	CBLOCK
		t1
		t2
	ENDC
	
	org	0x00
	
	banksel	TRISD
	clrf	TRISD
	banksel	PORTD
	clrf	PORTD
	
	bsf	PORTD,0
	call	delay
	rlf	PORTD,f
	
	goto	$

;nem jó	
;delay
;	movlw	.255
;	movwf	t2
;d1	movlw	.255
;	movwf	t1
;d2	decfsz	t1,f
;	goto	d2
;	decfsz	t2,f
;	goto	d1
;	return


;így jó
delay
	movlw	.255
	movwf	t2
d1	movlw	.255
	movwf	t1
d2	decf	t1,f
	movf	t1,w
	btfss	STATUS,Z
	goto	d2
	decf	t2,f
	movf	t2,w
	btfss	STATUS,Z
	goto	d1
	return
	
END