isr
MOVWF W_TEMP ; W_TEMP is in virtual bank
MOVFF STATUS, STATUS_TEMP ; STATUS_TEMP located anywhere
MOVFF BSR, BSR_TEMP ; BSR located anywhere
; Handle Interupts
BTFSC PIR1, RCIF ; If RCIF Set GOTO Debug
GOTO Debug
GOTO Int_Exit
Debug
CALL Getc ; Get The Command
MOVWF debug_command
MOVLW 0x7A
CALL Putc ; Send We are here
; Its a debug command
if debug_command == 0x01
CALL Getc ; Get The Data
MOVWF debug_data
if debug_data <= 0x7F
MOVLF FSR0H, 0x00
else
MOVLF FSR0H, 0x0F
endif
MOVF debug_data, FSR0L
MOFF INDF0, W
CALL Putc
endif
GOTO Int_Exit
Int_Exit
MOVFF BSR_TEMP, BSR ; Restore BSR
MOVF W_TEMP, W ; Restore WREG
MOVFF STATUS_TEMP,STATUS ; Restore STATUS
RETFIE