Chapter 2 The Microprocessor Architecture Microprocessors prepared by Dr. Mohamed A. Shohla.

Slides:



Advertisements
Similar presentations
Chapter 2 (cont.) An Introduction to the 80x86 Microprocessor Family Objectives: The different addressing modes and instruction types available The usefulness.
Advertisements

Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU
Chapter 2: The Microprocessor and its Architecture.
Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. The Intel Microprocessors: 8086/8088, 80186/80188,
Dept. of ECE, GMU ECE Registers and Memory Access Dr. Qiang Lin.
The Microprocessor and its Architecture
Intel MP.
CSC 221 Computer Organization and Assembly Language
Chapter 3 Addressing Modes
Lect 3: Instruction Set and Addressing Modes. 386 Instruction Set (3.4) –Basic Instruction Set : 8086/8088 instruction set –Extended Instruction Set :
Operating Systems: Segments 1 Segmentation Hardware Support single user program system: – wish somehow to relocate address 0 to after operating system.
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.
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.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Fall 2012 Lecture 15: Protected mode intro.
80x86 Processor Architecture
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2013 Lecture 4: 80386DX memory, addressing.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2014 Lecture 4: x86 memory.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
Lect 4: Instruction Set and Addressing Modes. 386 Instruction Set (3.4)  Basic Instruction Set : 8086/8088 instruction set  Extended Instruction Set.
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
CSNB374: Microprocessor Systems Chapter 2: Intel x86 Microprocessor Architecture.
The Pentium Processor.
The Pentium Processor Chapter 3 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
The Pentium Processor Chapter 3 S. Dandamudi.
The Intel Microprocessors. Real Mode Memory Addressing Real mode, also called real address mode, is an operating mode of and later x86-compatible.
Multitasking Mr. Mahendra B. Salunke Asst. Prof. Dept. of Computer Engg., STES SITS, Narhe, Pune-41 STES Sinhgad Institute of Tech. & Science Dept. of.
1 Fundamental of Computer Suthida Chaichomchuen : SCC
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
The x86 Architecture Lecture 15 Fri, Mar 4, 2005.
ECE291 Computer Engineering II Lecture 3 Josh Potts University of Illinois at Urbana- Champaign.
The Microprocessor and Its Architecture A Course in Microprocessor Electrical Engineering Department University of Indonesia.
(-133)*33+44* *33+44*14 Input device memory calculator Output device controller Control bus data bus memory.
Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.
ECE291 Computer Engineering II Lecture 3 Josh Potts University of Illinois at Urbana- Champaign.
CDP ECE Spring 2000 ECE 291 Spring 2000 Lecture 8: Real & Protected Mode Paging and Virtual Memory Constantine D. Polychronopoulos Professor, ECE.
ECE291 Computer Engineering II Lecture 3 Dr. Zbigniew Kalbarczyk University of Illinois at Urbana- Champaign.
1 Microprocessors CSE Protected Mode Memory Addressing Remember using real mode addressing we were previously able to address 1M Byte of memory.
1 Microprocessors CSE – 341 EEE – 365 \\server2\tsr\Spring\CSE\CSE341
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
Microprocessor and Assembly Language Addressing Models
Internal Programming Architecture or Model
BITS Pilani Pilani Campus Pawan Sharma Lecture / ES C263 INSTR/CS/EEE F241 Microprocessor Programming and Interfacing.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
The Microprocessor & Its Architecture A Course in Microprocessor Electrical Engineering Department Universitas 17 Agustus 1945 Jakarta.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Computer Science 516 Intel x86 Overview. Intel x86 Family Eight-bit 8080, 8085 – 1970s 16-bit 8086 – was internally 16 bits, externally 8 bits.
Lecture on Real Mode Memory Addressing
16.317: Microprocessor System Design I
Microprocessor Systems Design I
Microprocessor Systems Design I
Microprocessor Systems Design I
Chapter 2 The Microprocessor and its Architecture
Chapter 4 Data Movement Instructions
Basic Microprocessor Architecture
University of Gujrat Department of Computer Science
Microprocessor-Unit I
Subject Name: Microprocesor Subject Code: 10CS45
Chapter 2: The Microprocessor and its Architecture
8086 Registers Module M14.2 Sections 9.2, 10.1.
Introduction to Intel IA-32 and IA-64 Instruction Set Architectures
CS 301 Fall 2002 Computer Organization
Microprocessor and Assembly Language Addressing Models
The Microprocessor & Its Architecture
Computer Architecture CST 250
Chapter 2: The Microprocessor and its Architecture
AKT211 – CAO 05 – x86 Architecture: Intel 8088 (2)
Presentation transcript:

