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

Does it possible to use local C-vars in "#pragma asm" block?

Hi all.

Does it possible to use local C-vars in "#pragma asm" block? I mean something like this:

void Foo(void)
{ BYTE t;
#pragma asm mov r0, t; // error A45: UNDEFINED SYMBOL
...

Parents
  • I can use static local variable:

    void foo(void)
    {
     static BYTE t;
     #pragma asm
      mov r0,t  // OK
    ...
    
    

    I should take my words back: it does not work. And if there is a global variable with the same name it will be silently used instead of the local variable ... :-(

    Alex.

Reply
  • I can use static local variable:

    void foo(void)
    {
     static BYTE t;
     #pragma asm
      mov r0,t  // OK
    ...
    
    

    I should take my words back: it does not work. And if there is a global variable with the same name it will be silently used instead of the local variable ... :-(

    Alex.

Children
No data