Microprocessor and Assembly Language Addressing Models

Slides:



Advertisements
Similar presentations
Memory Management Unit
Advertisements

Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
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,
The Microprocessor and its Architecture
Intel MP.
CSC 221 Computer Organization and Assembly Language
Vacuum tubes Transistor 1948 ICs 1960s Microprocessors 1970s.
1 Hardware and Software Architecture Chapter 2 n The Intel Processor Architecture n History of PC Memory Usage (Real Mode)
Memory Management (II)
Chapter 3.2 : Virtual Memory
CS2422 Assembly Language & System Programming September 22, 2005.
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
Protected Mode. Protected Mode (1 of 2) 4 GB addressable RAM –( to FFFFFFFFh) Each program assigned a memory partition which is protected from.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
UNIT 2 Memory Management Unit and Segment Description and Paging
80386DX.
Intel MP (32-bit microprocessor) Designed to overcome the limits of its predecessor while maintaining the software compatibility with the.
1/2002JNM1 With 20 bits, 1,048,576 different combinations are available. Each memory location is assigned a different combination. Each memory location.
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.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
VIRTUAL MEMORY By Thi Nguyen. Motivation  In early time, the main memory was not large enough to store and execute complex program as higher level languages.
System Address Registers/Memory Management Registers Four memory management registers are used to specify the locations of data structures which control.
2003 Dominic Swayne1 Microsoft Disk Operating System and PC DOS CS-550-1: Operating Systems Fall 2003 Dominic Swayne.
Chapter 11 Instruction Sets: Addressing Modes and Formats Gabriel Baron Sydney Chow.
The Microprocessor and Its Architecture A Course in Microprocessor Electrical Engineering Department University of Indonesia.
1 Microprocessors CSE Protected Mode Memory Addressing Remember using real mode addressing we were previously able to address 1M Byte of memory.
Chapter 2 The Microprocessor Architecture Microprocessors prepared by Dr. Mohamed A. Shohla.
Real Mode and Protect Mode 1 Real Mode and Protect Mode Architecture Wannachai Wannasawade.
Fundamentals of Programming Languages-II
Microprocessor and Assembly Language Addressing Models
Internal Programming Architecture or Model
The Microprocessor & Its Architecture A Course in Microprocessor Electrical Engineering Department Universitas 17 Agustus 1945 Jakarta.
CS 140 Lecture Notes: Virtual Memory
Lecture on Real Mode Memory Addressing
Descriptor Table & Register
Memory Management Paging (continued) Segmentation
16.317: Microprocessor System Design I
Presentation on Real Mode Memory Addressing
MICROPROCESSOR BASED SYSTEM DESIGN
Microprocessor and Assembly Language
Microprocessor Systems Design I
Paging COMP 755.
COMBINED PAGING AND SEGMENTATION
Microprocessor Systems Design I
Computer Organization & Assembly Language Chapter 3
Chapter 2 The Microprocessor and its Architecture
Microprocessor and Assembly Language
Subject Name: Microprocesor Subject Code: 10CS45
Chapter 2: The Microprocessor and its Architecture
Operating System Concepts
Operating Modes UQ: State and explain the operating modes of X86 family of processors. Show the mode transition diagram highlighting important features.(10.
Memory Management Paging (continued) Segmentation
CS 301 Fall 2002 Computer Organization
CS 140 Lecture Notes: Virtual Memory
Lecture 36 Syed Mansoor Sarwar
Main Memory Session - 16.
Chapter 2: The Microprocessor and its Architecture
First Generation 32–Bit microprocessor
Assembly Language for Intel-Based Computers, 5th Edition
CS 140 Lecture Notes: Virtual Memory
Memory Management Paging (continued) Segmentation
AKT211 – CAO 05 – x86 Architecture: Intel 8088 (2)
Presentation transcript:

Microprocessor and Assembly Language Addressing Models

Operation Modes 80286 processor and above have four operating modes: Real-address mode: This mode lets the processor to address "real" memory address. It can address up to 1Mbytes of memory (20-bit of address). The first 1 Mbytes of memory is called the real memory, conventional or DOS memory It also be called "unprotected" mode since operating system (such as DOS) code runs in the same mode as the user applications. The processor is set to this mode following by a power-up or a reset and can be switched to protected mode using a single instruction.

Operation Modes Protected mode: System management mode Let the processor address 4GBytes of virtual memory (32-bit address) Preferred mode for a modern operating system (ex. Windows) Use virtual memory and provide protections. System management mode This mode is designed for fast state snapshot and resumption It is useful for power management Virtual-8086 mode: Allows the processor to execute 8086 code software in the protected, multi-tasking environment.

IA-32 Memory Management • Flat model • Real-address mode Memory appears to a program as a single, continuous address space, called a linear address space. Code (a program’s instructions), data, and the procedure stack are all contained in this address space The linear address space is byte addressable, with addresses running contiguously from 0 to 2 32 - 1. • Real-address mode Backward compatible with 8086 Memory appears to a program as a group of independent address spaces called segments Code, data, and stacks are typically contained in separate segments

IA-32 Memory Management Protected Mode Memory Addressing Paging Model Protected mode memory addressing (80286 and above) allows access to data and programs located above the first 1M byte of memory, as well as within the first 1M byte of memory. Protected mode is where Windows operates. Paging Model Memory divided into pages with same size (4k byte) The linear (Virtual) address is defined as the address generated by a program is translated to the physical address which is the actual memory location accessed by a program

Real-address Mode Each segment of memory is 64K in length To access a memory location a combination of a segment address and an offset address are used segment address defines the beginning address of any 64K-byte memory segment offset address selects any location within the 64K byte memory segment

Accessing a memory location The offset address is always added to the segment starting address to locate the data. Segment and offset address is sometimes written as 1000:2000. – A segment address of 1000H; an offset of 2000H In the real mode, each segment register is internally appended with a 0H on its rightmost end. Once the beginning address is known, the ending address is found by adding FFFFH. because a real mode segment of memory is 64K in length

Default Segment and Offset Registers The microprocessor has rules that apply to segments whenever memory is addressed. these define the segment and offset register combination The CS register is always used with the IP to address the next instruction in a program, this combination is CS:IP. For example, if CS=1400H and IP=1200H, the microprocessor fetches its next instruction from memory location 14000H+1200H= 15200H.

Default Segment and Offset Registers Another of the default combinations is the stack. stack data are referenced through the stack segment at the memory location addressed by either the stack pointer (SS:SP) or the base pointer (SS:BP) For example, if SS=2000H and BP=3000H, the microprocessor addresses memory location 23000H for the stack segment memory location.

Default Segment and Offset Registers

Protected Mode Memory Addressing In place of a segment address, the segment register contains a selector that selects a descriptor from a descriptor table it selects one of 8192 descriptors from one of two tables of descriptors The segment register still selects a memory segment, but not directly The descriptor describes the memory segment’s location, length, and access rights The offset address can be a 32-bit number instead of a 16-bit number A 32-bit offset address allows the microprocessor to access data within a segment that can be up to 4G bytes in length.

Selectors The contents of a segment register during protected mode of the 80286 - Core2 microprocessors.

Descriptors There are two descriptor tables used with the segment registers: global descriptors contain segment definitions that apply to all programs local descriptors are usually unique to an application ِِِِِA global descriptor might be called a system descriptor, and local descriptor an application descriptor

Descriptors The 80286 through Core2 64-bit descriptors. Each descriptor is 8 bytes in length,

Descriptors The base address portion of the descriptor indicates the starting location of the memory segment The segment limit contains the last offset address found in a segment. For example, if a segment begins at memory location F00000H and ends at location F000FFH, the base address is F00000H and the limit is FFH. The G bit, or granularity bit. If G=0, the limit specifies a segment limit If G=1, the value of the limit is multiplied by 4K bytes (appended with FFFH) if G=1 This allows a segment length of 4K to 4G bytes in steps of 4K bytes.

Example Shows the segment start and end if the base address is 10000000H, the limit is 001FFH: When G=0 Base = start = 10000000H End = base+ limit = 10000000H + 001FFH =100001FFH When G=1 End = base+ limit = 10000000H + 001FFFFFH =101FFFFFH

Descriptors The AV bit is used by some operating systems to indicate that the segment is available (AV=1 ) or not available ( AV=0) The D bit indicates if the instructions access register and memory data in the protected or real mode D=0 the instructions are 16-bit instructions D=1 the instructions are 32-bit instructions The access rights byte controls access to the protected mode segment