The C macros are expanded inside of inline assembler code as they are expanded in C. One special point to note is the syntax of a __asm directive generated by macros. As macros always expand to one single line, only the first form of the __asm keyword is used in macros:
__asm NOP;For example:
#define SPACE_OK { __asm NOP; __asm NOP; }
#define NOT_OK { __asm { \
NOP; \
NOP; \
}
The macro NOT_OK is expanded by the preprocessor to one single line, which is then incorrectly translated because every assembly instruction must be explicitly terminated by a newline. Use the pragma NO_STRING_CONSTR to build immediates by using # inside macros.