News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MASM Documentation

Started by PeterRod, September 24, 2008, 04:53:49 PM

Previous topic - Next topic

PeterRod

Hi All,

I am very new to MASM.

I am using MASM with VS2005 std ed.

From VS2005 I have
ml.exe v 8.00 50727.42     and  Link.exe   v 8.00 i50727.42
also
from the MASM32 download I have
ml.exe v ??  and link.exe v 5.12 8078

I am using ''Programmers Guide' - MASM v 6.1 - 1992 and 'Reference Guide' - MASM v 6.1 - 1992 along with other texts.
These two documents ,although 1992 and 16 bit based, still provide valuable information.

Q1:
Is there any documentation on MASM v 8.00 from Microsoft. My Google search didnot show any?
The Help files from the MASM32 download certainly do cover some of the features of MASM v 8.0
I was hoping for a more complete document something like a refernce or programmers manual.

Q2:
Also as far as MASM on VS2005 has anyone done an assembly language project template for VS2005?
Presently my workaround is to use an empty c/c++ project configured for MASM.
Although this works, it does not expose the full potential of VS2005 and MASM.
Is there another way to use MASM in VS2005?

Q3:
What is the latest version of ml / link currently available from Microsoft?
Is it still v8.0 I thought I saw a reference to v10 somewhere but I may be mistaken.

Thanks
Peter

Mark Jones

Hello,

Quote from: PeterRod on September 24, 2008, 04:53:49 PM
Q1: Is there any documentation on MASM v8.00 from Microsoft?

A: Nope, sorry. The docs you have cover almost everything in MASM v8.0 already. Ghirai's website has a lot of other useful files for MASM and the MASM32 package however, viewable here. Several of those helpfiles are absolutely indespensible when writing 32-bit Windows code in assembler.

Quote
Q2: Is there another way to use MASM in VS2005?

Personally I'm not the one to ask about VC specifics but wanted to mention that I believe most people who use MASM to write more than a few lines of code, do so outside of VC. For example, if a developer is trying to speed up a calculation routine in a large C project and decides the only way to do this is to write the whole routine in assembler, then they would typically develop a .DLL coded in assembler, then import that into their C project. This bypasses any limitations VC puts on the assembly/linking/building process, and allows unrestricted development of the critical code.

The MASM32 package contains everything needed to write quality .DLLs without the need for VS or VC at all.

Quote
Q3: What is the latest version of ml / link currently available from Microsoft?

A: The latest version of ML.EXE is v9.0 coming with the VS 9.0 SP1 and the 2008 Express Edition SP1. The v10 that you have been hearing is probably in reference to MASM32 v10, which was a recent release of the MASM32 project, which is still using the ML.EXE v6.4.8444. (Sorry, yes it can be confusing...) :bg

Bottom line is, unless there is some specific reason why you must upgrade versions of ML.EXE, usually the hassle is not worth the gain. Very little has changed even from the ML.EXE included in the MASM32 package (version 6.14.8444), however, some things have actually been removed in the newer versions. The newer versions of ML.EXE and LINK.EXE also seem to produce larger executables. But on the other hand, in one case here a poster was complaining that code built with the MASM32 project (and was hence smaller) would incorrectly trigger his anti-virus heurstic scanner, while the same code bulit with a newer version of ML and LINK (and thus more bloated) would not. The ironic thing is, that both executables were valid PE files.

Sorry for not providing a definite answer, but I feel this is a rather gray area for most developers. You could also try looking through the Compiler-Based Assembler sub-forum here, there are lots of VS-related posts there.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

jj2007

Quote from: Mark Jones on September 24, 2008, 08:32:53 PM
The newer versions of ML.EXE and LINK.EXE also seem to produce larger executables.

I have been using ml v9 for some time, no problems found. My biggest source has 8,000 lines and produces identical code in both versions. Below two simple batch files for comparing the versions (you need to create/rename the copy source files, of course).

makev6.bat:
copy mlv614.exe ml.exe
copy linkv614.exe link.exe


makev9.bat:
copy mlv9.exe ml.exe
copy linkv9.exe link.exe


Rainstorm

mark wrote...
QuoteVery little has changed even from the ML.EXE included in the MASM32 package (version 6.14.8444), however, some things have actually been removed in the newer versions.
what are the things that have been removed ?

t y

PBrennick

RainStorm,
Because of the lack of documentation, the answer to your question is something that we will accidentally discover over time. One thing is certain, they want to do away with a lot of the high-level stuff, macro support and what not. I think their goal is to create an assembler that becomes a tool of the VC Compiler instead of an independant developers tool.

Personally, I would not recommend anyone use any version of ml.exe after 6.15. 7.0 was the beginning of a different concept for ml.exe and a lot of it has to do with the changing of the guard at MS. Hutch uses a patched version of 6.14 that does the job very well. I use 6.15 in my package because I was forced to by the limittations imposed upon me. I 'do' like 6.15, though and have always believed that it is just a name for patched 6.14 any how.

