Gordon, What exactly are you trying to do? Stop the processing in C as soon as an interrupt occurs? The only thing you can reasonably do is repeatedly check the flag in the "C" code. This will usually come down to just two instructions, so it isn't too bad to sprinkle them throughout the code: while (1) { while (1) { do_a_little(); if (flag) break; do_a_little_more(); if (flag) break; ....etc.. } flag = 0; do_whatever_after_the_interrupt(); } Note: you can even check the flag within called functions and exit them early: void do_a_little(void) { a = b+c; if (flag) return; b = c+d; if (flag) return; } The latency between the interrupt and leaving the loop depends on how closely you sprinkle the checks on flag. There is one other crazy idea you can use: void main_loop_func() { if (do_whatever_flag) do_whatever(); while (1) { do whatever you want without worrying about checking the flag } } And then the interrupt handler looks like this: int_handler: set do_whatever_flag clear interrupt cause set GIE flag jmp to loop_func This technique takes advantage of the fact the the stack on all pics (except 18C/F) are circular. If you use this technique then you can never return from main_loop_func() because the stack no longer aligns. On an 18C/F, where the stack is accesible, you could get even fancier: void driver_func() { main_loop_func(); do_whatever(); } main_loop_func() { main_loop_stack_ptr = STKPTR; while (1) { do whatever you want without worrying about interrupts at all } } int_handler: ---clear interrupting condition--- movf main_loop_stack_ptr,W movwf STKPTR retfie ; returns to caller of main_loop_func() !!! Bob Ammerman RAm Systems -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads