The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: dansol77 on March 25, 2006, 05:08:00 PM

Title: How can i make use of linker and executable file under MASM32
Post by: dansol77 on March 25, 2006, 05:08:00 PM
I have been trying to create or make .OBJ file after having my .asm file including how to link it.Please can somebody throw more light on this issue.
Title: Re: How can i make use of linker and executable file under MASM32
Post by: Mark Jones on March 25, 2006, 08:10:10 PM
Hello Dansol77. What exactly are you trying to do again? Assemble one .ASM file but include a second .OBJ file at link-time?
Title: Re: How can i make use of linker and executable file under MASM32
Post by: ChrisLeslie on March 25, 2006, 09:57:26 PM
Hi Dansol77

The BIN folder has two important .exe's. ML.exe will assemble your source file and produce a .obj file, and LINK.exe will take the .obj file and produce a Windows .exe for your application. You can run these two steps manually every time you wish to assemble some of your code, providing that you set the appropriate options.

An easier way is to use a batch file that does the assemble and link stage in one hit, with options aleady set. If you look in the BIN folder you will find several batch files to choose from. You can use the batch files as models to create your own if you desire.

An easier way still is to use QEDITOR as a kind of IDE. It has menu options that immediately call up one of several batch files and conveniently produces and output for you. Any dumbcluck can do that!
I hope that that has cleared up that problem for you.

Chris
Title: Re: How can i make use of linker and executable file under MASM32
Post by: Vortex on March 26, 2006, 07:43:38 AM
ml /c /coff sourcecode.asm
link /SUBSYSTEM:WINDOWS sourcecode.obj

or if it's a console application :

link /SUBSYSTEM:CONSOLE sourcecode.obj
Title: Re: How can i make use of linker and executable file under MASM32
Post by: PBrennick on March 26, 2006, 08:07:36 PM
\masm32\bin\ml.exe /c /coff yourfile.asm
\masm32\bin\link.exe /SUBSYSTEM:WINDOWS yourfile.obj


or if it is a console application:
\masm32\bin\link.exe /SUBSYSTEM:CONSOLE yourfile.obj

pAUL