This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: macro on assembler


On Wed, 7 Oct 1998, John Breen wrote:

> From: Dony <dony@willowglen.com.sg>
> >I found in 'asm.h' and 'crt0.s' some C preprocessor directives, 
> >like #define, #include, #if ....
> >Hmm ... sounds to me that such kind of directives don't exist in GAS.
> 
> Are you sure these weren't crt0.S (capital "S")?  I've never used it, 
> but I remembered seeing the following in the gcc man page:
> 
>       .s    Assembler source; assemble
>       .S    Assembler source; preprocess, assemble
> 
> So apparently .S files will be run through the preprocessor first, 
> whereas .s files will go straight to GAS.

That's correct.  I use .S files pretty much exclusively;  by doing so
I can use preprocessor macros, conditional assembly, C-style comments,
header files, and the like.  I have never bothered with gasp because
this works very well and is quite painless.  Such files are
processed with the gcc driver via a command like

  gcc -c file.S

and not with gas directly.

Mike
--
C. M. Heard/VVNET, Inc.
heard@vvnet.com

________________________________________________
To get help for the crossgcc list, send mail to
crossgcc-request@cygnus.com with the text 'help'
(without the quotes) in the body of the message.