tags:

views:

208

answers:

1

Hi All,

I have a mixed assembler and C project based on IAR ARM. I have some #define in C header, I like to use (import) them in assembler file. Could anybody tell me it is possible?

Many thanks.

A: 

Sure, as long as you can make the syntax play nice. Just run your assembly file through the C preprocessor before assembling.

Carl Norum
for example, I have #define FOR_ASSEMBLER in a c header file, then I like the #define to be used in assemlber file as below:#ifdef FOR_ASSEMBLER ...here is assembler code...#endif
c-stranger
That should work just fine. Put a `#include "myHeader.h"` into your assembly file, and then run it through `cpp` or `cc -E` before handing it off to your assembler.
Carl Norum