Sahar Mosleh California State University San MarcosPage 1 Intel IA-32 Architecture This lecture describes the architecture of the Intel IA-32 processor.

Slides:



Advertisements
Similar presentations
The CPU The Central Presentation Unit What is the CPU?
Advertisements

Registers of the 8086/ /2002 JNM.
Computer Organization and Assembly Language
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
Computer Organization and Assembly Languages Yung-Yu Chuang
Processor System Architecture
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
Computer Organization and Architecture
CS2422 Assembly Language & System Programming September 19, 2006.
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
IA-32 Processor Architecture
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
IA-32 Architecture COE 205 Computer Organization and Assembly Language Dr. Aiman El-Maleh College of Computer Sciences and Engineering King Fahd University.
Assembly Language for Intel-Based Computers Chapter 2: IA-32 Processor Architecture Kip Irvine.
Assembly Language Basic Concepts IA-32 Processor Architecture.
ICS312 Set 3 Pentium Registers. Intel 8086 Family of Microprocessors All of the Intel chips from the 8086 to the latest pentium, have similar architectures.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 2: 80386DX Internal Architecture & Data Organization.
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
The 8086 Microprocessor The 8086, announced in 1978, was the first 16-bit microprocessor introduced by Intel Corporation 8086 is 16-bit MPU. Externally.
Assembly Language for x86 Processors 6 th Edition Chapter 2: x86 Processor Architecture (c) Pearson Education, All rights reserved. You may modify.
An Introduction to IA-32 Processor Architecture Eddie Lopez CSCI 6303 Oct 6, 2008.
Assembly Language for Intel-Based Computers, 5th Edition
Processor Structure & Operations of an Accumulator Machine
Chapter 2: IA-32 Processor Architecture (c) Pearson Education, All rights reserved. You may modify and copy this slide show for your personal.
An Introduction to 8086 Microprocessor.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 2: IA-32 Processor Architecture (c) Pearson Education, All rights reserved. You.
Basic Microcomputer Design. Inside the CPU Registers – storage locations Control Unit (CU) – coordinates the sequencing of steps involved in executing.
1 Fundamental of Computer Suthida Chaichomchuen : SCC
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Intel Pentium II Processor Brent Perry Pat Reagan Brian Davis Umesh Vemuri.
Fall 2012 Chapter 2: x86 Processor Architecture. Irvine, Kip R. Assembly Language for x86 Processors 6/e, Chapter Overview General Concepts IA-32.
MICROCOMPUTER ARCHITECTURE 1.  2.1 Basic Blocks of a Microcomputer  2.2 Typical Microcomputer Architecture  2.3 Single-Chip Microprocessor  2.4 Program.
The ISA Level The Instruction Set Architecture (ISA) is positioned between the microarchtecture level and the operating system level.  Historically, this.
Computer Organization - 1. INPUT PROCESS OUTPUT List different input devices Compare the use of voice recognition as opposed to the entry of data via.
Introduction to Microprocessors
Electronic Analog Computer Dr. Amin Danial Asham by.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.
Computers organization & Assembly Language Chapter 1 THE 80x86 MICROPROCESSOR.
X86 Assembly Language We will be using the nasm assembler (other assemblers: MASM, as, gas)
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Introduction to Intel IA-32 and IA-64 Instruction Set Architectures.
Week 6 Dr. Muhammad Ayaz Intro. to Assembly Language.
BITS Pilani Pilani Campus Pawan Sharma Lecture / ES C263 INSTR/CS/EEE F241 Microprocessor Programming and Interfacing.
The Microprocessor & Its Architecture A Course in Microprocessor Electrical Engineering Department Universitas 17 Agustus 1945 Jakarta.
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
Chapter Overview General Concepts IA-32 Processor Architecture
CPU Lesson 2.
Assembly language.
x86 Processor Architecture
Computer Organization & Assembly Language Chapter 3
Assembly Language for Intel-Based Computers, 5th Edition
Introduction of microprocessor
Basic Microprocessor Architecture
Microcomputer Architecture
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
COAL Chapter 1,2,3.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
CS 301 Fall 2002 Computer Organization
The Microprocessor & Its Architecture
Assembly Language (CSW 353)
Computer Architecture CST 250
Presentation transcript:

