Mail Archives: djgpp/1998/07/19/15:34:05
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 -