PC Assembly Programming
|
![]() |
It's been some time since I last updated this web site.
Meanwhile, I've created a new PC Tools page, which is a
part of an entirely new set of web pages in a subdirectory of this same site. Until I get
it integrated with this one, anyway. That new page links to other much improved pages, as
well. Or you can also just start out at My
New Home. I've had a number of broken links on these pages -- I hope things are a little better, now. I'm also including a new link to the MASM32 site, as that site includes Microsoft's ML 6.14 in its ZIP file and, so long as Microsoft appears to permit that, it's a perfectly good site to use. Back in late 2001, I also received an email from Terry Leeper at Microsoft who, at the time, identified himself as the Program Manager for Visual C++ at Microsoft. I'm including a link to those email conversations between us, here. |
I've been using PC assembler programming since IBM's first version of the assembler, in 1984, and Microsoft's own branded version since it was released somewhat later.
Free is a very good price and Microsoft's assembler has been the tool of choice since the earliest PC days. There are plenty of source code files available and most of the good ones will have at least one version designed to work with Microsoft's assembler tool.
Microsoft provides its professional assembler tool (ML and components) in a rather complicated way. You pick up the assembler itself from one file and then get the linker from another file. You may want to pick up the latest patches to the assembler from still another file. Worse, you may need to either get a setup program to help you access the assembler in the file it comes in or else you will have to handle some arcane details to do it manually. In short, it might help to have a guide. The guide I'd included here had broken links, but I hope I've managed to repair the important ones, now. I hope this helps.
I discuss the following tools, but this is a quick, one-stop shop for getting the pieces:
Program File |
Version |
Full/Patch |
Location |
MS Article |
---|---|---|---|---|
ML.EXE |
6.12 |
Patch |
ML612.EXE | I'm not aware of any articles on 6.12 |
ML.ERR |
||||
ML.EXE |
6.14 |
Patch |
ML614.EXE | Q228454 |
ML.ERR |
||||
H2INC.EXE |
6.12a |
Full |
||
H2INC.ERR |
||||
ML.EXE |
6.15 |
Full |
VCPP.EXE
service pack 4 VCPP5.EXE
|
Visual C++ 6.0 Processor Pack Download Page |
ML.ERR |
||||
H2INC.EXE |
6.12a |
Full |
||
H2INC.ERR |
||||
LINK.EXE |
5.60 |
Full |
LNK563.EXE | Q127151
(not available anymore) |
NMAKE.EXE |
1.50 |
Full |
NMAKE15.EXE | Q132084 |
NMAKE.ERR |
||||
ML.* |
6.14 |
Full |
MASM32 | non-MS site |
(If you need the setup program for extracting ML.EXE and ML.ERR from their cabinet file, I provide a link later on and not above.)
![]() |
If you are looking for an assembler which will work under
MS-DOS, without Windows, I believe the last version that will do this is 6.11d. And even
then, not without DOSXNT.EXE, if memory serves. I think the latest version that will run
without an extender under DOS is 6.11a (or b, perhaps.) (My memory fades about 6.11c, but
Microsoft provided it under circumstances which made them not want the 6.11d update to
work on it -- I think it may have been part of a free DDK they offered.) I used to have a Microsoft link to a full installation copy of that version, 6.11d, but Microsoft (perhaps in part because of this page linking to it) has since decided to break that link and I've not found a replacement for it. |
Full versions of ML.EXE and ML.ERR, version 6.15, are available from the Visual C++ 6.0 Processor Pack Download Page mentioned in the above table. However, both service packs are EXEs that look for the VC++ 6.0 compiler installation and associated service pack level.
Luckily, they self-extract first. Unluckily, if you hit OK to each of the error messages that appear during the failed attempt to install, they delete all of the self-extracted files before exiting.
If you don't already have VC++ 6.0 from Microsoft available, you can still pick up the files by waiting until the first error message pops up. Then, don't OK it yet, but drop into DOS or use your Explorer or other file management tool to copy the ML.EXE and ML.ERR files out of the temporary directory it creates to somewhere (anywhere) else. If you don't know where that temporary directory is, it is usually the TEMP directory underneath your WINDOWS directory. It might also be found by looking at your DOS's SET variables (just enter SET at the DOS prompt and hit ENTER, to see them) and looking for what is assigned to TEMP.
I know, it's somewhat tricky to extract. An alternative I'm told may work is to use WinZip. As I don't have or use it, nor will I install it, I can't directly verify this.
![]() |
It's possible that you may need a file called DOSXNT.EXE,
which is Microsoft's DOS extender, if you are running under Windows 3.1. If so, I have not
found a location yet from which you can download it. (I don't have a system ready with
Windows 3.1, so I'm not sure.) I've tested the use of both versions of ML, namely the original 6.11d version as well as the patched 6.13 and 6.14 versions (see below), under Windows 98 with satisfactory results. For some general information on their extender technology, I used to recommend going to: Article on Microsoft DOS Extenders But the link is broken now and I don't know about a replacement for it. |
Microsoft offers their segmented linker, which works well with ML, as a update for their tools.
There used to be a Microsoft web page that discussed their segmented linker, at: Microsoft Support's Page on LNK563. But, once again, the link is broken now and I don't know about a replacement for it.
In any case, you can still go and directly get the file at: LNK563.EXE
Run the self-extracting file to get LINK.EXE (and a couple of other things.)
With these three files available, ML.EXE, ML.ERR, and LINK.EXE, you should be able to assemble and link various assembly programs. Most of what's still missing from the packaged versions of the Microsoft Assembler are the samples and the various include files that are sometimes used. There's also a converter that translates C's *.h include files into MASM's *.inc form of them, called H2INC.EXE and H2INC.ERR, but you can get these in the patch update, discussed later on this page, or in the new 6.15 distribution. The versions of H2INC in the 6.14 patch update and in the 6.15 VC++ 6.0 update kits are the same.
I don't know the legalilties of providing my copies of any of these, which is why I've tried to be very careful in pointing you to Microsoft's own web pages. Certainly, they know better what they are doing in making them available than I do.
I've included a link to the MASM32 web site, which carries a lot of useful material. But it also includes ML 6.14, which is an important resource. If I find a source for any more of the MASM tool components, I'll be sure and include them here. The existing files I've just mentioned are sufficient to learn to program in assembly language using the better available tools.
There's one more thing to mention, just now. Microsoft has also provided an update to their earlier assembler. The one I described above is called version 6.11d, I believe, and it should work okay under Windows 3.1 or just regular DOS. The 6.14 patch converts this program to version 6.14 and includes some newer Intel MMX and AMD K6/3D instructions. However, since this isn't the latest anymore, you might prefer to just get version 6.15 directly, as already mentioned. Still, if you insist, here's a few notes about the 6.14 update and the 6.15 full tool.
If you patch your 6.11d version to 6.13 or 6.14, or if you load up the version 6.15 assembler, it will no longer run on straight DOS or Windows 3.1. It becomes a console 32 application and requires Windows 95, Windows 98, or Windows NT in order to run on the DOS box. That's life in the big city.
Get the patch here: 6.14 patch for 6.11a/d, 6.12, and 6.13
Or read about the patch here: 6.14 patch available
These are self-extracting file, which expands out a series of files when you run it. Included in the list of files is PATCH.EXE, which is the program that will patch your copy of ML.EXE and ML.ERR, if they are either version 6.11a or 6.11d. If you've placed your copy of ML in the same directory, just run the patch program to update it.
An interesting side effect of this patch program is that you also get copies of H2INC.EXE and H2INC.ERR, which are used to convert C's .h include files into a MASM-compatible form. Microsoft has actually used this program to convert their windows.h file into a MASM include file called win.inc. (They made some hand changes afterwards, but suggested that they aren't really necessary.) However, the patches contain the hand-adjusted version already, so just use that.
By the way, for those interested in patching an older version of Microsoft's MASM than 6.11/a/d, 6.12, or 6.13 (which is all that the v6.14 patch handles, I believe), there are a couple of earlier patches available. Try these:
6.11d patch
for 6.11/a
6.12
patch for 6.11a/d
6.13 patch for
6.11a/d
Microsoft has another somewhat useful tool, NMAKE. This program is used to help automate the program building process. (Unix programmers familiar with a real MAKE program are allowed to laugh their brains out at this point.) If you already know about it or have some project files that depend on it, but need a copy, here's where:
It's another self-extracting file, that includes NMAKE.EXE and NMAKE.ERR.
For a while, IBM's and Microsoft's assemblers were the only assembler tools around. Quite a body of source code and experience was built up over time and the MASM tool has continued, if only sporadically, to be updated for the newer processors.
Admittedly, there are several serious alternate assemblers you might want to use, these days. NASM is a serious effort at providing a freely available assembler tool and was under active update efforts until a year or two ago. Appearances are that the effort is far less intense, now. Also, the GNU tools provide their own quite serious assembler, as well.
The problem I have with both of these efforts, and it's no reflection on the folks who have done a magnificent job in meeting their development goals for these products, is that they are quite simply entirely incompatible with a vast expanse of source code, linker tools, and documentation that already exist. If it weren't for the possibility of getting Microsoft's Assembler tools free now, I'd recommend them. But with Microsoft not only giving it away in the past, but showing even today a continued willingness to do so (although with some complexity), I'd tend to recommend getting Microsoft's tools unless you have a particular requirement it cannot meet.
MASM is now the standard for DOS-based and real-mode assembly programming and is now also used under Win95, Win98, and WinNT for protected-mode, flat model programming.
Microsoft doesn't make it easy, of course, but it is surprising to me that they have made this much available at no charge. Whether it's by accident or not, I'm grateful that they've made it possible for programmers to learn to use PC assembly using some of the better tools of professionals.
I'm interested in your experiences with getting and using these tools from Microsoft and also if you have suggestions on how to smooth the process or further enhance the tools.
Creation Date: Mon 29-Mar-1999 02:09:36 Last Modified: Sun 25-Jul-2004 22:55:29 Copyright (C) 1999, 2000, 2004 Jonathan Dale Kirwan