Keil™, An ARM® Company

Technical Support

C166: ASMEXPAND DIRECTIVE


Information in this article applies to:

  • C166 Version 4.06

QUESTION

What does the ASMEXPAND directive do?

ANSWER

The ASMEXPAND directive (abbreviated AE) instructs the C compiler to use the C preprocessor to expand all symbols used in ASM/ENDASM blocks. This is the default operation of the C166 Compiler, so you don't necessarily need to specify this directive.

The NOASMEXPAND directive (abbreviated NOAE) instructs the C compiler to avoid using the C preprocessor to expand symbols used in ASM/ENDASM blocks. When this directive is used, text between ASM and ENDASM is copied verbatim without any preprocessor expansion. Use NOASMEXPAND when symbols in your in-line assembly have the same names as defined macros.

For example:

#pragma noasmexpand

#define  abc  1
#define  xx0  2
#define  xx1  3


#pragma asm
  abc equ 2     ; above 'abc' not expanded
  xx0 equ 10    ; above 'xx0' not expanded
#ifdef QQQ
  xx1 equ 20
#endif

#pragma endasm

Last Reviewed: Thursday, September 07, 2000


Did this article provide the answer you needed?
 
Yes
No
Not Sure