Hi,
PBP does not branch to the interrupt vector when an interrupt occurs. By using the On Interrupt, PBP checks for interrupts and flags it. When it finishes the current function it jumps to the defined basic interrupt routine. For example when executing a function block, say serout, PBP would complete the serial out and then process the interrupt. So that's where the latancy is introduce. If PBP is executing a pause then it does it by some iterations of its own library. That means pause is itself a delay loop and your statement defines how many times it should loop around to introduce the desired delay. Thus while executing its own library PBP would finish it and then process. If you are executing an asm statement that already means that PBP is not in the process of executing its built in library. So the latency is less.
As I always mention please look at this thread and appreciate the smart and hard work darrel has done, http://www.picbasic.co.uk/forum/showthread.php?t=3251
BTW if your app is time sensitive and you would be handling higher/lower priority interrupts it is a good idea to use asm. Also to reduce your bank addressing headache you can use the system bank to hold your variables (if they fit) used in the ISR. If not then indirect addressing is what I use on the PIC18
Happy New Year to All
Bookmarks