Re: Assembling Visual Studio generated listing files

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



No, there is no reason for the compiler to "generate assembly code" (as in the text of
assembly code) internally. It doesn't. Very few compilers in history ever did. I only
know of two: the Bliss-11 compiler we did at CMU (because there were so many PDP-11 object
formats we couldn't generate all of the required ones, but the assembly code was the same
on all machines) and the original PDP-11 C compiler from Bell Labs. I'm sure there are
more, but we think of them as unusual compilers, not the typical way a compiler works.
Most compilers work by generating an object file; any assembly code listing is considered
to be "documentation" rather than "functional"; I hadn't even realized they were
compilable, but it would never have occurred to me that editing the generated assembly
code could make sense. The only system I knew that ever did this was the horrendous
kludge that built the PDP-11 Unix kernel, and even in 1975 we considered this to be a
really stupid idea. Not just a little bit stupid; truly outrageously stupid. It turns
out that when the compiler changed, the sed script broke and it took massive effort to
rewrite it to handle the new compiler output, which had slightly different register
assignments.

Key question: why do you need to edit the assembly code? If you explain the problem,
there is probably a better answer. You are asking how to implement a particular solution,
rather than asking how to solve a problem.
joe

On Fri, 7 Dec 2007 10:29:43 -0800 (PST), TahoeKid <rfdunn@xxxxxxxxxxx> wrote:

I found a knowledge base snippet from Microsoft and they claim not to
support assembling of the listing files.
I wonder how the compiler itself works internally. It seems to me it
needs to generate assembler internally,
so it should not be all that much effort for them to generate a 100%
compatible assembler file that can output
an exact oubinary.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Datatype misalignment exception....
    ... the compiler generates 4 access in memory that read one byte ... and r3) so the access doesn't rise exception because it is byte aligned. ... Bruce.Eitman AT Eurotech DOT com ... the BYTE array is the same...so you said that the assembly code generated ...
    (microsoft.public.windowsce.platbuilder)
  • Re: What micros do you actually like to work with?
    ... I really like ARM chips. ... I also like the 68K architecture which IMHO ... The MSP430 on the other hand has a GNU compiler collection compiler ... makes for easy and readable assembly code. ...
    (comp.arch.embedded)
  • Re: Poor performance of implied-DO loop with Intel Fortran
    ... Obviously v8.0 of the Intel compiler scales fine, ... makes me think I will continue to use this idiom with an eye to any ... > way to fill large arrays. ... > the generated assembly code, ...
    (comp.lang.fortran)
  • Re: Assembly code with Borlands C compiler
    ... Assembly code with Borland's C compiler ... Function should return a value in function pooi ...
    (comp.arch.embedded)
  • Re: Assembly code with Borlands C compiler
    ... Assembly code with Borland's C compiler ... The segment names are a guess for the most part - taken from masm6's ... Function should return a value in function pooi ...
    (comp.arch.embedded)