The simplest thing to do (for the '877) is define the context save register for W in the upper 16 bytes of the GPRs since they are common to all 4 banks. Then it doesn't matter which bank you are in when you save W in your interrupt service routine. If you don't use a location in the upper 16 bytes, then you have to make sure you allocate a 'w saving' register at the same offset in all the banks, since you usually don't know which bank you'll be in when an interrupt occurs. Interrupts while in any bank is no problem as long as your context saving/restoring works properly. Just follow the example in the '877 data sheet. Define w_temp in the upper 16 bytes of bank 0, and everything will work fine (well, as far as context saving. :) - Mike At 11:22 PM 4/20/2000 -0500, you wrote: >While troubleshooting some code tonight I realized that maybe you need to >disable interrupts while accessing banks 1,2 or 3. I noticed that the >standard interrupt template saves off 'w' and 'status' in what it expects to >be bank 0. If I'm using bank 1,2 or 3 this is not cool with unexpected >results. The whole problem showed up when I started using 'banksel'. >Eventually I gave up and crammed everything into bank 0. Maybe it's a bank >switching problem or maybe it's an interrupt problem. But it works now that >I have given up the other 3 banks. There must be a better way to handle >things on the '877. If you have to banksel and disable interrupts for every >access above bank 0, there must be a better way :-) > >Regards, >John > >============================================= >email: jfisher2@austin.rr.com >web: http://home.austin.rr.com/jfisher2 >callsign: K5JHF >=============================================