Information Technology Reference
In-Depth Information
simple hypothetical machine that will be referred to throughout the chapter. The
machine has only five registers and its instruction set has only 10 instructions.
We will use this simple machine to define a rather simple assembly language that
will be easy to understand and will help explain the main issues in assembly pro-
gramming. We will introduce instruction mnemonics and the syntax and assembler
directives and commands. A discussion on the execution of assembly programs is
then presented. We conclude the chapter by showing a real-world example of the
assembly language for the X86 Intel CISC family.
3.1. A SIMPLE MACHINE
Machine language is the native language of a given processor. Since assembly
language is the symbolic form of machine language, each different type of processor
has its own unique assembly language. Before we study the assembly language of a
given processor, we need first to understand the details of that processor. We need to
know the memory size and organization, the processor registers, the instruction
format, and the entire instruction set. In this section, we present a very simple
hypothetical processor, which will be used in explaining the different topics in
assembly language throughout the chapter.
Our simple machine is an accumulator-based processor, which has five 16-bit
registers: Program Counter (PC), Instruction Register (IR), Address Register
(AR), Accumulator (AC), and Data Register (DR). The PC contains the address
of the next instruction to be executed. The IR contains the operation code portion
of the instruction being executed. The AR contains the address portion (if any) of
the instruction being executed. The AC serves as the implicit source and destination
of data. The DR is used to hold data. The memory unit is made up of 4096 words of
storage. The word size is 16 bits. The processor is shown in Figure 3.1.
ALU
CPU
Figure 3.1 A simple machine
Search WWH ::




Custom Search