Intel 80x86 Assembly Language
In Chapter 15, we developed a generic assembly language and its
associated machine code. This language was presented to create a few
simple programs and present how the CPU executed code. In this
chapter, the assembly language of the Intel 80x86 processor family is
introduced along with the typical syntax for writing 80x86 assembly
language programs. This information is then used to write a sample
program for the 80x86 processor.
This chapter is meant to serve as an introduction to programming the
Intel 80x86 using assembly language. For more detailed instruction,
refer to one of the resources listed at the end of this chapter.
17.1 Assemblers versus Compilers
For a high-level programming language such as C, there is a two-
step process to produce an application from source code. To begin with,
a program called a compiler takes the source code and converts it into
machine language instructions. This is a complex task that requires a
detailed understanding of the architecture of the processor. The
compiler outputs the resulting sequence of machine code instructions to
a file called an object file. The second step takes one or more object
files and combines them by merging addressing information and
generating necessary support code to make the final unit operate as an
application. The program that does this is called a linker.
In order for the linker to operate properly, the object files must
follow certain rules for format and addressing to clearly show how one
object file interrelates with the others.
A similar two-step process is used to convert assembly language
source code into an application. It begins with a program called an
assembler. The assembler takes an assembly language program, and
using a one-to-one conversion process, converts each line of assembly
language to a single machine code instruction. Because of this one-to-
one relation between assembly language instructions and machine code
instructions, the assembly