Hardware Reference
In-Depth Information
Disadvantages of
assembly language
Unfortunately, when compared with higher-level languages, assembly language
has a number of drawbacks; most notable of which are the following:
•
Programs require considerably more development time (including writing,
assembling, linking or loading, and debugging) than their equivalent written
in a high-level language.
•
Programs are not readily transportable between microprocessors from differ-
ent families. Different microprocessors have different internal architectures
and, in particular, the provision of registers accessible to the programmer
will vary from one microprocessor to another. Differences in internal archi-
tecture is reflected in corresponding differences in the type and function of
the software instructions provided for the programmer.
•
The situation is further compounded by the fact that microprocessor manu-
facturers frequently adopt different terminology to refer to the same thing.
The variety of names used to describe the register used to indicate the out-
come of the last arithmetic logic unit (ALU) operation (and the internal
status of the microprocessor) is a case in point. This is variously referred to
as a Flag Register, Status Register, Condition Code Register, and Processor
Status Word.
•
In practice this means that the system designer is constrained to select one
particular microprocessor type or family, and develop code exclusively for
this particular device. This, of course, is not a particular problem in the case
of the PC and compatible equipment which are all based on the standard x86
and Pentium families.
•
Unless liberally commented, the action of an assembly language program is
not obvious from merely reading the source text. Programs written in high-
level language are usually easy to comprehend and their structure is usually
self-evident.
•
The production of efficient assembly language programs requires a relatively
high degree of proficiency on the part of the programmer. Such expertise
can usually only be acquired as a result of practical experience aided by
appropriate training.
Developing assembly
language programs
The process of developing an assembly language program depends on a number
of factors including the hardware configuration available for software develop-
ment and the range of software tools available to the developer. As a minimum,
the task normally involves the following steps:
1
Analysing the problem and producing a specification for both hardware and
software (see Chapter 4).
2
Developing the overall structure of the program, defining the individual ele-
ments and modules within it, and identifying those which already exist (or
can be easily modified or extended) within the programmer's existing library.
3
Coding each new module required using assembly language mnemonics,
entering the text using an editor, and saving each source code module to disk
using an appropriate filename.
4
Assembling each source code module (using an assembler) to produce an
intermediate relocatable object code file.