interrupt question

Speklap:
This is false, right? First, these are no single cycle instruction. And second, if it was inside digitalWrite, after the ISR it would continu inside digitalWrite and not go to ML4.
At least this is what I thought was happening. If the interrupt happens, the programs stops, goes to the interrupt handler, executes and goes back to the program counter

You are pretty well correct.

Interrupts take place at the level of machine code instructions and implementing something like digitalWrite() needs a lot of machine code instructions. When an interrupt occurs the current machine code instruction completes and the ISR is called. When the ISR completes it returns control the next machine code instruction in the code that was being implemented - i.e.back to where the program counter had been when the ISR was called.

As you correctly surmise the ISR may well be called while the code is only part-way through the digitalWrite() function, and it will return and complete the function.

It is probably nit-picking on my part, but the program counter will also have been used in the execution of the code in the ISR so, technically, it does not go "back to the program counter"

...R