| ||
The ML.EXE translator provides the convenient feature of automatically starting the linker. As a rule, this feature is ignored using the /c command-line option. If this option isn't used, the ML compiler will try to start the LINK.EXE program. To correctly compile and link the program, it is necessary to specify the required options of the linker. Thus, the entire command line would appear as follows :
ML /coff prog.asm /LINK /subsystem:windows
Very convenient, isn't it?
There exists one interesting technique that allows you to format the program source code to make it possible to start it as a BAT file, which would immediately assemble and link the program. This technique is possible because the command processor ignores the semicolon character (;). At the same time, the assembler uses this character for marking the comments. Thus, you can always mask the OS commands from the assembler's view. Listing 5.1 is a skeleton for such a program. Do not forget that the file must have the BAT filename extension. For this example, name your program M.BAT.
; goto masm ; Program code here . . . END START ; ml /c /coff M.BAT ; link /subsysytem:windows M.OBJ
That's all. Of course, this is a trifle; however, the art of programming consists of such small details.
| ||