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.

Accessing local variables from assembly

I'm working with the F2618 on CCSv4.0.1.01001

Here's my code:

void myFunc( void )
{
    int foo;
    asm("    .var           foo");
    asm("    movx.w    &foo, r12");
    asm("    movx.w    r2, 0(r12)"); 

     // Do something with foo
}

Basically I am trying to copy the SR to foo.  How can I make sure 'foo' shows up in the symbol table so that the assembler can find it, .var is not working.

Many Thanks,

Mateja