Of course, if you use SSE3 type instructions, then you must use a newer assembler.

-- Paul
The GeneSys Project is available from:
The Repository or My crappy website

Vortex

jj2007,

Your source code of 8000 lines inspired me an interesting idea. One can code a tool creating synthetic files to test different versions of ml.exe and Masm compatible assemblers.

FORTRANS

Hi Paul,

   Aren't there macro packages to support the instructions the
assembler doesn't?  I remember that one of the optimization
sites had them?

Regards,

Steve N.

Mark Jones

Quote from: Rainstorm on September 25, 2008, 11:58:49 AM
what are the things that have been removed ?

Hello, there was talk of ML.EXE v8.00 no longer supporting conditional assembly (.if, .else, etc.) when it was in beta. Searching now, I can not find any relative posts here about it. Did they keep the conditional processing on both 32 and 64-bit code?

Also, see:
http://www.masm32.com/board/index.php?topic=4974.0
http://www.masm32.com/board/index.php?topic=4180.msg31448#msg31448
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

jj2007

Quote from: Mark Jones on September 25, 2008, 09:09:44 PM
Hello, there was talk of ML.EXE v8.00 no longer supporting conditional assembly (.if, .else, etc.) when it was in beta. Searching now, I can not find any relative posts here about it. Did they keep the conditional processing on both 32 and 64-bit code?

Conditional assembly (.if, .else, etc.) works fine in ml 9.0; same for macros and high level constructs. Any insider here who can give us a rough estimate how many Gigabytes of Microsoft-internal code would be broken if they had removed that?

GregL

QuoteDid they keep the conditional processing on both 32 and 64-bit code?

It's only ml64.exe that is missing a few directives, like PROTO and INVOKE. ml.exe version 8.00 isn't missing anything.

New MASM Features (version 8.00)

IMO version 9.00 is an improvement on version 8.0, not much new, but bugs were fixed.


hutch--

hmmmmm,

The /ALIAS directive looks very useful.

I agree with the comments on version 9.0, a number of bugs fixed and it appears to work well.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

BlackVortex

My killer combo is jwasm as ml.exe and polink as link.exe


Mark Jones

The only problem with using Polink if that it can't spit out .PDB data, which OllyDbg can use to show the sourcecode while debugging. Other than that, I agree that Polink is a better linker. It consistently produces smaller executables than ms link. GoAsm's linker is really nice also, since you can specify a response file on the command-line which contains the name of every import .DLL, and then omit defining imports or prototypes in the code. You can even call procedures in specific .DLLs without prototyping them like: INVOKE SQLITE3.DLL:sqlite_exec,blah,blah...
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

PeterRod

Thanks for all the replies.
If I could keep the discussion more central to the OP.

As a new user, interested in staying within the Microsoft world, the following have become clear to me.

Microsoft is committed to MASM long term as evidenced by ml v8 , ml v9 and ml64.exe
Presently my horizons are 32 bit based with ml / link.

Microsoft is definitely committed to VS2005/8 as their IDE of choice.
My personal opinion is that VisualStudio 2005/8 is an excellent IDE and can only improve with time.

It is also clear to me that Microsoft :

Will not expose MASM directly in VS2005/8
There seems to be confusion about inline assembly in c/c++ code and actually using VS2005 to code MASM projects.
A few days ago I discovered a workaround to be able to use VS2005 to edit/debug/assemble(mlv8)/linkv8 and run .asm source.
My first program is already 1000 lines. This is quite different to a few lines of asm code in a c++ program.
I also discovered yesterday that someone wrote a tutorial on the exact workaround that I used.

Also Microsoft will no longer produce documentation directly on MASM.
Presently there is a Microsoft Reference of sorts buried within Visual Studio 2005/c++/MASM
and a similar Reference in VS2008/c++/MASM

I am offering two suggestions for other users to comment on:
The first:
That the Hutch Project Team continue their excellent work by developing a MASM project template for Visual Studio with the help and support of users of this forum.
Properly done such a template would expose MASM as a sixth choice in the VS IDE. (presently VB.net , VC#,J#,C++,JScript)
Users could simply download the proposed template and copy into the correct VS folder.
Template development would require detailed knowledge of XML / MASM and Visual Studio.

The second suggestion :
That this forum produce a single document entitled 'Known Differences between MASMv6  and MASMv8'
which would essentially cover the transition from 16 bit to 32 bit technology.
Possibly another document 'Known Differences between MASMv8 and MASMv9' could be produced later.
At this time, I am sure that all the differences between v6 and v8 are known to many forum members.

These are just suggestions from a keen new user and I would be interested in reading comments from the more experienced community.
BTW let me be the first to offer my help in any way needed to implement either of these suggestions

Regards
PeterRod