	
;Test tlačítka ON/OFF na PORTA,0. Indikační LED na PORTA,1
;***********************************************************************************************
		LIST P=16F876A
		include "p16f876A.inc"

		__config _LVP_OFF & _FOSC_HS & _DEBUG_OFF & _WRT_OFF & _PWRTE_ON & _WDTE_OFF & _BOREN_ON
;***********************************************************************************************

#define	TLAC	PORTA,0
#define	LED	PORTA,1
;************************************************************
		org	000h
		goto Start

		org	004h
		retfie
;***********************************************************
Start
		bsf	STATUS,RP0			;přepnuní do bank1(80h - FFh)

		movlw	06h				;PORTA nastaven na digitální I/O
		movwf	1Fh				;ADCON1(9Fh)

		movlw	b'00000001'		;nastavení PA0 In, PA1-PA7 Out
		movwf	05h				;TRISA(85h)

		bcf	STATUS,RP0			;přepnutí do bank0(00h - 7Fh)


Opak
		BTFSS   TLAC 
    	GOTO   $-1 
    	BSF   LED 
    	BTFSC   TLAC 
    	GOTO   $-1 

    	BTFSS   TLAC 
    	GOTO   $-1 
    	BCF   LED 
    	BTFSC   TLAC 
    	GOTO   $-1

		goto Opak
;***********************************************************
		end