say there is a call to a subroutine Multiply. while the main function has called the subroutine and we are in the middle of the sub routine's execution an external interrupt occurs which also calls the same subroutine multiply. what will happen in that case?

有帮助吗?

解决方案

When an interrupt occurs, the information about the running program is saved away and then the interrupt handler is started. This handler runs on a stack that is separate from the one that the interrupted program uses, so if the handler calls multiply it will have separate parameters, local variables, and return addresses from what the program had.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top