Intserv movwf tempw
movf status,w ;
clrf status
movwf tempstatus
movf pclath,w
movwf tempclath
clrf pclath
movf fsr,w
movwf tempfsr
bank0
btfsc pir1,rcif
bank1
btfss pie1,rcie
goto intexit
bank0 ;receiving
btfsc rcsta,oerr
goto overerr
btfsc rcsta,ferr
goto frameerr
movf rcreg,w
call recept ;input data from rs232
clrf errorflag
goto intexit
overerr bsf errorflag,0
bcf rcsta,cren
bsf rcsta,cren
goto intexit
frameerr
bsf errorflag,1
movf rcreg,w
intexit bank0
movf tempfsr,w
movwf fsr
movf tempclath,w
movwf pclath
movf tempstatus,w
movwf status
swapf tempw,f
swapf tempw,w
retfie
end