;this is a simple source
;
;this little program toggles the PortA bit 3,
;Port B counts every change on bit RA.3
;



	DEVICE PIC16C54,RC_OSC,WDT_OFF,PROTECT_OFF

	RESET	start

count1	=	0Bh			;this defines the register





start	mov	!RA,#00000111b		;bit 0 to bit 2 are inputs
	mov	!RB,#0			;portb is output
	clr	RB			;clear PortB

main	xor	RA,#000001000b		;toggle bit 3 from PortA
	inc	RB			;increase PortB

	call	delay

	jmp	main			;do the main loop




delay	mov	count1,#20		;mov 20 to count1
:loop	djnz	count1,:loop		;decrement count1 and jump to local symbol until
					;loop is > 0
	ret