Sahar Mosleh California State University San MarcosPage 1 Intel IA-32 Architecture This lecture describes the architecture of the Intel IA-32 processor family and its host computer system from a programmer’s point of view. As we pointed out in the first lecture, assembly language is a great tool for learning how a computer works. This lecture is an essential part of the learning process, because you need to learn the basics of system architecture before assembly language can be useful.

Sahar Mosleh California State University San MarcosPage 2 Basic Microcomputer Design Below picture, shows the basic design of a hypothetical microcomputer.

Sahar Mosleh California State University San MarcosPage 3 Basic Microcomputer Design The central processor unit (CPU) is where all the calculations and logic operations take place. It contains a limited number of storage locations called registers, a high-frequency clock, a control unit, and an arithmetic logic unit. The clock synchronizes the internal operations of the CPU with other system components. The control unit (CU) coordinates the sequencing of steps involved in executing machine instructions. The arithmetic logic unit (ALU) performs arithmetic operations such as addition and subtraction, and logical operations such as AND, OR, and NOT.

Sahar Mosleh California State University San MarcosPage 4 The CPU is attached to the rest of the computer via the pins that are attached to the CPU socket in the computer’s motherboard. Most of these pins connect to the data bus, the control bus, and the address bus. The memory storage unit is where instructions and data are held while a computer program is running. The storage unit receives requests for data from the CPU, transfers data from random access memory (RAM) to the CPU, and transfers data from the CPU into memory. A bus is a group of parallel wires that transfer data from one part of the computer to another. The system bus of a computer usually consists of three different buses: the data bus, the control bus, and the address bus. The data bus transfers instructions and data between the CPU and memory.

Sahar Mosleh California State University San MarcosPage 5 The control bus uses binary signals to synchronize the actions of all devices attached to the system bus. The address bus holds the addresses of instructions and data when the currently executing instruction transfers data between the CPU and memory. Clock: Each operation involving the CPU and the system bus is synchronized by an internal clock that repeatedly pulses at a constant rate. The most basic unit of time for machine instructions is called the machine cycle (or clock cycle time), which is the time required for one complete clock pulse. In the following figure, one clock pulse is defined as the time between one falling edge and the next falling edge. One clock cycle

Sahar Mosleh California State University San MarcosPage 6 Consider the fallowing code,.data val1 DWORD h val2 DWORD h.code main PROC mov eax, val1 mov ebx, val2 add eax, ebx exit memory Data

Sahar Mosleh California State University San MarcosPage 7 Instruction Execution Cycle The execution of a single machine instruction can be divided into a sequence of individual operations called the instruction execution cycle When the CPU executes an instruction using a memory operand, it must calculate the address of the operand, place the address on the address bus, wait for memory to get the operand, and so on. When the CPU executes a single machine instruction, three primary operations are always necessary: fetch, decode, and execute. Two more steps are required when the instruction uses a memory operand: fetch operand, and store output operand. In other words, as many as five operations may be required by instructions that access memory.

Sahar Mosleh California State University San MarcosPage 8 Fetch: The control unit fetches the instruction, copying it from memory into the CPU and increments the program counter (PC). Decode: The control unit determines the type of instruction to be executed. It passes zero or more operands to the arithmetic logic unit (ALU) and sends signals to the ALU that indicate the type of operation to be performed. Fetch operands: If a memory operand is used, the control unit initiates a read operation to retrieve the input operand from memory. Execute: The arithmetic logic unit executes the instruction, sends its data to the output operand, and updates status flags providing information about the output. Store output operand: If the output operand is in memory, the control unit initiates a write operation to store the data.

