Assembler - Windows Programming Tools
Assembler - Windows Programming Tools
The First Assembly Program and Its TranslationTwo main programs correspond to the
two stages of translation in Fig. 1.1: the
ML.EXE assembler[i] and the LINK.EXE linker (or TASM32.EXE and TLINK32.EXE in
Turbo Assembler). Suppose that the source file of your program written in Assembly
language is called PROG.ASM.
Quite often, it is convenient to split the source code into several parts and join
them at
the first stage of translation. This can be achieved using the include directive.
For
example, one file might contain the program code, and the constants and data (such
as
variable definitions) � along with the prototypes of external procedures � might be
placed into separate files. Such files often have the INC filename extension.
The example program in Listing 1.2, like the other programs provided in this
chapter,
is senseless. However, it demonstrates the convenience of using the INCLUDE
directive.
I'd like to remind you not to concentrate your attention on the obvious
microprocessor
commands. I'd only like to draw your attention to the IDIV command.
In this case, the IDIV command carries out the division operation over the operand
residing in the EDX:EAX register pair. By resetting EDX to zero, you specify that
the
entire operand is in EAX.
Program translation is carried out as specified earlier for MASM and TASM.