Question

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?

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top