;********************************************************
;Interrupt Demonstration
;This program demonstrates simple use of single interrupt. 
;Intended for simulation.
;;Int_Demo1										14.4.05
;********************************************************
;
	#include p16f84A.inc
;Port A all output
;Port B: bit 0 = Interrupt Input
;
        org 00
        goto start
;
		org 04	;here if interrupt occurs
		goto Int_Routine
;
        org 0010
;Initialise
start   bsf     status,rp0   ;select bank 1
 		movlw   01
        movwf   trisb      	;portb bits 1-7 output
							;			0   input
		movlw   00
        movwf   trisa      	;porta bits all output
        bcf     status,rp0  ;select bank 0  
		bsf	intcon,inte ;enable external interrupt
		bsf	intcon,gie  ;enable global int
;Remove comment from following instruction to change 
;interrupt edge
;	bsf	option_reg,intedg  
wait	movlw	0a	;set up initial port output values
		movwf	porta
		nop
		movlw	15
		movwf	porta
		goto	wait
;
		org 0080
Int_Routine
		movlw	00
		movwf	porta
		bcf		intcon,intf
		retfie
		end
