A macro with inline asm and line continuations is split into multiple __asm / __endasm instructions to keep the lines. But when another macro is used inside the assembly it forgets it was in an __asm / __endasm block. E.g.
#define NOP nop
#define NOPS1 \ __asm NOP __endasm; \ __asm \ NOP \ NOP \ __endasm
#define NOPS2 \ __asm nop __endasm; \ __asm \ nop \ nop \ __endasm
In this NOPS1 case the NOP are all replaced by "nop" but the backslashes inside __asm / __endasm are not replaced by "__endasm; __asm".
If the NOP macro is not used it works as intended as shown by NOPS2.
Log in to post a comment.