org 0x00
goto BEGIN
org 0x04 ;set start of ISR
movwf wtemp ; save W & status
swapf STATUS,W
movwf statustemp
movlw 0x0E ;blink upper three of lower half ON
movwf PORTB
nop
nop
nop
movlw 0x00 ; Blink OFF
movwf PORTB
movlw 0x0E ;blink upper three of lower half ON
movwf PORTB
nop
nop
nop
movlw 0x00 ; Blink OFF
movwf PORTB
swapf statustemp,W ; Restore W & status
movwf STATUS
movf wtemp,w
bcf INTCON,1 ; clear bit 1 INTF
retfie
BEGIN clrf PORTA
clrf PORTB
bsf INTCON,4 ; Enable RB0 interrupt
movlw 0x07 ; turn off comparators
movwf CMCON
bsf INTCON,7 ; Bit7 GIE global int enable
bsf INTCON,6 ; PEIE Bit set Peripheral enable
bsf INTCON,4 ; INTE Bit RB0 External Interrupt bit
bsf STATUS ,RP0 ;Bank 1
;set TRISB bit0 to 1
movlw b'00000001' ;set PORTB Bits<7..1>as output
movwf TRISB ; PORTB Bit0 as Input
bcf OPTION_REG,6 ;Clear PEIE (RBO interrupt)
bcf STATUS ,RP0 ; Bank 0
START
nop
nop
; wait for interrupt
nop
goto START
end