Sahar Mosleh California State University San MarcosPage 9 Different microprocessor design CISC : earliest Intel processors for the IBM Personal Computer were based on what is called a Complex Instruction Set Computer (CISC) approach. The Intel instruction set includes powerful ways to address data, and instructions that are relatively high-level complex operations. The philosophy was that high-level language compilers would have less work to do if individual machine-language instructions were powerful. A major disadvantage to the CISC approach is that complex instructions require a relatively long time for the processor to decode and execute.

Sahar Mosleh California State University San MarcosPage 10 RISC: A completely different approach to microprocessor design is called Reduced Instruction Set (RISC). A RISC machine language consists of a relatively small number of short, simple instructions that can be executed very quickly. High-speed engineering and graphics workstations have been built using RISC processors for many years. Unfortunately, these systems have been expensive because the processors were produced in small quantities.

Sahar Mosleh California State University San MarcosPage 11 IA-32 processor Modes of operation IA-32 processors have three basic modes of operation: Protected mode, Real-address mode, and System Management mode. In addition, the Virtual-8086 mode is a special case of Protected mode. Real Mode: The old DOS operating system required the Real Mode to work, while newer Windows, Linux and other operating systems usually require the Protected Mode. Upon power-on, the processor initiates itself into Real mode, and then it begins loading programs automatically into RAM from ROM and disk. A program inserted somewhere along the boot sequence may be used to put the processor into the Protected mode.

Sahar Mosleh California State University San MarcosPage 12 Protected Mode: Protected mode is the native state of the processor, in which all instructions and features are available. Programs are given separate memory areas (called segments), and the processor detects any attempt by a program to reference memory outside its assigned segment. multitasking, which lets a computer juggle multiple programs all at once to look like they are all running at the same time is an advantage of using protected mode Virtual-8086 Mode: it is also a sub-mode of operation in Protected mode. This is basically a special hybrid operating mode which allowed old DOS programs and operating systems to run while under the control of a Protected mode supervisor operating system. This allowed for a great deal of flexibility in running both Protected mode programs and DOS programs simultaneously.

Sahar Mosleh California State University San MarcosPage 13 Basic Program Execution Registers Registers are high-speed storage locations directly inside the CPU, designed to be accessed at much higher speed than conventional memory. In next slid we will see the basic program execution registers. There are eight general-purpose registers, six segment registers, a register that holds processor status flags (EFLAGS), and an instruction pointer (EIP).

Sahar Mosleh California State University San MarcosPage 14 There are eight general-purpose registers, six segment registers, a register that holds processor status flags (EFLAGS), and an instruction pointer (EIP).

Sahar Mosleh California State University San MarcosPage 15 Some registers can also be addressed as four separate 8-bit values. For example, the EAX register is 32 bits. Its lower 16 bits are also named AX. The upper 8 bits of AX are named AH, and the lower 8 bits are named AL. This relationship exist for the EAX, EBX, EDX, and ECX.

Sahar Mosleh California State University San MarcosPage 16 The remaining general-purpose registers have separate names for their lower 16 bits, but cannot be divided further. The 16-bit registers shown here are usually used only when writing programs that run in Real-address mode:

Sahar Mosleh California State University San MarcosPage 17 EAX ( Accumulator) is automatically used by multiplication and division instructions. It is often called the extended accumulator register for accumulating operands and results. EBP ( Base) is used by high-level languages to reference function parameters and local variables on the stack (data on the stack). It should not be used for ordinary arithmetic or data transfer except at an advanced level of programming. It is often called the extended frame pointer register. ECX ( Count) used as counter for string and loop operations. EDX (Data) register that can be used for I/O pointer. ESP stack pointer register. ESI and EDI are used by high-speed memory transfer instructions. They are sometimes called the extended source index and extended destination index registers.

