;	gpasm -a inhx8m port4.asm
;	Port 2 = Port 1

processor	10F322
include		p10f322.inc

	__CONFIG _WDTE_OFF & _FOSC_INTOSC

	ORG	H'00'  ; Reset vector
	GOTO	init	; Pass interrupt vector

	ORG	H'05'
init	CLRF    ANSELA          ; All digital I/O
	MOVLW   B'00000011'	; Port 0 og 1 er input
        MOVWF   TRISA

run	BTFSC	PORTA,B'00000001'
	GOTO	on
	GOTO	off

off	BCF     PORTA, RA2
	GOTO 	run

on	BSF	PORTA, RA2
	GOTO	run

	end
