My understanding, and hence my code, is that you must allocate the same memory location in all banks for, as you note it below, "temp_w". This is because as you say there is no assurance as to which page is active at the time of the interrupt. So I allocate the first RAM location in all pages to this temp location. Uck. stevec@rain.org ---------- From: Jim Main[SMTP:jmain@CQM.CO.UK] Sent: Wednesday, May 22, 1996 9:32 AM To: Multiple recipients of list PICLIST Subject: Context saving in interrupts This is the start of my interrupt service routine - it saves W, STATUS, FSR and PCLATH. I'm thinking however that there'll be a problem if an interrupt occurs when STATUS,RP0 is set.... temp_w is then in the wrong register bank, and it'll overwrite whatever that location's being used for.. The only way round it is to leave the corresponding bank1 register free, so that it doesn't matter - but then you'd have to know which bank to look in when it comes time to restore the registers at the end of the routine.. eg you'd have to restore the STATUS register before restoring the W register Does this sound ok, or is there a simpler method? ORG 04 ;This is the interrupt vector movwf temp_w ;store the contents of the w register swapf STATUS,w ;and the status register, so that they bcf STATUS, RP0 ;(set RAM page 0) movwf temp_stat ;can be restored before leaving the interrupt movf FSR,w movwf temp_FSR movf pclath,w movwf temp_lath