This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how many registers are pushed into the stack when running an ISR ?

I want to change the return address in the stack when running an ISR so that it returns to the specified address. But i found the compiler also pushes some variables to the stack. How can I configure the complier so that it only pushes all registers to the stack when it complies an ISR?

thank you for your kindly help!!

Parents
  • I want to change the return address in the stack when running an ISR so that it returns to the specified address.

    This question seems to pop up at least once a month.

    And the answer is always:

    This is generally a bad idea. And it is an especially bad idea on the '51 architecture. There are ways of accomplishing what you are trying to do without resorting to manually messing with the return address.

    If you can describe why you think you need to mess with the contents of the stack, then the people on this forum can certainly point you in the right direction on how to do this with much, much less headaches.

Reply
  • I want to change the return address in the stack when running an ISR so that it returns to the specified address.

    This question seems to pop up at least once a month.

    And the answer is always:

    This is generally a bad idea. And it is an especially bad idea on the '51 architecture. There are ways of accomplishing what you are trying to do without resorting to manually messing with the return address.

    If you can describe why you think you need to mess with the contents of the stack, then the people on this forum can certainly point you in the right direction on how to do this with much, much less headaches.

Children