Information Technology Reference
In-Depth Information
address that is divisible by n, for example, a word that has a two-byte width has to be
stored at locations having addresses divisible by two.
In assembly language programs symbols are used to represent numbers, for
example, immediate data. This is done to make the code easier to read, understand,
and debug. Symbols are translated to their corresponding numerical values by the
assembler.
The use of synthetic operations helps assembly programmers to use instructions
that are not directly supported by the architecture. These are then translated by the
assembler to a set of instructions defined by the architecture. For example, assem-
blers can allow the use of (a synthetic) increment instruction on architectures for
which an increment instruction is not defined through the use of some other instruc-
tions such as the add instruction.
Assemblers usually impose some conventions in referring to hardware com-
ponents such as registers and memory locations. One such convention is the prefix-
ing of immediate values with the special characters (#) or a register name with the
character (%).
The underlying hardware in some machines cannot be accessed directly by a pro-
gram. The operating system (OS) plays the role of mediating access to resources
such as memory and I
O facilities. Interactions with operating systems (OS) can
take place in the form of a code that causes the execution of a function that is
part of the OS. These functions are called system calls.
/
3.4. ASSEMBLY AND EXECUTION OF PROGRAMS
As you know by now, a program written in assembly language needs to be trans-
lated into binary machine language before it can be executed. In this section, we
will learn how to get from the point of writing an assembly program to the
execution phase. Figure 3.3 shows three steps in the assembly and execution pro-
cess. The assembler reads the source program in assembly language and generates
the object program in binary form. The object program is passed to the linker. The
linker will check the object file for calls to procedures in the link library. The linker
will combine the required procedures from the link library with the object program
and produce the executable program. The loader loads the executable program into
memory and branches the CPU to the starting address. The program begins
execution.
Figure 3.3 Assembly and execution process
Search WWH ::




Custom Search