# will For loop in MikroC for dspic block the interrupt service routine?

I am using MikroC for dspic30f4011. I am using a Timer3 interrupt for ADC reading. In this Interrupt services routine, I am reading ADC values. In Void main, where I need some delay in the instruction . will timer3 Interrupt will read the value of ADC and will update the ADC variable? how will it work?

My question is that, if I am using an interrupt, will the delay in the Void main effects the interrupt. Will delay remaining while interrupting occurs?

one more, If use for loop for the delay as given below. If during for loop, interrupt occurs, interrupt will do its task and then start again from where it is interrupted

                               for(long q = 0; q<1000000; q++){
//
}


if an interrupt occurs at q=100, after interrupt service, will the for loop start again from q=101?

• I don't know about this specific arch, but conventionally interrupt is interrupting the "normal flow" of the program. And the for loop in main is pretty much a "normal flow". Feb 21, 2018 at 18:48
• Just compile with optimizations and that for loop will be gone... Feb 21, 2018 at 19:02