I got a set of C++ files in Microsoft Visual C++ 6.0 where I need to dump an assembler listing, process those asm files with my own tool and reassemble them.

Using the /FAs switch for cl.exe I can generate *.asm files for each output object (*.obj) the compiler generates. Then I assumed it was possible to use masm to reassemble those output files into objects again with: ml /c /coff gui.asm

This works in some cases however other times the assembler code generated masm won't reassemble anymore and gives all kind of errors.

From a example MFC program I get errors like the following:

gui.asm(1752) : fatal error A1010: unmatched block nesting : ?InitInstance@CGuiApp@@UAEHXZ

I could ofcourse go write a tool which fixes all these problems but I'd like to know if others have tried this and/or know a solution how to make cl.exe and ml.exe work together. For the tests I used Masm 6.14 but a guy told me he got same problems with Visual Studio .NET and Masm 7.0x.
Maybe there exists other assemblers which are capable of reading masm syntax and can output coff object files.

Thanks in advance.

// CyberHeg
Posted on 2003-02-19 13:50:27 by CyberHeg