Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Quick MASM Prompt Setup Question

Started by Undefined_Behavior, September 12, 2013, 01:31:29 PM

Previous topic - Next topic


Thank you for the info dedndave.

So basically:

COFF object modules are for 32-bit portable executables
OMF   object modules are for 16-bit DOS executables.

/SUBSYSTEM:[Insert CONSOLE or WINDOWS here] is a required linker option.

So from this I can see that for both 32 or 16 bit options I'm going to have to specify lib files which renders the default ml command worthless. Also it would seem that link.exe really does not have a /z2 switch, so I don't understand why the switch is invoked with the default call to the ml.exe command. In this case I don't understand two more (perhaps unimportant) things: the linking options supplied with link.exe and the purpose of the default ml.exe command (with no options).


Quote/SUBSYSTEM:[Insert CONSOLE or WINDOWS here] is a required linker option.

in the strictest sense, this is not the case

if main or wmain are defined symbols, CONSOLE is the default
if WinMain or wWinMain are defined symbols, WINDOWS is the default
well - these are compiler-flavoured symbols, really - lol
in ASM, we don't always create those symbols, so it's best to specify the type on the command line

if you have a 16-bit linker named as link.exe, you might be able to use the default command line, but only to build 16-bit apps

i suspect the /z2 switch is related to that
/z??? switches are typically used for some sort of debug symbol information
or, perhaps, a listing feature

ml.exe (used to be masm.exe) and link.exe have evolved over time
the default command line may have been valid in the days of DOS
and, ms has tried to provide some level of backward compatibility with each version
so - they are hesitant to modify the default behaviour, to some extent

use batch files
they save you a lot of typing, anyways

a while back, i wrote a "super-duper" bild.bat file   :P


Quote from: Undefined_Behavior on September 13, 2013, 05:38:22 AMpurpose of the default ml.exe command (with no options).

No options won't work, but

bin\ml /coff irvinemasm32.asm

assembles and links perfectly with ML 6.14 or 6.15, provided (as Dave rightly wrote) that you implicitly declare the subsystem by using main:
end main


Thanks for all that info you guys. You all rock.