For part 2 of this series, please click here.
Programming in a high-level language does not require a detailed knowledge of the system hardware. Assembly language programmers, however, should have some basic understanding of the underlying system architecture.
Although you can write software that is ignorant of these concepts, understanding the organization of the system will allow you to write code that runs as fast as possible. If you want to delve further, check an architectural tutorial, you may find more information than an assembly based tutorial.
The basic operational design of a computer system is called its architecture. John Von Neumann, a pioneer in computer design, is given credit for the architecture of most computers in use today. For example, the x86 family uses the Von Neumann architecture. A typical Von Neumann system has three major components:
- The Central Processing Unit (CPU)
- The Memory
- Input/Output (I/O) devices.
This refinement of the Von Neumann model combines the Arithmetic and Logic Unit (ALU) and the Control Unit (CU) into one functional unit, the CPU. The Input and Output units are also combined into a single I/O unit.
The Arithmetic Logic Unit (ALU) performs arithmetic operations such as addition and subtraction and logical operations such as AND, OR, and NOT.
The Control Unit (CU) coordinates the sequencing of steps involved in executing machine instructions.
Registers are local storage areas within the processor that are used to hold data that is being worked on by the processor.
These three major components are interconnected together using the System Bus, which is made up of:
- The Control Bus
- The Data Bus
- The Address Bus
The CPU communicates with memory and I/O devices by placing a numeric value on the address bus to select one of the memory locations or I/O device port locations, each of which has a unique binary numeric address. Then the CPU, I/O, and memory devices pass data among themselves by placing the data on the data bus. The control bus contains signals that determine the direction of the data transfer:
- to memory or from memory.
- to I/O device or from I/O device.
During a memory read or write operation, the address bus contains the address of the memory location where the data is to be read from or written to. Note that the terms “read” and “write” are with respect to the CPU: the CPU reads data from memory and writes data into memory. If data is to be read from memory then the data bus contains the value read from that address in memory. If the data is to be written into memory then the data bus contains the data value to be written into memory.
The CPU (Central Processing Unit)
The CPU is the main component, the computer brain which execute a sequence of instructions that performs some primitive operation, such as adding two numbers. An instruction is encoded in binary form as a sequence of 1 or 0.
The instructions supported by a particular processor and their byte-level encodings are known as its instruction-set architecture (ISA). Different “families” of processors, such as Intel, MIPS, PowerPC, Motorola, Zilog, Texas Instrument and the ARM processor family have different ISAs.
As you can see, there are several commonly used computer architectures. Since the bulk of the processors in use today are Intel x86, and they are the most dominant format for the world’ s computers, we will further focus on that architecture.
You have seen me writing “x86″ from the beginning of this saga but you may probably wonder what does that exactly mean. To start, let’s give you a brief history of Intel’s family of microprocessors.
Evolution from 4004 to today’s microprocessors (Core i7)
I’m going to narrate the story of Intel, keep your eyes open guys, if you hear any unfamiliar word, ask me.
Intel introduced microprocessors way back in 1971. Their first 4-bit microprocessor was the 4004. This was followed by the 8080 and 8085 processors. The work on these early microprocessors led to the development of the Intel architecture (IA). The first processor in the Intel family was the 8086 processor, introduced in 1979. It has a 20-bit address bus and a 16-bit data bus.
The 8088 is a less expensive version of the 8086 processor. The cost reduction is obtained by using an 8-bit data bus. Except for this difference, the 8088 is identical to the 8086 processor. Intel introduced segmentation with these processors. These processors can address up to four segments of 64KB each. This IA segmentation is referred to as the real-mode segmentation.