	LIST   P=PIC16F884
	#include "C:\Program Files\Microchip\MPASM Suite\P16F884.INC"
	
	cblock 0x20
	seged1
	endc
	
	org 0x00
	goto init
	
	org 0x04	
	bcf INTCON,T0IF		;T0IF törlés
	movlw b'11111111'
	xorwf seged1,W
	movwf PORTC
	movwf seged1		;seged1&PORTC invertálás
	retfie

init
	bsf STATUS,RP0		;BANK1-be lapozás
	movlw 0x00
	movwf TRISC			;PORTC kimenet
	movwf TRISB
	bsf OPTION_REG,PS0
	bsf OPTION_REG,PS1
	bcf OPTION_REG,PS2	;előosztó=011
	bsf INTCON,GIE		;GIE 1
	bsf INTCON,T0IE		;T0IE 1
	btfss PCON,0
	movlw b'00000001'	;ha BOR=0, akkor W=0x01, egyébként 0x00
	bcf STATUS,RP0		;BANK0-ba lapozás
	movwf PORTB
	movlw 0x00
	movwf PORTC			;PORTC=0
	movwf seged1		;seged1=0
	goto loop

loop
	nop
	goto loop
	
	end