SYSC30061 The Intel 80x86 Thorne : Section 1.4-1.6, 2.2.4, Section 3.4 (Irvine, Edition IV : Section 2.2)

Slides:



Advertisements
Similar presentations
Register In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than.
Advertisements

Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 2 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
Parul Polytechnic Institute
Introduction to 8086 Microprocessor
SOFTWARE ARCHITECTURE OF THE 8088 AND 8086 MICROPROCESSORS
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
Azir ALIU 1 What is an assembly language?. Azir ALIU 2 Inside the CPU.
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.
3-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 (8086) Microprocessor.
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.
80x86 Processor Architecture
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
Gursharan Singh Tatla Block Diagram of Intel 8086 Gursharan Singh Tatla 19-Apr-17.
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
The 8086 Microprocessor The 8086, announced in 1978, was the first 16-bit microprocessor introduced by Intel Corporation 8086 is 16-bit MPU. Externally.
An Introduction to 8086 Microprocessor.
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 Fundamental of Computer Suthida Chaichomchuen : SCC
Types of Registers (8086 Microprocessor Based)
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
UHD:CS2401: A. Berrached1 The Intel x86 Hardware Organization.
Microprocessor Microprocessor (cont..) It is a 16 bit μp has a 20 bit address bus can access upto 220 memory locations ( 1 MB). It can support.
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE LECTURE # 4 BY MUHAMMAD JAFER 1.
(-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.
Intel 8086 (8088) Microprocessor Structure
INTRODUCTION TO INTEL X-86 FAMILY
University of Sargodha, Lahore Campus Prepared by Ali Saeed.
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
Internal Programming Architecture or Model
1 x86 Programming Model Microprocessor Computer Architectures Lab Components of any Computer System Control – logic that controls fetching/execution of.
Intel 8086 MICROPROCESSOR ARCHITECTURE
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
BITS Pilani Pilani Campus Pawan Sharma Lecture / ES C263 INSTR/CS/EEE F241 Microprocessor Programming and Interfacing.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
SOFTWARE ARCHITECTURE OF THE 8088 AND 8086 MICROPROCESSORS
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Computer Science 516 Intel x86 Overview. Intel x86 Family Eight-bit 8080, 8085 – 1970s 16-bit 8086 – was internally 16 bits, externally 8 bits.
ΜComputer Structure μProcessor Memory Bus System I/O Ports.
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
An Introduction to 8086 Microprocessor.
UNIT Architecture M.Brindha AP/EIE
Introduction to 8086 Microprocessor
8086 Microprocessor.
Computer Organization & Assembly Language Chapter 3
ADDRESSING MODES.
Intel 8086 MICROPROCESSOR Architecture.
ADDRESSING MODES.
University of Gujrat Department of Computer Science
Intel 8088 (8086) Microprocessor Structure
Basic of Computer Organization
Introduction to Assembly Language
University of Gujrat Department of Computer Science
Intel 8088 (8086) Microprocessor Structure
8086 Registers Module M14.2 Sections 9.2, 10.1.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
CS 301 Fall 2002 Computer Organization
The Microprocessor & Its Architecture
Lecture 06 Programming language.
Computer Architecture CST 250
Unit-I 80386DX Architecture
Process.
Intel 8086.
Part I Data Representation and 8086 Microprocessors
Presentation transcript:

SYSC30061 The Intel 80x86 Thorne : Section , 2.2.4, Section 3.4 (Irvine, Edition IV : Section 2.2)

SYSC30062 Getting to Know a Microprocessor. Any processor is characterized by its : 1.Register Set General purpose, addressing, control/status registers 2.Instruction set Includes addressing modes 3.Interrupt mechanism (later!) We will study Intel 8086 which is the start of the 80x86 family tree. –All programming registers are 16-bit –16-bit data bus and 20-bit address bus –I/O mapped with 8-bit and 16-bit ports (later) –Each descendant – right up to the P6 processor family – are backward compatible Same basic set of registers … but wider Same basic instructions … but more Same interrupt mechanism

SYSC x86 Family of Processors Like most texts, in Irvine and Thorne, you will encounter : Intel bit registers,16-bit data bus, 20-bit address bus Intel Same as 8086 but 24-bit address bus and “protected mode” IA bit registers and data bus, 32-bit address bus P6 Extended and improved IA-32 architecture for performance Multitasking 20-bit address bus: up to 1M byte memory space (2 20 ) 24-bit 16M(2 24 ) 32-bit 4G (2 32 ) 36-bit 64G(2 36 )

SYSC30064 Modes of Operation Real-Address Mode (DOS) –Microprocessor is acting like a Meg address space, 8086 instructions only, one program can run Can access all memory and I/O hardware directly Protected Mode –All instructions and features are available. –Multiple programs can run. Each program given separate memory areas (called segments) and CPU ensures accesses outside its segments are prevented. Memory address is no longer “real”; within your program’s area Virtual 8086 Mode –While running in Protected Mode, lets a program run in real-address mode –Running a DOS program under Windows (DOS command window) …. But Windows prevents access to some addresses/hardware This is the reason why we use DOS in this course. Systems Management Mode –Provides an operating system that has functions for system security –Used by computer manufacturers to customize processors

SYSC M-byte Memory Map of 8086 B. Brey, The Intel Microprocessors, 7th ed, 2006 Interrupt Vectors

SYSC Register Set 16-Bit General Purpose Registers – can access all 16-bits at once – can access just high (H) byte, or low (L) byte AH AL BH BL CH CL DH DL 8-bit 16-bit only the General Purpose registers allow access as 8-bit High/Low sub-registers AX BX CX DX AH AL EAX 32-bit For interested students : These registers in extended to 32-bits in the IA- 32 family (Accumulator) (Base) (Count ) (Data)

SYSC Register Set 16-Bit Segment Addressing Registers CSCode Segment DSData Segment SSStack Segment ESExtra Segment 16-Bit Offset Addressing Registers SPStack Pointer BPBase Pointer SISource Index DIDestination Index

SYSC Register Set 16-Bit Control/Status Registers IP: Instruction Pointer (Program Counter for execution control) FLAGS:16-bit register It is not a 16-bit value but it is a collection of 9 bit-flags (7 bits are unused) Flag is set when it is equal to 1 Flag is clear when it is equal to 0 Control Flags DFDirectionUsed in string instructions for moving forward/backward through string IFInterruptUsed to enable/disable interrupts (Later) TFTrapUsed to enable/disable single-step trap (Later) OFDFIFTFSFZFAFPFCF Flags register

SYSC Register Set Status Flags (Arithmetic flag) Flags are set and cleared as “side-effects” of an instruction Part of learning an instruction is learning what flags is writes There are instructions that “read” a flag and indicate whether or not that flag is set (1) or cleared (0). Status FlagName CFCarry PFParity AFAuxiliary Carry OFOverflow SFSign ZFZero

SYSC Register Set There are other registers that are part of the programmer’s model but are internal to the CPU –They support the execution of instructions Example : IRInstruction Register Example : ALU input/output registers are temporary registers (scratchpad values) –They cannot be accessed directly by programmers –May be larger than 16-bits

Registers in CPU SYSC Central processing unit (CPU) Bus interface unit (BIU) Execution unit (EU) AX (= AH +AL) BX (= BH +BL) CX (= CH +CL) DX (= DH +DL) BP SP SI DI CS DS SS ES IP Instruction register Flags register

SYSC Intel Segmented Memory Model for 20-bit Address Space Processor Design Problem: How can 16-bit registers and values be used to specify 20-bit addresses? –Want to use 16-bit registers to refer to memory addresses (e.g. for indirect addressing modes)  One way: Use two registers “side-by-side” 0 X 20 bits 16 bits 8 bits X X X

SYSC Intel Segmented Memory Model for 20-bit Address Space Real-Address Mode (8086 and not later family members) On top of the linear address space (from 0 to 1 Meg-1), you can overlay a set of overlapping “segments” –Linear address space becomes known as the absolute address (20-bit value) –A segment is defined as a sequence of bytes that Starts every 16-bytes –Every segment starts on an absolute address that ends in 0 (hex) Absolute address ↔ Segment:Offset Address offset : 2 bytes (16 bits ) Has a length of 64K consecutive bytes (64K = FFFFh) –Hints : 2 16 = 64K and all the 8086 registers are 16-bits wide

SYSC Intel Segmented Memory Model for 20-bit Address Space Segment 0 starts at absolute address 00000H and goes to 0FFFFh Segment 1 starts at absolute address 00010H and goes to 1000Fh (=0FFFFh+10h) Segment 2 starts at absolute address 00020H and goes to 1001FH (=0FFFFh+20h) * Starts every 16-bytes (10h=16d) 1.A particular byte can be located by giving the segment number and the offset within that segment. 2.A particular byte is located within more than one segment Segment i overlaps segment i + 1

SYSC Intel Segmented Memory Model for 20-bit Address Space 00000H 00010H 00020H … 0FFFFh 1000Fh 1001Fh … n*00010 n*10H + 0FFFFh … Segment 0 Segment 1 Segment n 20-bit Linear or Absolute Address Segment 2 …

SYSC Intel Segmented Memory Model for 20-bit Address Space At the hardware level : –An address is put on the Address Bus as a 20-bit linear address (absolute address) From the Software (Programmer’s) Perspective: –Addresses are NEVER specified as 20-bit values –Addresses are ALWAYS specified as two 16-bit values : segment:offset Who does the conversion ? –The CPU does the conversion (eg. during the fetch of an instruction) –As a programmer, you always use segment:offset (Recall segment addressing registers: CS, DS, SS, ES)

SYSC M-byte Memory Map of 8086 B. Brey, The Intel Microprocessors, 7th ed, 2006

SYSC Intel Segmented Memory Model for 20-bit Address Space How does the CPU convert from segment:offset to absolute ? –Recall : Each segment starts at 16-byte boundary –Start address of a segment = segment number * –Hint : Is there a shortcut for multiplying by 16 when working in binary(hex) ? s 3 s 2 s 1 s 0 o 3 o 2 o 1 o 0 s 3 s 2 s 1 s bit segment start address offset a 4 a 3 a 2 a 1 a 0 20-bit address determined by segment number Segment→ Offset → Segment * 10h → Absolute Address

SYSC Intel Segmented Memory Model for 20-bit Address Space Example: Suppose we have segment number = 6020H and offset = 4267H segment * 10H  H + offset  4267 H 20-bit address H 20-bit address Absolute Address

SYSC Intel Segmented Memory Model for 20-bit Address Space Remember : An Ugly Side Effect of Segmented Memory –Each memory byte can be referred to by many different SEG:OFS pairs Example: The (unique) byte at address H can be referred to by: 0 H : 300 H 1 H : 2F0 H 30 H : 0 H ( more too ! )

SYSC How is segmented memory managed by the 8086 ? 8086 includes four 16-bit SEGMENT registers: –CS :Code Segment Register –DS :Data Segment Register –SS :Stack Segment Register –ES :Extra Segment Register Segment registers are used by default as the segment values during certain memory access operations –All instruction fetches:CS : IP –“most” data access:DS : offset Since the processor uses contents of DS as the 16-bit segment value when fetching data, the programmer only needs to supply the 16-bit offset in instructions) BUT segments must be initialized before use (Later!)

