Before entering the interrupt handler, all the registers are pushed onto the stack together with the address with distant feedback, they sum the sizes of the registers and add the space needed to store the return address in order to get the minimum stack size.
note that you need more space if you push more data on the stack and in the interrupt handler
source
share