;=============================================================================
;THIS IS THE INTERUPT ROUTINE.
;=============================================================================
INTERRUPT org ISR_V ;INTERRUPT VECTOR LOCATION.
movwf _W
swapf STATUS,W
movwf _STATUS
movf PCLATH,w ; move pclath register into w register
movwf pclath_temp ; save off contents of PCLATH register
bcf STATUS,RP0;SELECT BANK 0.
CALL WAIT_15MS
movlw B'11110000' ;CHECK FOR KEY DOWN.
movwF TEMP
movf PORTB,W
subwf TEMP,F
btfsc STATUS, Z
goto DONE ;ALL KEYS UP SO RETURN.
;call HZ_LABEL ;DISPLAY KEYCODE ON RD0,1,2 AND 3.
call SHIFT_KEYS
;call GETKEY ;KEY PRESSED NOW IN W (0 - 15).
;movwf LAST_KEY
;call SAVE_KEY
;call FREQ_LABEL
DONE
clrf PORTB ;CLEAR PORT B.
clrf PORTD ;CLEAR PORT D.
movf PORTB,F
bcf INTCON,RBIF;CLEAR Port B interrupt FLAG
movf pclath_temp,w ; retrieve copy of PCLATH register
movwf PCLATH ; restore pre-isr PCLATH register contents
movf _STATUS,W ; retrieve copy of STATUS register
;;;swapf STATUS,W ;RESTORE SAVED REGISTERS.
movwf STATUS
swapf _W,F
swapf _W,W
retfie