Martin J. Maney wrote: > > [Quoting me:] > > > > Sorry you wasted half a day on this. An easier way is the > > following, which is on my web page and has been in the Microchip > > data books for a couple of years now: > > > > INTW EQU [any page-0 register] > > INTS EQU [any page-0 register] > > .... > > ; INTERRUPT SERVICE ROUTINE: > > PUSH MOVWF INTW ;SAVE THE W-REGISTER. > > SWAPF STATUS,W ;SAVE THE STATUS > > MOVWF INTS ;REGISTER. > > > > POP SWAPF INTS,W ;RESTORE THE STATUS > > MOVWF STATUS ;REGISTER > > SWAPF INTW ;RESTORE THE > > SWAPF INTW,W ;W-REGISTER. > > RETFIE ;RETURN AND RE-ENABLE > > ;INTERRUPTS. > > Okay, this is pretty simple (although I don't recall noticing that > it isn't necessary to use swapf to transfer the STATUS register > until you helpfully pointed that out). Now, how does one do this > for a PIC where the register page select actually changes the > (general purpose) register that an instruction addresses? Martin: That one's also on my web page. It looks like this: INTW EQU [any page-0 register] INTS EQU [any page-0 register] INTW1 EQU INTW + 080H .... ; INTERRUPT SERVICE ROUTINE: PUSH MOVWF INTW MOVF STATUS,W BCF STATUS,RP0 MOVWF INTS ; save PCLATH and FSR here. .... POP ; restore PCLATH and FSR here. MOVF INTS,W MOVWF STATUS SWAPF INTW SWAPF INTW,W RETFIE -Andy Andrew Warren - fastfwd@ix.netcom.com Fast Forward Engineering, Vista, California http://www.geocities.com/SiliconValley/2499