AnsweredAssumed Answered

Using preprocessor #define in asm

Question asked by Ruben Valls Blasco on Apr 27, 2009
Latest reply on Apr 27, 2009 by Ruben Valls Blasco

Hi everyone!

I am using project pannel "C/C++ Preprocessor" to #define global parameters of my project, and compile different code depending on them. It works fine in C files, but the problem is when I am using this parameter in an ASM source file, where I always get the error Unknown identifier.

I leave you an example:

 

/*In preprocessor pannel*/

#define MY_OPTION 1

 

/*In the *.s file*/

.extern MY_OPTION

 

#if MY_OPTION==1

  //Some code

#else

  //Some other code

 

How can I include this parameter to the asm file so when I compile the project, the compiler recognizes it?

 

Thanks in advance,

Rubén

Outcomes