ARM Technical Support Knowledge Articles

ASMEXPAND DIRECTIVE

Applies to: C166 C Compiler

Answer


Information in this article applies to:


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

Article last edited on: 2000-09-07 00:00:00

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential