The Microprocessor and its Architecture

Similar documents
Lecture (02) The Microprocessor and Its Architecture By: Dr. Ahmed ElShafee

6/17/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:

Chapter 2: The Microprocessor and its Architecture

EEM336 Microprocessors I. The Microprocessor and Its Architecture

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

SYSC3601 Microprocessor Systems. Unit 2: The Intel 8086 Architecture and Programming Model

Assembler Programming. Lecture 2

Basic Execution Environment

EC-333 Microprocessor and Interfacing Techniques

Hardware and Software Architecture. Chapter 2

Moodle WILLINGDON COLLEGE SANGLI (B. SC.-II) Digital Electronics

Addressing Modes on the x86

Code segment Stack segment

Introduction to IA-32. Jo, Heeseung

INTRODUCTION TO IA-32. Jo, Heeseung

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86

8086 INTERNAL ARCHITECTURE

Intel 8086 MICROPROCESSOR ARCHITECTURE

Complex Instruction Set Computer (CISC)

Intel 8086 MICROPROCESSOR. By Y V S Murthy

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

The x86 Architecture

MICROPROCESSOR MICROPROCESSOR ARCHITECTURE. Prof. P. C. Patil UOP S.E.COMP (SEM-II)

We can study computer architectures by starting with the basic building blocks. Adders, decoders, multiplexors, flip-flops, registers,...

Microprocessor (COM 9323)

MODE (mod) FIELD CODES. mod MEMORY MODE: 8-BIT DISPLACEMENT MEMORY MODE: 16- OR 32- BIT DISPLACEMENT REGISTER MODE

Low Level Programming Lecture 2. International Faculty of Engineerig, Technical University of Łódź

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN

MICROPROCESSOR MICROPROCESSOR ARCHITECTURE. Prof. P. C. Patil UOP S.E.COMP (SEM-II)

x86 Assembly Tutorial COS 318: Fall 2017

The Instruction Set. Chapter 5

16-Bit Intel Processor Architecture

Module 3 Instruction Set Architecture (ISA)

UNIT 2 PROCESSORS ORGANIZATION CONT.

UMBC. A register, an immediate or a memory address holding the values on. Stores a symbolic name for the memory location that it represents.

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

IA32 Intel 32-bit Architecture

A Presentation created By Ramesh.K Press Ctrl+l for full screen view

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.

Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit

CS 16: Assembly Language Programming for the IBM PC and Compatibles

Advanced Microprocessors

Assembly Language Each statement in an assembly language program consists of four parts or fields.

icroprocessor istory of Microprocessor ntel 8086:

Computer Processors. Part 2. Components of a Processor. Execution Unit The ALU. Execution Unit. The Brains of the Box. Processors. Execution Unit (EU)

Dr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD /12/2014 Slide 1

IA32/Linux Virtual Memory Architecture

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013)

9/25/ Software & Hardware Architecture

Internal architecture of 8086

UMBC. contain new IP while 4th and 5th bytes contain CS. CALL BX and CALL [BX] versions also exist. contain displacement added to IP.

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 2: IA-32 Processor Architecture Included elements of the IA-64 bit

Reverse Engineering II: Basics. Gergely Erdélyi Senior Antivirus Researcher

Reverse Engineering II: The Basics

16.317: Microprocessor Systems Design I Spring 2014

Buffer Overflow Attack

CHAPTER 3 BASIC EXECUTION ENVIRONMENT

Introduction to Microprocessor

Marking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313)

Scott M. Lewandowski CS295-2: Advanced Topics in Debugging September 21, 1998

16.317: Microprocessor Systems Design I Fall 2013

1. Introduction to Assembly Language

6/20/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-11: 80x86 Architecture

CC411: Introduction To Microprocessors

CMSC Lecture 03. UMBC, CMSC313, Richard Chang

Architecture of 8086 Microprocessor

Unit 08 Advanced Microprocessor

Instruction Set Architecture (ISA) Data Types

iapx Systems Electronic Computers M

Assembly Language Programming Introduction

Processor Structure and Function

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil

The x86 Architecture. ICS312 - Spring 2018 Machine-Level and Systems Programming. Henri Casanova

eaymanelshenawy.wordpress.com

William Stallings Computer Organization and Architecture 10 th Edition Pearson Education, Inc., Hoboken, NJ. All rights reserved.

MICROPROCESSOR ALL IN ONE. Prof. P. C. Patil UOP S.E.COMP (SEM-II)

ADVANCE MICROPROCESSOR & INTERFACING

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy

Instruction Set Architectures

Lab 2: Introduction to Assembly Language Programming

Northern India Engineering College, Delhi (GGSIP University) PAPER I

Machine-level Representation of Programs. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Registers. Ray Seyfarth. September 8, Bit Intel Assembly Language c 2011 Ray Seyfarth

Project 1: Bootloader. COS 318 Fall 2015

Chapter 11. Addressing Modes

Assembly Language. Lecture 2 - x86 Processor Architecture. Ahmed Sallam

X86 Addressing Modes Chapter 3" Review: Instructions to Recognize"

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 03, SPRING 2013

Assembly Language. Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology. Overview of Assembly Language

Chapter Three Addressing Mode MOV AX, BX

Chapter 3: Addressing Modes

EEM336 Microprocessors I. Addressing Modes

COS 318: Operating Systems. Overview. Prof. Margaret Martonosi Computer Science Department Princeton University

The Pentium Processor

Assembly Language. Lecture 2 x86 Processor Architecture

Access. Young W. Lim Fri. Young W. Lim Access Fri 1 / 18

Q1: Multiple choice / 20 Q2: Memory addressing / 40 Q3: Assembly language / 40 TOTAL SCORE / 100

Reverse Engineering II: The Basics

Computer Architecture 1 ح 303

Transcription:

The Microprocessor and its Architecture

Contents Internal architecture of the Microprocessor: The programmer s model, i.e. The registers model The processor model (organization) Real mode memory addressing using memory segmentation Protected mode memory addressing using memory segmentation Memory paging mechanism

Objectives for this Chapter Describe the function and purpose of programvisible registers Describe the Flags register and the purpose of each flag bit Describe how memory is accessed using segmentation in both the real mode and the protected mode Describe the program-invisible registers Describe the structures and operation of the memory paging mechanism Describe the processor model

The Intel Family

Programming Model General Purpose Registers Special Purpose Registers Segment Registers 80386 and above (32-bit data registers)

General-Purpose Registers The top portion of the programming model contains the general purpose registers: EAX, EBX, ECX, EDX, EBP, ESI, and EDI. Although general in nature, each have a special purpose and name: Can carry both Data & Address offsets EAX Accumulator Used also as AX (16 bit), AH (8 bit), and AL (8 bit) EBX Base Index often used to hold offset address of a memory location (BX, BH, and BL)

General-Purpose Registers (continued) ECX count, for shifts, rotates, and loops (CX, CH, and CL) EDX data, used with multiply and divide (DX, DH, and DL) EBP base pointer used to address stack data (BP) ESI source index (SI) for memory locations, e.g. with string instructions EDI destination index (DI) for memory locations string operations

Special-Purpose Registers ESP, EIP, and EFLAGS Each has a specific task ESP Stack pointer: addresses the stack segment used with functions (procedures) (SP) EIP Instruction Pointer: addresses the next instruction in a program in the code segment (IP) EFLAGS indicates latest conditions of the microprocessor (FLAGS)

EFLAGS 80386DX

The Flags Basic Flag Bits (8086 etc.) C Carry/borrow of result also show error conditions P the parity flag odd or even parity (little used today) A auxiliary flag used with BCD arithmetic, e.g. using DAA and DAS (decimal adjust after add/sub) Z zero S sign (-ve (S=1)or +ve (S=0)) O Overflow D direction - Determines auto incr/dec direction for string instructions (STD, CLD) I interrupt- Enables (using STI) or disables (using CLI) the processing of hardware interrupts arriving at the INTR input pin T Trap- (turns trapping on/off for program debugging)

Newer Flag Bits IOPL 2-bit I/O privilege level in protected mode NT nested task RF resume flag (used with debugging) VM virtual mode: multiple DOS programs each with a 1 MB memory partition AC alignment check: detects addressing on wrong boundary for words/double words VIF virtual interrupt flag VIP virtual interrupt pending ID = CPUID instruction available The instruction gives info on CPU version and manufacturer

Segment Registers The segment registers are: CS (code), DS (data), ES (extra data. used with string instructions), SS (stack), FS, and GS. Segment registers define a section of memory (segment) for a program. A segment is either 64K (2 16 ) bytes of fixed length (in the real mode) or up to 4G (2 32 ) bytes of variable length (in the protected mode). All code (programs) reside in the code segment.

Real Mode Memory Addressing The only mode available on for 8088-8086 Real mode memory is the first 1M (2 20 ) bytes of the memory system (real, conventional, DOS memory) All real mode 20-bit addresses are a combination of a segment address (in a segment register) plus an offset address (in another register) The segment register address (16-bits) is appended with a 0H or 0000 2 (or multiplied by 10H) to form a 20-bit start of segment address The effective memory address = this 20-bit segment address + a 16-bit offset address in a register Segment length is fixed = 2 16 = 64K bytes

(11 MB) EA (Effective Address) 20-bit (5-byte) Physical Memory address 64 KB Segment + 16-bit Appended byte 0H

Effective Address Calculations EA = segment register (SR) x 10H plus offset (a) SR: 1000H 10000 + 0023 = 10023 (b) SR: AAF0H AAF00 + 0134 = AB034 (c) SR: 1200H 12000 + FFF0 = 21FF0

Overlapping segments Top of CS: 090F0 FFFF+ 190EF

Defaults CS for program (code) SS for stack DS for data ES for string destination Default offset addresses that go with them: Segment Offset (16-bit) Offset (32-bit) Purpose 8080, 8086, 80286 80386 and above CS IP EIP Program SS SP, BP ESP, EBP Stack DS BX, DI, SI, 8-bit or 16-bit # EAX, EBX, ECX, EDX, ESI, EDI, 8-bit or 32-bit # Data ES DI EDI String destination

Segmentation: Pros and Cons Advantages: Allows easy and efficient relocation of code and data A program can be located anywhere in memory without any change to the program Program writing needs not worry about actual memory structure of the computer used to execute it To relocate code or data only the segment number needs to be changed Disadvantages: Complex hardware and for address generation Software: Programs limited by segment size 64KB with the 8086) (only

Limitations of the above real mode segmentation scheme Segment size is fixed at 64 KB Segment can not begin at an arbitrary memory address With 20-bit memory addressing, can only begin at addresses starting with 0H, i.e. at 16 byte intervals Difficult to use with 24 or 32-bit memory addressing with segment registers remaining at 16-bits 80286 and above use 24, 32, 36 bit addresses but still 16- bit segment registers Use memory segmentation in the protected mode