ENABLE and DISABLE are really compiler directives and NOT run-time program executable commands.
What this means is that during COMPILE, additional code for checking and jumping to your PICBASIC interrupt will not be inserted between your code statements between the DISABLE and ENABLE pair. So the example you show is valid.
The use of PICBASIC interrupts makes your program very code hungry (and slows it down) because of the way additional statements are inserted between your code, so the best way is only to have them enabled ONLY when you really want them. And because they don't get executed immediately (as can be now seen they're only jumped to BETWEEN your PICBASIC statements, this means that your PICBASIC commands will complete in the normal way BEFORE any interrupt jump is encountered... but if you understand what's going on inside your PIC you can handle this. Go search the forum for OLYMPIC TIMER for an example of PICBASIC interrupt usage.
Bookmarks