Hi,

1) Internally PBP works with a bunch of system variables in RAM. These are used to store intermediate results when doinf calculations and comparisons, loop counters etc etc. When you define the type of handler as PBP in the interrupt declaration DT-Ints saves all the PBP system variables on entry of the interrupt service routine and restores them on exit. This allows the code the in interrupt handler to be written in PBP just like any normal PBP program and execute without destroying the content of the system variables for the code that was executing when the intterupt occurs. When the execution returns from the interrupt handler the system variables looks exactly as they did when the interrupt occured and the "normal" program can continue to execute.

If you define the type of handler as ASM DT-Ints does not save and restore the PBP system variables. This means that if you have code in the interrupt handler which happens to use any system variables it's very likely that you'll run into trouble. So, type PBP write the handler in PBP. Type ASM, write the handler in ASM.

The difference is that it takes time for the system to save and restor all the PBP system variables (and the take up space i RAM). No you should not declare the type as ASM and still write the handler in PBP if you don't konw and understand exactly what's happening and what system variables your code uses.


2) When an interrupt occurs the hardware in the PIC sets the interrupt flag for the particular interrupt. The ResetFlag option tells the interrupt system if IT should reset the flag after it's handled the interrupt or if it should leave it alone. Generally you set this to YES but for USART interrupt, for example, the flag is automatically cleared by the hardware when the RCReg is read so there's no need for the code to clear it as well.