

	LIST	P = 16F874, R = DEC
	#include P16F874.INC

		__CONFIG  _BODEN_OFF & _CP_OFF & _WRT_ENABLE_OFF  & _PWRTE_OFF & _WDT_OFF & _HS_OSC & _DEBUG_OFF & _CPD_OFF & _LVP_OFF 

;----------------------------------------------------------
	ORG 	H'0000'  
	GOTO	START
;----------------------------------------------------------

START
	banksel	OPTION_REG
	movlw	b'00000000'
	movwf	OPTION_REG
;portA
	banksel	TRISA		; vyber banky
	movlw	b'00000000'	; 0 vstup, 1 vystup
	movwf	TRISA		; sup do TRISu
;PORTB
	banksel	TRISB		; vyber banky
	movlw	b'11111111'	; 0 vstup, 1 vystup
	movwf	TRISB		; sup do TRISu
;vypnuti AD	
	banksel	ADCON0		; vyber banky
	movlw	b'00000000'	; FRC,ADC is OFF			
	movwf	ADCON0		
	
	banksel	ADCON1		; vyber banky
	movlw	b'00000110'	; vlevo, VSS, VDD		
	movwf	ADCON1		; 

;PORTC
	banksel	TRISC		; vyber banky
	movlw	b'00000000'	; 0 vstup, 1 vystup
	movwf	TRISC		; sup do TRISu
;PORTD
	banksel	TRISD		; vyber banky
	movlw	b'00000000'	; 0 vstup, 1 vystup
	movwf	TRISD		; sup do TRISu
;PORTE
	banksel	TRISE		; vyber banky
	movlw	b'00000000'	; 0 vstup, 1 vystup
	movwf	TRISE		; sup do TRISu
	banksel	0

sem1	NOP
	MOVf	PORTB,w
	NOP
	NOP
	NOP
	MOVWF	PORTD
	NOP
	NOP
	GOTO	sem1

	END