delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/26/19:45:23

Date: Sun, 27 Feb 2000 06:35:55 +0600 (LKT)
From: Kalum Somaratna aka Grendel <kalum AT crosswinds DOT net>
X-Sender: root AT darkstar DOT grendel DOT net
To: djgpp AT delorie DOT com
cc: trancelucid AT videotron DOT ca
Subject: Re: Fastest bitblt?
In-Reply-To: <38B82EB8.95549264@videotron.ca>
Message-ID: <Pine.LNX.4.10.10002270616350.904-100000@darkstar.grendel.net>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 26 Feb 2000, Trancelucid wrote:

> 
> > There is a switch to get GCC to show its assembler opcodes.  Browse
> > the GCC manual:
> >   C:\>info gcc
> 
> Would you know what the switch is? I did a search for both "assembler"
> and "opcode", as well as browse through the menus, but could'nt find
> anything :(

Well the DJGPP FAQ has all you need in section 8.20. ususally the -S
switch is what you need. Anyway heres the relevant section of the FAQ
since it is very small.


*A*: Use the `-S' (note: _capital_ S) switch to GCC, and it will emit the
assembly code to a file with a `.s' extension.  For example, the following
command:

       gcc -O2 -S -c foo.c

will leave the generated assembly code on the file `foo.s'.

If you want to see the C code together with the assembly it was converted to,
use a command line like this:

      gcc -c -Wa,-a,-ad [other GCC options] foo.c > foo.lst

which will output the combined C/assembly listing to the file `foo.lst'.

If you need to both get the assembly code _and_ to compile/link the program,
you can either give the `-save-temps' option to GCC (which will leave all the
temporary files including the `.s' file in the current directory), or use the
`-Wa,aln=foo.s' option which instructs the assembler to output the assembly
translation of the C code (together with the hex machine code and some
additional info) to the file named after the `='.

Hope this helps,
Grendel

Hi, I'm a signature virus. plz set me as your signature and help me spread
:)

- Raw text -


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