How to assemble a program in MASM32 for DOS? Is it possible to use MASM32 to make programs for DOS? I would be much obliged for any example codes and ‘MakeIt.bat’ files.
Yes, it's possible. But you must use MS's old OMF linker, founder under icz's downloads. Then when you use masm, instead off passing the command, /COFF, use /OMF instead. That should do the trick.
Absolutely. Just don't use the directive .model flat (use tiny, small, compact, large, or huge instead). You can still use .386 if you want, however you may run into some warnings and conversion problems if .386 is before the beginning of your code/data segments. The problem comes in two forms. The first is that MASM will always chain to it's linker. You'll have to create a specific batch file to use the /c option for MASM (but you might not want to use the /coff switch). The second problem is the linker itself. The linker which comes in MASM32 is only tooled to handle 32 bit protected mode programs. If you look online, you can probably find a free, useful DOS linker, or I believe that Iczelion's site has a Microsoft '16 bit' linker program for download. (I hate the term '16 bit' when referring to DOS based programs because there is such a thing as 16 bit protected mode, not to mention 32 bit real mode. :))
How do you make a Win32 console app using the current "ml" and "link"?