SYSC Let’s refine the Instruction Execution Cycle … Processor executes instruction by repeating: do{ Fetch instruction: IR := mem[ CS:IP ] and adjust IP to point to next sequential instruction Execute instruction in IR } until HLT instruction has been executed some interrupt stuff goes here ! more later! inherently sequential behaviour! Notation := “gets loaded from”

SYSC Let’s refine the Instruction Execution Cycle … What is an instruction ? –On the Intel 8086, an instruction is a sequence of 1..6 bytes We shall learn more about it later, but a simple (and incomplete) model of an instruction is as follows : Common mistake : Do not apply little endian to an instruction. –Little endian only applies to word operations, not sequences of bytes. Opcode Destination Operand, if needed Source if needed Operand Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6 Tells what kind of instruction, How many bytes…

SYSC Let’s refine the Instruction Execution Cycle … C08 13C09 13C0A 13C0B 13C0E 3 bytes of instruction 4 bytes of next instruction A6 12 IR 3C08 IP 4B 36 FF FFFFF Processor 1000 CS “previous” instruction Before fetch: Address of “next” instruction Absolute (linear) address = CS * 10h + IP The first byte (opcode) of instruction tells the number of bytes to be fetched.

SYSC Let’s refine the Instruction Execution Cycle … After fetch: B 36 FF IR 3C0B IP 4B 36 FF FFFFF Processor 1000 CS 13C08 13C09 13C0A 13C0B 13C0E 3 bytes of instruction 4 bytes of next instruction “fetched” instruction