TASM Using For Translation
Now, it is time to test all the programs presented in this chapter by translating
them using TASM.
The situation is easy for the programs shown in Listings 1.1 and 1.2. To translate
them,
it is sufficient to execute the following commands: TASM32 /ml PROG1.ASM and
TLINK32 -aa PROG1.OBJ
Now, proceed with translation of the PROG2.ASM and PROG1.ASM modules provided
in Listings 1.3 and 1.4, respectively. Object modules are created without
difficulties.
Viewing the PROG2.OBJ module, you'll notice that the external procedure is
represented by a simple name � PROC1. Consequently, the only thing that you should
do
is replace the PROC1@0 name with PROC1 in the PROG1.ASM module. Further linking of
the modules also is straightforward:
TLINK32 -aa PROG1.OBJ PROG2.OBJ
For working with libraries, TASM provides a librarian � TLIB.EXE. Issuing the
following
command creates a library from the PROG2.OBJ module:
TLIB LIB1.LIB + PROG2.OBJ
As a result, the library named LIB1. LIB will appear on the disk. It is necessary
to link
the PROG 1.OBJ module to this library:
TLINK32 -aa PROG1, PROG1, PROG1, LIB1
As a result, you'll get the PROG1.EXE executable module.
You should pay close attention to the TLINK32 command-line option. In the most
general form, it looks as follows:[i]
TLINK32 -aa OBJFILES, EXEFILE, MAPFILE, LIBFILES
OBJFILES � One or more object files (separated by blanks); the main module must
be specified first.
�
� EXEFILE � An executable file.
� MAPFILE � A MAP file containing information on the module structure.
� LIBFILES � One or more libraries (separated by blanks).
In TASM, there is no INVOKE directive; therefore, I'll avoid using it later.[ii]
When introducing this book, I declared my intention to reconcile two assemblers.
Since the differences between them mainly lie in directives and macro commands (see
Chapter 5), a simple idea suggests itself, namely, that it is possible to achieve
compatibility by simply avoiding such directives and macro commands.
After considering the program shown in Listing 2.2, you might ask a reasonable
question�how do I implement the same program in TASM? Only minor changes are
required to achieve this: Instead of using the user32.lib and kernel32.lib
libraries, it is
necessary to link the import32.lib library, delete the @N suffix from all names of
library
procedures.