Quote Originally Posted by cncmachineguy View Post
I want to get clear about something interupt related here. If I have a pure ASM isr, does that mean I don't have to worry about PBP stuff at all when I enter and exit? So for instance, if I set PIE for timer 1 and GIE, I know my interupt will fire any time. I also know the PIC will tend to W,STATUS, and PCLATH, (more or less depending on device). So I don't need to worry about anything else? And if I address a user defined variable in my ISR, I do that with _VariableName? If its that easy, thats wonderful.
I can answer that for you. The ISR only needs to save as many registers as you are going to use in the ISR. So, if you plan on using W, Status, FSR, and any other registers that are used in the main program code, you need to save them on entry to the ISR and restore them while getting out. The moment you mix in PBP in an ASM ISR, you need to worry about the variables that PBP starts using.

PBP uses a lot of internal variables called T1, T2, R0, R1, etc
The moment you start using PBP math, logical and, if x and y then type constructs, these variables are used. So, you are better off not using PBP inside interrupts if you mark the ISR as ASM code with DT_ints The best way is to look at the generated LST file for the ISR code; you will learn a lot by just inspecting it.

A simple x = y type assignment does not need any PBP variables and it will most certainly work in ASM.

Regards