| ??? 10/17/01 14:44 Read: times |
#15771 - RE: an interrupt question. |
Hi Rustu
By your 3rd assumption I hope u meant that for each interrupt the programmer should do his own PUSHs and POPs, coz the device doesn't do it inherently as part of the interrupt service routine You should know that every time a subroutine call is made(ACALL, LCALL) or even an interrupt occurs and jumps to its vector (handler address), the return address(i.e. the point in the executing program from where it was called) is PUSHed by the 8051 onto the stack. On returning, the return address is simply POPed back into the porgram counter. This way, as long as stack integrity is maintained the execution ALWAYS returns to the point from where it was called. Hence, while returning (RET/RETI) if the stack isn't left as it was when the function call was made, the program WILL go awry. Of course this means the number of PUSHs and POPs executed in a subroutine must be equal. kundi |
| Topic | Author | Date |
| an interrupt question. | 01/01/70 00:00 | |
| RE: an interrupt question. | 01/01/70 00:00 | |
| RE: an interrupt question. | 01/01/70 00:00 | |
RE: an interrupt question. | 01/01/70 00:00 |



