Let's put together everything we've learned about using the MS-DOS programming tools so far. Figure 4-8 shows a sketch of the overall process of building an executable program.
Assume that we have the source code for the HELLO.EXE program from Chapter 3 in the file HELLO.ASM. To assemble the source program into the relocatable object module HELLO.OBJ with symbolic debugging information included, also producing a program listing in the file HELLO.LST and a cross-reference data file HELLO.CRF, we would enter
C>MASM /C /L /Zi /T HELLO; <Enter>
To convert the cross-reference raw-data file HELLO.CRF into a cross-reference listing in the file HELLO.REF, we would enter
C>CREF HELLO,HELLO <Enter>
Figure 4-8. Creation of an MS-DOS application program, from source code to executable file.
Please refer to the printed book for this figure.
To convert the relocatable object file HELLO.OBJ into the executable file HELLO.EXE, creating a load map in the file HELLO.MAP and appending symbolic debugging information to the executable file, we would enter
C>LINK /MAP /CODEVIEW HELLO; <Enter>
We could also automate the entire process just described by creating a make file named HELLO (with no extension) and including the following instructions:
hello.obj : hello.asm
masm /C /L /Zi /T hello;
cref hello,hello
hello.exe : hello.obj
link /MAP /CODEVIEW hello;
Then, when we have made some change to HELLO.ASM and want to rebuild the executable HELLO.EXE file, we need only enter
C>MAKE HELLO <Enter>