Keil Logo

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 7, 2000


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.