Is this not a way to access the stack variables in the inline asm statement? It assembles but could not resolve the variable _a. Please suggest a way to achieve what I want. Thanks
Sayee
foo()
{
int16 a;
asm("MOVZ DP, #_a");
asm("MOV @_a, #16");
}
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Is this not a way to access the stack variables in the inline asm statement? It assembles but could not resolve the variable _a. Please suggest a way to achieve what I want. Thanks
Sayee
foo()
{
int16 a;
asm("MOVZ DP, #_a");
asm("MOV @_a, #16");
}
Please take a look at this related post for some suggested recommendations.
Other references for mixing C and assembly functions:
http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spra590
Compiler Users Guide for the processor you are using, section on "Interfacing C and C++ With Assembly Language"