Keil Logo

C51: SAVING EXTRA VARIABLES ON THE STACK

Information in this article applies to:

  • C51 Version 5.50

QUESTION

I want to push extra variables onto the stack in an interrupt service routine (in addition to what the compiler has already saved). How can I do that?

ANSWER

Probably the best way to save additional data on the stack in an interrupt service routine is:

  1. Include in-line assembly code in the ISR to push and pop the variables.
  2. Generate an assembly file for the C file. Use the #pragma SRC directive for that. Then, directly modife the SRC file, assemble it, and include it in the linker command line.

Last Reviewed: Saturday, July 9, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.