Sahar Mosleh California State University San MarcosPage 18 Segment Registers The segment registers are used as base locations for reassigned memory areas called segments. Some segments hold program instructions (code), others hold variables (data), and another segment called the stack segment holds local function variables and function parameters. Instruction Pointer: The EIP, or instruction pointer register contains the address of the next instruction to be executed. Certain machine instructions manipulate this address, causing the program to branch to a new location. EFLAGS Register: The EFLAG (or just Flags) register consists of individual binary bits that either control the operation of the CPU or reflect the outcome of some CPU operation. There are machine instructions that can test and manipulate the processor flags.

Sahar Mosleh California State University San MarcosPage 19 Status Flags The Status flags reflect the outcomes of arithmetic and logical operations performed by the CPU. They are the Overflow, Sign, Zero, Auxiliary Carry, Parity, and Carry flags. Their abbreviations are shown immediately after their names. The Carry flag (CF) is set when the result of an unsigned arithmetic operation is too large to fit into the destination. The Overflow flag (OF) is set when the result of a signed arithmetic operation is too wide (too many bits) to fit into the destination. The Sign flag (SF) is set when the result of an arithmetic or logical operation generates a negative result.

Sahar Mosleh California State University San MarcosPage 20 The Zero flag (ZF) is set when the result of an arithmetic or logical operation generates a result of zero. The Auxiliary Carry flag is set when an arithmetic operation causes a carry from bit 3 to bit 4 in an 8-bit operand. The Parity flag sums the number of bits that are set in a number, and indicates whether the sum is odd or even.

Sahar Mosleh California State University San MarcosPage 21 Floating-Point Unit The IA-32 has a floating-point unit (FPU) that is used expressly for high-speed floating-point arithmetic. At one time a separate coprocessor chip was required for this, but beginning with the Intel 486, it was integrated into the main processor chip. There main eight floating-point data registers in the FPU, named ST(0), ST(1), ST(2), ST(3), ST(4), ST(5), ST(6), and ST(7). Other Registers In passing, we will mention two other sets of registers used for advanced multimedia programming: Eight 64-bit registers for use with the MMX instruction set Eight 128-bit XMM registers used for single-instruction, multiple- data (SIMD) operations

Sahar Mosleh California State University San MarcosPage 22 IA-32 Memory Management in protected mode When the processor is running in Protected mode, each program can address up to 4GB of memory, from 0 to FFFFFFFF hexadecimal. This use of a flat address space is also called the flat memory model by the Microsoft Assembler. From the programmer’s point of view, the flat memory model is very simple to use because it only requires a single 32-bit integer to hold the address of any instruction or variable. The operating system does quite a bit of background work to preserve the illusion of simplicity, aided by the processor’s built-in capabilities.

Sahar Mosleh California State University San MarcosPage 23 The segment registers (CS, DS, SS, ES, FS, GS) point to segment descriptor tables that the operating system uses to define the locations of individual program segments. A typical Protected-mode program has three segments: code, data, and stack. Three segment registers are used all the time: CS references the descriptor table for the code segment. DS references the descriptor table for the data segment SS references the descriptor table for the stack segment.

Sahar Mosleh California State University San MarcosPage 24 Input-Output System How It All Works? I/O is accomplished not by directly accessing the computer’s hardware, but by calling functions in the computer’s operating system. A high-level programming language such as C++ or Java contains functions that perform input-output. These functions are designed to work on a variety of different computer systems. The OS (operating system) deals with high-level operations, such as writing entire strings and records to files, reading strings from the keyboard, and allocating blocks of memory for application programs.

Sahar Mosleh California State University San MarcosPage 25 The BIOS (Basic Input-Output System) is a collection of functions that communicate directly with hardware devices. The BIOS is installed by the computer’s manufacturer, and must be tailored to fit the computer’s exact configuration down to the selection of specific chips on the motherboard. Any operating system installed in the computer must be able to work with the computer’s BIOS.