delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/19/15:34:05

Message-Id: <199807191932.UAA12532@sable.ox.ac.uk>
Comments: Authenticated sender is <mert0407 AT sable DOT ox DOT ac DOT uk>
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: Jonathan Villani <jonathan DOT villani AT videotron DOT ca>
Date: Sun, 19 Jul 1998 20:32:09 +0000
MIME-Version: 1.0
Subject: Re: DJGPP & asm
Reply-to: george DOT foot AT merton DOT oxford DOT ac DOT uk
CC: djgpp AT delorie DOT com

On 18 Jul 98 at 19:03, Jonathan Villani wrote:

> Hi! I would like to know what is the parameter or switch to produce my code
> (DJGPP) in an asm version?

To tell the compiler to produce assembly language output, pass the 
`-S' switch (note that it's a capital letter):

    gcc -S foo.c

produces a file `foo.s' containing the assembly language output of 
the compiler.

To assemble and link assembly language code you just pass it as if it 
were C source code:

    gcc -c foo.s

would assemble `foo.s' to produce `foo.o', while:

    gcc -o foo.exe foo.s

would assemble `foo.s' and link it to produce an executabe file, 
`foo.exe'.

You probably normally want to use a capital S in the extension of 
assembly language source code, i.e.:

    gcc -o foo.exe foo.S

That causes it to be preprocessed before being passed to the 
assembler, which means you can use preprocessor directives like 
#include, #define, etc, and also comments (/*...*/ or //...eol) in 
your assembly language source code.

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019