Hi All,
I just started playing with MASM but one thing is bugging me:
How do I get a listing, that I can print, of the assembler code together with the corresponding compiled and linked hex machine code?
I can get somewhere near by dis-assembling the resultant .exe file, but obviously no comments or other assembler text.
Pointer would be appreciated.
if you assemble with the /Fl (lower case L) switch, it will generate a listing
however, there are a few options to control what goes into the listing - mostly starting with the letter S
for a complete list of switches....
ML /?
Thanks for that, I have been trying to drive things from the MASM GUI, I see no way to accomplish that from GUI so I guess I must drop down to console.
I found ML.exe and then the MASM help, I seem to be missing some general tutorial about using the system, can you point me anywhere? I see no way of setting some 'options' that would assemble the listing from the GUI menu.
The GUI Help seems to focus on specific points, i.e. the trees rather than the wood!
Any extra help appreciated.
if you are refering to QEditor, i believe it uses the batch files that reside in the \masm32\bin folder:
build.bat is for GUI apps
buildc.bat is for console apps
you should be able to modify those :U
Thanks, I'll take a look at that.
You can put this in your Qeditor menu to generate a listing file.
&Listing_Build,\MASM32\BIN\listing.bat "{b}"
-----------------------------------------------------------------
And put this in \masm32\bin
:: Listing.bat
@echo off
if exist %1.obj del %1.obj
if exist %1.exe del %1.exe
@echo %1
\masm32\bin\ml /Fl /c /coff %1.asm
if errorlevel 1 goto errasm
if not exist rsrc.obj goto nores
\masm32\bin\Link /SUBSYSTEM:WINDOWS /OPT:NOREF %1.obj rsrc.obj
if errorlevel 1 goto errlink
dir "1.*
goto TheEnd
:nores
\masm32\bin\Link /SUBSYSTEM:WINDOWS /OPT:NOREF %1.obj
if errorlevel 1 goto errlink
dir %1.*
goto TheEnd
:errlink
echo _
echo Link error
goto TheEnd
:errasm
echo _
echo Assembly Error
goto TheEnd
:TheEnd
pause
Thanks a lot, will try later.
I'm not initially sure what the process is. "put this in your Qeditor menu", how do I do that?
It appears I need to generate a listing.bat file that gets triggered from a new menu entry.
As I said to dedndave, I seem to missing some help document here. Help seems to focus on the trees rather than the wood.
Throw me a bone..
Magnum,
I figured it out, read the QEditor help. I need to make a more structured effort to understand these bits and pieces.