The make16.bat Problem

This article only applies if you assembly and link from a command prompt in MS-DOS, Windows 95, Windows 98, and possibly Windows Me.

Updated 10/4/2002

We have found a problem with the PATH variable in the make16.bat file that is used for assembling and linking 16-bit Real-mode programs. (This problem does not occur in Windows 2000 or Windows XP.)

The SETLOCAL command (used in the make16.bat batch file) is supposed to make all changes to environment variables (such as PATH) temporary. When the batch file finishes, your system path is supposed to return to its previous state. This is important, because you may want to run other programs (such as Edit.exe) from the command prompt. SETLOCAL works in the make32.bat file, but it doesn't work in the make16.bat file. The difference, as far as I can tell, has to do with the 16-bit LINK.EXE program, which mysteriously disables the SETLOCAL command.

As a workaround, I have created an alternate version of make16.bat named make16a.bat that avoids using the PATH command and uses a full pathname for the ML and LINK commands:

	C:\Masm615\ML /nologo -c -Fl -Zi %1.asm
	C:\Masm615\LINK /nologo /CODEVIEW %1,,%1,Irvine16; 

If you have installed MASM in the C:\Masm615 directory, you do not need to make any changes to this batch file. Otherwise, you can edit the two commands listed here and substitute your own directory names. For example, MASM might be on drive D:

	D:\Masm615\ML /nologo -c -Fl -Zi %1.asm
	D:\Masm615\LINK /nologo /CODEVIEW %1,,%1,Irvine16; 

Download and save make16a.bat to your MASM directory now.