delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/29/13:01:28

Message-ID: <38BBDCDA.7CA5C1CE@cyberoptics.com>
From: Eric Rudd <rudd AT cyberoptics DOT com>
Organization: CyberOptics
X-Mailer: Mozilla 4.08 [en] (Win95; U)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Combined C/asm listing (was Re: Fastest bitblt?)
References: <Pine DOT LNX DOT 4 DOT 10 DOT 10002270616350 DOT 904-100000 AT darkstar DOT grendel DOT net>
Lines: 27
Date: Tue, 29 Feb 2000 08:51:07 -0600
NNTP-Posting-Host: 38.196.93.9
X-Trace: client 951835867 38.196.93.9 (Tue, 29 Feb 2000 09:51:07 EST)
NNTP-Posting-Date: Tue, 29 Feb 2000 09:51:07 EST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Kalum Somaratna aka Grendel wrote:

> 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'.

I read this posting with interest, because I have often wanted an assembly output
listing similar to what Borland produces with the -S option, with each C
statement interleaved with the assembler code it generates.  Unfortunately, the
above options do not do this, as was claimed -- I only get assembler, binary, and
cross references; no C source.  Is it possible to get interleaved C and assembly
output?

I have actually managed to do this, but only by the tedious procedure of
modifying the source to look like this:

a = 3; asm("#a = 3;);
b = a; asm("#b = a;);

etc.  There must be a better way.

-Eric Rudd
rudd AT cyberoptics DOT com

- Raw text -


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