Hardware Reference
In-Depth Information
5 Assembly language
programming
This chapter aims to provide readers with an overview of assembly language
programming techniques, and explores the architecture and instruction set of
the x86 microprocessor family used in the PC and compatible equipment.
Rather than providing a complete guide to assembly language programming
(which, in any event, would require a complete topic in its own right!), the
aim has been that of providing readers with sufficient information to decide
whether assembly language is appropriate for a particular application, to out-
line the advantages and disadvantages of assembly language programming,
and to introduce techniques used for the development of assembly language
programs.
Readers wishing to develop their own assembly language programs will not
only require complete documentation for the x86 family of processors (includ-
ing a comprehensive explanation of the microprocessor's instruction set) but will
also require development software comprising, as minimum, a macro assem-
bler, a linker, and a debugger. Furthermore, despite the fact that one of the
most powerful 32-bit assemblers, MASM32, is currently available as 'free-
ware'; readers should not underestimate the investment required (in terms of
time) required to successfully follow this route.
Advantages of
assembly language
Assembly language programs offer a number of advantages when compared
with higher-level alternatives. The principal advantages are that the executable
code produced by an assembler (and linker) will:
invariably be more compact than an equivalent program written in a higher-
level language;
invariably run faster than an equivalent program written in a higher-level
language;
not require the services of a resident interpreter or a compiler run-time
system;
be able to offer the programmer unprecedented control over the hardware in
the system.
It is this last advantage, in particular, that makes assembly language a prime
contender for use in control applications. No other programming language
can hope to compete with assembly language where control of hardware is
concerned. Indeed, an important requirement of high-level languages used in
control applications is that they can be interfaced with machine code modules
designed to cope with problems arising from limitations of the language where
input/output (I/O) control is concerned.
Search WWH ::




Custom Search