Quantcast
Channel: EngineerZone: Message List
Viewing all articles
Browse latest Browse all 36216

Re: Can't make asm samples work

$
0
0

Hi,

I think that webpage gives slightly confused advice.  It seems to be mixing up the intention of assembler directives and pre-processing directives.

 

Instead of using asm directives, just use straight CPP directives.  e.g.

#if defined (__GNUC__)
array_1:
.short 0, 1, 2;
#else
.byte2 array_1[3] = 0, 1, 2;
#endif

 

then compile with the gcc compiler driver, instead of "as" directly:

bfin-uclinux-gcc -x assembler-with-cpp main.asm -c

 

Note that the default file extension for GNU assembly files is either .s (no C pre-processing) or .S (with C pre-processing).  Using these makes things a bit easier, e.g.

bfin-uclinux-gcc main.S -c

 

Stu


Viewing all articles
Browse latest Browse all 36216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>