News:

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

Main Menu

Invoke link separately or allow ml to do it.

Started by Oliver Scantleberry, July 21, 2015, 07:59:10 AM

Previous topic - Next topic

Oliver Scantleberry

I haven't done any assembly work in several years. I have several batch files for the purpose of assembling and linking programs. All of them  assemble the file then, in a separate line, invoke the link program. Is there any reason not to allow the ml (assembler) do it? I use macro assembler version 10 and 11 depending on whether I'm in my Irvine directory or the MASM32 directory.

Thanks for any info. I'm new on the forum, by the way.

jj2007

Hi Oliver,

Main reason for separating assembling and linking is flexibility for the latter. You can link together object modules and resources etc if you do it separately.

Welcome to the forum :icon14:


rrr314159

hi Oliver, and welcome,

jj2007's right, as usual. Having said that go ahead and use ml's link option if you want, as long as it works for you (i.e. as long as you only have one file and are content with ml assembler and linker, as opposed to alternatives such as H/JWasm or Pelle's linker). BTW I use batch files myself, instead of the menus or an IDE - it's very flexible and just as easy once you get used to it. Keep at it, good luck, and may all your bugs be easy to find and fix ...
I am NaN ;)

hutch--

Hi Oliver,

welcome on board. The 32 bit versions of ML are best used to create object modules which can be linked into EXE, DLL or a collection that can be made into a library. It gives you the choice of which linker you want and more flexible options when running the linker.

Oliver Scantleberry

Thanks, Hutch.

So you also think a separate line to invoke the linker is better?

hutch--

It certainly is. The combined assemble and link is a left over of a simpler era of 16 bit DOS programming. Once you are used to it you will assemble object modules with ML.EXE, compile resource modules with RC.EXE and then link them all together with LINK.EXE.

Gunther

Hi Oliver,

I think your question is answered by Jochen and Hutch. Welcome to the forum.

Gunther
You have to know the facts before you can distort them.

Oliver Scantleberry

hutch, rc.exe and resource modules are brand new to me. Where do I find out more about these resource thing?. How to use them and why I would want to.

dedndave

microsoft's page - notice further reading at links in left pane

https://msdn.microsoft.com/en-us/library/windows/desktop/aa381042%28v=vs.85%29.aspx

also, there is a help file in the masm32\bin folder, rc.hlp

resource files allow you to add several types of data to the executable
including dialogs, accelerators, menus, etc

you can also add data like icons, images, sound files, fonts, and so on
the contents you add will be added to the executable

another important feature is the ability to add a manifest, in the form of an XML file

hutch--

Oliver,

There is some advantage in using separate resource scripts, you can use dialog editors to create dialog templates, set a manifest that matters in later OS versions from Vista upwards, set a version control block so that the OS can identify the executable and you can also use a separate image editor to do bitmaps and icons.

This is of course mainly for UI style apps that use a Window but some of this does not apply to a console app.

Oliver Scantleberry

Thanks guys. I only do console apps but some of it may be helpful. Who knows?

xanatose

Quote from: rrr314159 on July 21, 2015, 08:59:57 AM
good luck, and may all your bugs be easy to find and fix ...

Amen to that.

This will make for a good saying on a coffee cup.