News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

VC++ /FA and masm

Started by jjkimball, February 06, 2006, 05:52:24 PM

Previous topic - Next topic

jjkimball

I've learned that if I give Visual C++ the /FA option I can get it to spit out assembly language. Cool...

I'd like to MASM that assembly language, after making some mods to it.  First step is to verify that I get the same results by feeding the untouched .asm to ml.exe, that I would get by compiling directly.

My first stab is to do "ml.exe /c /coff foo.asm".  When I compare the result to what the compiler spits out directly, I find the opcodes are the same but some of the sectioning and the way that external references are represented appears different.

I'm guessing I need to give masm some options to get it to duplicate the behavior of the compiler.  Does anyone know what those would be?

Thanks...

hutch--

jjkimball,

You are blessed that they don't do the same thing. A VC assembler listing is rather scruffy as its produced and needs to be cleaned up a lot to make it readable. Depending on what version of CL you are using and how you have set the optimisation options, if tyou have full optimisation turned on, the resulting code is both hard to read and almost impossible to successfully modify.

If you really want to be ale to manually optimise a C algo, build the module with ALL of the optimisation turned off. This will give you a bloated and slow result but it has this advantage, it has enough registers for you to work on it. If there is one thing that will make you good at optimising assembler, its working on unoptimised C listings from a C compiler and on the way you learn a lot about what matters and what does not.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php