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 can Assemler and C share Variables?

I have a C-program with an imbedded Assembler-program.
The assembler-prog. is called by timerinterrupt 100.000 times per sec. Interrupt-routines have no parameters and return values. How can C and Assembler share variables?
Thanks for help?

  • Exactly the same way that separate 'C' files can share a variable, and separate ASM files can share a variable!

    You need exactly one Public (global) definition of the variable, and you may have as many External declarations as you need.

    So long as the External declarations match the definition, it makes no difference if they're in different languages!