Chapter 2 The Microprocessor Architecture Microprocessors prepared by Dr. Mohamed A. Shohla

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course Chapter Overview Internal Microprocessor Architecture The Programming Model Real Mode Memory Addressing Segments and Offsets Default Segment and Offset Registers Protected Mode Memory Addressing

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course Internal Microprocessor Architecture

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course Multipurpose Registers EAX EAX (accumulator) a 32-bit register (EAX), a 16-bit register (AX), or of two 8-bit registers (AH and AL). EBX EBX (base index) sometimes holds the offset address of a location in the memory. ECX ECX (count) is a general-purpose register that also holds the count for various instructions. EDX EDX (data) holds a part of the result from a multiplication or part of the dividend in division. EBX EBP (base pointer) points to a memory location for memory data transfers. EDI EDI (destination index) often addresses string destination data for the string instructions. ESI ESI (source index) often addresses source string data for the string instructions.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course Special-purpose Registers. EIP EIP (instruction pointer) addresses the next instruction in a section of memory defined as a code segment. This register is IP (16 bits) when the microprocessor operates in the real mode and EIP (32 bits) when the and above operate in the protected mode. ESP ESP (stack pointer) addresses an area of memory called the stack. The stack memory stores data through this pointer and is explained later in the text with instructions that address stack data. EFLAGS EFLAGS indicate the condition of the microprocessor and control its operation. Figure 2-2 shows the flag registers of all versions of the microprocessor.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course Segment Registers CS The CS (code segment) is a section of memory that holds the code (programs and procedures) used by the microprocessor. The code segment register defines the starting address of the section of memory holding-code. DS The DS (data segment) is a section of memory that contains most data used by a program. Data are accessed in the data segment by an offset address or the contents of other registers that hold the offset address. ES The ES (extra segment) is an additional data segment that is used by some of the string instructions to hold destination data. SS The SS (stack segment) defines the area of memory used for the stack. The stack entry point is determined by the stack segment and stack pointer registers. FS-GS The FS and GS segments are supplemental segment registers to allow two additional memory segments for access by programs.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course Real Mode Memory Addressing The and above operate in either the real or protected mode. Only the 8086 and 8088 op­erate exclusively in the real mode. Real mode operation allows the microprocessor to address only the first 1M byte of memory space—even if it is the Pentium 4 microprocessor. Note that the first 1M byte of memory is called either the real memory or conventional memory system. The DOS operating system requires the microprocessor to operate in the real mode. Real mode operation allows application software written for the 8086/8088, which contains only 1M byte of memory, to function in the and above without changing the software.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course A combination of a segment address and an offset address access a memory location in the real mode. All real mode memory addresses must consist of a segment address plus an offset address. The segment address, located within one of the segment registers, defines the beginning address of any 64K-byte memory segment. The offset address selects any location within the 64K byte memory segment. Segments in the real mode always have a length of 64K bytes. Segments and Offsets

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course Example: The real mode memory-addressing, using a segment address plus an offset. The segment register = 1000H, The starting segment = 10000H. In the real mode, each segment register is internally appended with a 0H on its rightmost end. a memory segment that begins at location 10000H and ends at location 1FFFFH— 64K bytes in length. It also shows how an offset address, sometimes called a displacement, and of F000H selects location 1F000H in the memory system.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course In the real mode, show the starting and ending addresses of each segment located by the following segment register values: (a)1000H(b) 1234H(c) 2300H a)segment register = 1000H the starting address of the segment = 10000H, the last address = 10000H + FFFFH = 1FFFFH. Segment RegisterStarting AddressEnding Address 1000H10000H2FFFFH 1234H12340H2233FH 2300H23000H32FFFH

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course and Pentium-Pentium 4 de­fault 16- bit segment and offset address combinations. SegmentOffsetSpecial Purpose CSIPInstruction address SSSP or BPStack address DSBX, DI, SI, an 8-bit number, or a 16-bit number Data address ESDI for string instructionsString destination address

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course through Pentium 4 default 32-bit segment and offset address combinations. SegmentOffsetSpecial Purpose CSEIPInstruction address SSESP or EBPStack address DSEAX, EBX, ECX, EDX, ESI, EDI, an Data address 8-bit number, or a 32-bit number Data address ESEDI for string instructionsString destination address FSNo defaultGeneral address GSNo defaultGeneral address

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course Protected Mode Memory Addressing Protected mode memory addressing (80286 and above) allows access to data and programs located above the first 1M byte of memory. Addressing this extended section of the memory system requires a change to the segment plus an offset addressing scheme used with real mode memory addressing. When data and programs are addressed in extended memory, the offset address is still used to access information located within the memory segment. One difference is that the segment address, as discussed with real mode memory addressing, is no longer present in the protected mode. In place of the segment address, the segment register contains a selector that selects a descriptor from a descriptor table. The descriptor describes the memory segment's location, length, and access rights. The difference between modes is in the way that the segment register is interpreted by the microprocessor to access the memory segment. Another difference, is that the offset address can be a 32-bit number instead of a 16-bit number in the protected mode. A 32-bit offset address allows the microprocessor to access data within a segment that can be up to 4G bytes in length.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course Selectors and Descriptors The selector, located in the segment register, selects one of 8192 descriptors from one of two ta­bles of descriptors. The descriptor describes the location, length, and access rights of the seg­ment of memory. Indirectly, the segment register still selects a memory segment, but not directly as in the real mode. In the protected mode, this segment number can address any memory location in the entire system for the code segment. There are two descriptor tables used with the segment registers: one contains global de­scriptors and the other contains local descriptors. The global descriptors contain segment definitions that apply to all programs, The local descriptors are usually unique to an application. You call a global descriptor a system descriptor and call a local descriptor an application descriptor. Each descriptor table contains 8192 descriptors, so a total of 16,384 total descriptors are available to an application at any time.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course The contents of a segment register Descriptors are chosen from the descriptor table by the segment register. The segment register contains a 13-bit selector field, a table selector bit, and a requested privilege level field. The 13-bit selector chooses one of the 8192’descriptors from the descriptor table. The TI bit selects either the global descriptor table (TI = 0) or the local descriptor table (TI = 1). The requested privilege level (RPL) requests the access privilege level of a memory segment. The highest privilege level is 00 and the lowest is 11. If the requested privilege level matches or is higher in priority than the privilege level set by the access rights byte, access is granted.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course The descriptor formats for the and through Pentium 4 microprocessors.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course The descriptor for the and through Pentium 4 microprocessors. each descriptor is 8 bytes in length, so the global and local descriptor tables are each a maximum of 64K bytes in length. The base address indicates the starting location of the memory segment. For the microprocessor, the base address is a 24-bit address, so segments begin at any location in its 16M bytes of memory. The and above use a 32-bit base address that allows segments to begin at any location in its 4G bytes of memory. The segment limit contains the last offset address found in a segment. The access rights byte controls access to the protected mode memory segment. This byte describes how the segment functions in the system.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course The descriptor for the and through Pentium 4 microprocessors. G = granularity bit The AV bit, indicate that the segment is available (AV = 1) or not available (AV = 0). The D bit indicates how the through the Pentium 4 instructions access register and memory data in the protected or real mode. If D = 0, the instructions are 16-bit instructions, compatible with the microprocessors. If D = 1, the instructions are 32-bit instructions.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course The G bit, or Granularity bit The G bit, or granularity bit If G = 0, the limit specifies a segment limit of 00000H to FFFFFH. If G = 1, the value of the limit is multiplied by 4K bytes (appended with XXXH). The limit is then 00000XXXH to FFFFFXXXH, if G = 1. This allows a segment length of 4K to 4G bytes in steps of 4K bytes.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course The G bit, or Granularity bit Example: Base = Start = H G = 0 End = Base + Limit = H + 001FFH = FFH Example: Base = Start = H G = 1 End = Base + Limit = H + 001FFXXXH = 101FFFFFH

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course The access rights byte for the descriptor.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course What are program-Invisible registers? The global and local descriptor tables are found in the memory system. In order to access and specify the address of these tables, the 80286, 80386, 80486, and Pentium through Pentium 4 contain program-invisible registers. The program-invisible registers are not directly addressed by software so they are given this name. The GDTR (global descriptor table register) and IDTR (interrupt descriptor table reg­ister) contain the base address of the descriptor table and its limit. The TR (task register) holds a selector, which accesses a descriptor that defines a task. A task is most often a procedure or application program.

Faculty of Electronic Engineering – Dept. of Computer Science & Eng. Microprocessors Course The program-invisible register within the Pentium 4 microprocessor.