Microprocessors Introduction to ia32 Architecture Jan 31st, 2002.

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

Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 2 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Microprocessors General Features To be Examined For Each Chip Jan 24 th, 2002.
Intel MP.
Computer Organization and Architecture
Lecture 6 Machine Code: How the CPU is programmed.
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
© 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.
Assembly Language for Intel-Based Computers Chapter 2: IA-32 Processor Architecture Kip Irvine.
Microprocessors Introduction to RISC Mar 19th, 2002.
What is an instruction set?
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.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 2 The Microprocessor and its Architecture.
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.
Monday, October 4 Assignment(s) due: Assignment #5: COMPLEMENT ARITHMETIC Assignment #6: DEBUG EXERCISES Quiz(zes) due:Quiz #5: Base Arithmetic Quiz #6.
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
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,
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
1 Fundamental of Computer Suthida Chaichomchuen : SCC
Low Level Programming Lecturer: Duncan Smeed Overview of IA-32 Part 1.
Types of Registers (8086 Microprocessor Based)
Fall 2012 Chapter 2: x86 Processor Architecture. Irvine, Kip R. Assembly Language for x86 Processors 6/e, Chapter Overview General Concepts IA-32.
The ISA Level The Instruction Set Architecture (ISA) is positioned between the microarchtecture level and the operating system level.  Historically, this.
The x86 Architecture Lecture 15 Fri, Mar 4, 2005.
1 ICS 51 Introductory Computer Organization Fall 2009.
Microprocessors The ia32 User Instruction Set Jan 31st, 2002.
26-Nov-15 (1) CSC Computer Organization Lecture 6: Pentium IA-32.
Computer Architecture EKT 422
80386DX. Programming Model The basic programming model consists of the following aspects: – Registers – Instruction Set – Addressing Modes – Data Types.
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)
3.4 Addressing modes Specify the operand to be used. To generate an address, a segment register is used also. Immediate addressing: the operand is a number.
INTRODUCTION TO INTEL X-86 FAMILY
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
Introduction to Intel IA-32 and IA-64 Instruction Set Architectures.
1 x86 Programming Model Microprocessor Computer Architectures Lab Components of any Computer System Control – logic that controls fetching/execution of.
Intel 8086 MICROPROCESSOR ARCHITECTURE
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.
SOFTWARE ARCHITECTURE OF THE 8088 AND 8086 MICROPROCESSORS
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.
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
Assembly language.
Part of the Assembler Language Programmers Toolbox
UNIT Architecture M.Brindha AP/EIE
Introduction to 8086 Microprocessor
8086 Microprocessor.
Basic Microprocessor Architecture
Assembly IA-32.
Introduction to Assembly Language
BIC 10503: COMPUTER ARCHITECTURE
CS 301 Fall 2002 Computer Organization
The Microprocessor & Its Architecture
Assembly Language (CSW 353)
Computer Architecture CST 250
Introduction to Microprocessor Programming
Presentation transcript:

Microprocessors Introduction to ia32 Architecture Jan 31st, 2002

Memory Structure Addressable units Addressable units Ia32 is byte addressed, with 8-bit Ia32 is byte addressed, with 8-bit Memory size Memory size 4 gigabytes (2**32 bytes) 4 gigabytes (2**32 bytes) Form of Addresses Form of Addresses Segmented, segment address can be implicit Segmented, segment address can be implicit Offset up to 2**32 Offset up to 2**32

More on Memory Size But chip also operates in 8086 mode But chip also operates in 8086 mode Memory size limited to 1 gigabyte, segmented with an offset into the segment of only 64K bytes. Memory size limited to 1 gigabyte, segmented with an offset into the segment of only 64K bytes. Chip Also operates in mode Chip Also operates in mode Memory size limited to 16 gigabytes, segmented with offsets into segment of 64K bytes (but more segments allowed than in 8086 mode). Memory size limited to 16 gigabytes, segmented with offsets into segment of 64K bytes (but more segments allowed than in 8086 mode).

Data Formats Hardware support on ia32 Hardware support on ia32 Integer formats Integer formats Floating formats Floating formats Character Formats Character Formats Pointer/Address formats Pointer/Address formats Other types Other types

Integer Formats Sizes supported (1,2,4byte) Sizes supported (1,2,4byte) Unsigned and Signed Unsigned and Signed Signed format is 2’s complement Signed format is 2’s complement Little-endian Little-endian Little-endian has least significant byte at lowest address Little-endian has least significant byte at lowest address No big-endian operation possible, but there is a byte swap instruction. No big-endian operation possible, but there is a byte swap instruction.

Floating Formats Uses “IEEE” formats Uses “IEEE” formats IEEE = IEEE standard 754/854 IEEE = IEEE standard 754/854 Provides 32- and 64-bit standard formats Provides 32- and 64-bit standard formats Two quite different instruction sets Two quite different instruction sets Old style (“8087”) also has 80-bit format Old style (“8087”) also has 80-bit format New style is only 32 and 64 bit New style is only 32 and 64 bit

Character Formats No specific instructions that know anything about character formats No specific instructions that know anything about character formats But instructions are provided for conveniently working with strings of 8-bit and 16-bit “characters” But instructions are provided for conveniently working with strings of 8-bit and 16-bit “characters” String move String move String scan and compare String scan and compare String store String store

Pointer/Address Formats Used to hold address of memory location Used to hold address of memory location Usually we work entirely within a single segment on the ia32 Usually we work entirely within a single segment on the ia32 So pointers are just an offset in the segment which is a 32-bit unsigned word So pointers are just an offset in the segment which is a 32-bit unsigned word But a full pointer format is a segment number (16 bits) + a 32 bit offset But a full pointer format is a segment number (16 bits) + a 32 bit offset No one uses this format in practice No one uses this format in practice

Other Formats Remember we are talking hardware here Remember we are talking hardware here Packed decimal Packed decimal Two decimal digits stored in one byte Two decimal digits stored in one byte For example 93 stored as hexadecimal 93 For example 93 stored as hexadecimal 93 Used by COBOL programs Used by COBOL programs Provided by the “8087” mode floating-point unit Provided by the “8087” mode floating-point unit Fractional binary (not supported) Fractional binary (not supported) Special graphics/multimedia formats Special graphics/multimedia formats Interesting capabilities, to look at later Interesting capabilities, to look at later Vector/array processing (limited capabilities) Vector/array processing (limited capabilities)

Data Alignment Data alignment is not required, except for the new style of floating-point. What happens if data is misaligned Data alignment is not required, except for the new style of floating-point. What happens if data is misaligned Works, but slower. How much slower? Works, but slower. How much slower? Depends, not too bad for integer, but can be very significant for floating-point Depends, not too bad for integer, but can be very significant for floating-point Keep stuff aligned if at all possible, this is more and more important as time goes on Keep stuff aligned if at all possible, this is more and more important as time goes on

General Register Structure Eight 32-bit Integer registers Eight 32-bit Integer registers eax, ebx, ecx, edx, esi, edi, ebp, esp eax, ebx, ecx, edx, esi, edi, ebp, esp Can also use low order 16 bits of register Can also use low order 16 bits of register ax, bx, cx,dx, dx, si, di, bp, sp ax, bx, cx,dx, dx, si, di, bp, sp Can also use low order 8 bits of some registers Can also use low order 8 bits of some registers al, bl, cl, dl al, bl, cl, dl Used for characters, integers, pointers, basically everything except floating-point values. Used for characters, integers, pointers, basically everything except floating-point values. Every register has special purpose Every register has special purpose For example, ECX used by LOOP instruction For example, ECX used by LOOP instruction ESP is stack pointer ESP is stack pointer ESI is source pointer for string move instruction ESI is source pointer for string move instruction

Segment Registers Six segment registers Six segment registers ES, DS, CS, SS, FS, GS ES, DS, CS, SS, FS, GS From user point of view hold a 16-bit segment number, but in fact are large registers holding a complete segment description From user point of view hold a 16-bit segment number, but in fact are large registers holding a complete segment description Usually used implicitly Usually used implicitly CS used for all code CS used for all code SS used for all stack references SS used for all stack references DS used for all data references DS used for all data references But can be used explicitly in instructions But can be used explicitly in instructions Almost never used in ia32 mode Almost never used in ia32 mode

Flag Registers A series of one-bit registers A series of one-bit registers CF – carry flag CF – carry flag SF – sign flag SF – sign flag OF – overflow flag OF – overflow flag ZF – zero flag ZF – zero flag Etc. Etc. Set by instructions, e.g. add instruction sets flags implicitly: Set by instructions, e.g. add instruction sets flags implicitly: CF if carry CF if carry ZF if result is zero ZF if result is zero OF if result is 2’s complement signed overflow OF if result is 2’s complement signed overflow

Specialized Registers System registers System registers State of floating-point unit State of floating-point unit Rounding mode Rounding mode Precision mode, etc. Precision mode, etc. Debug registers Debug registers Data and instruction debug registers Data and instruction debug registers Other Special registers Other Special registers Interrupt handling Interrupt handling Segment table and task handling Segment table and task handling

Instruction Set What set of operations are available What set of operations are available Gigantic set of all kinds of specialized stuff Gigantic set of all kinds of specialized stuff E.g. instruction for handling addressing in nested subprograms. E.g. instruction for handling addressing in nested subprograms. Instructions for handling task switching Instructions for handling task switching String move/compare String move/compare Decimal addition adjustment Decimal addition adjustment What memory reference instructions What memory reference instructions Many instructions can reference memory, e.g. increment, add to/from memory etc. Many instructions can reference memory, e.g. increment, add to/from memory etc.

Addressing Modes Direct addressing (address in instruction) Direct addressing (address in instruction) Full direct addressing (long instructions. Full direct addressing (long instructions. Indirect through register (simple indexing) Indirect through register (simple indexing) Many other addressing modes Many other addressing modes

Other Addressing Modes Index + Offset (offset in the instruction) Index + Offset (offset in the instruction) Offset is 8, 16, or 32 bits (long instructions) Offset is 8, 16, or 32 bits (long instructions) Double indexing (two regs added) Double indexing (two regs added) Double indexing + offset Double indexing + offset Offset is 8, 16, or 32 bits Offset is 8, 16, or 32 bits Scaling (register multipled by 2,4,8 …) Scaling (register multipled by 2,4,8 …) One of the two registers in double indexing can be scaled by 2, 4, or 8. One of the two registers in double indexing can be scaled by 2, 4, or 8.

Instruction Formats How many different instruction formats How many different instruction formats Dozens of different instruction formats Dozens of different instruction formats No systematic organization at all No systematic organization at all Fixed vs Variable size instructions Fixed vs Variable size instructions Variable length Variable length Uniform vs non-uniform formats Uniform vs non-uniform formats Highly non-uniform Highly non-uniform Size of instructions Size of instructions 1-12 byte instructions 1-12 byte instructions

Instruction Level Parallelism Can instructions execute in parallel? Can instructions execute in parallel? Yes, but this is completely invisible to the programmer Yes, but this is completely invisible to the programmer Program executes as though instructions were executed in sequence one by one Program executes as though instructions were executed in sequence one by one No branch delay slots or any other visible parallelism No branch delay slots or any other visible parallelism This is because of compatibility This is because of compatibility Original machines, e.g. 8086, 80286, and 80386, worked this way Original machines, e.g. 8086, 80286, and 80386, worked this way

Traps What instructions cause traps What instructions cause traps Addressing traps Addressing traps Overflow traps Overflow traps Divide by zero Divide by zero Are traps strictly synchronous? Are traps strictly synchronous? Yes, they appear to be Yes, they appear to be How does machine handle trap? How does machine handle trap? Later … Later …

Interrupts How are external interrupts handled How are external interrupts handled Later … Later … Multiple levels of interrupts Multiple levels of interrupts Yes Yes Interrupt priorities Interrupt priorities Yes Yes Mechanisms for handling interrupts Mechanisms for handling interrupts Later … Later …

Modes of Operation Kernel/supervisor/system mode vs application/program mode Kernel/supervisor/system mode vs application/program mode Four different levels Four different levels Rings of protection Rings of protection Inner ring 0 no restrictions Inner ring 0 no restrictions Outer ring 3 full restrictions Outer ring 3 full restrictions For Example, no I/O For Example, no I/O No messing with segment tables No messing with segment tables No messing with virtual memory tables No messing with virtual memory tables How does operation switch from one mode to another? How does operation switch from one mode to another? Later.. Later..

Handling of I/O Input/Output Instructions Input/Output Instructions Later … Later … Input/Output Channels Input/Output Channels Interaction with processing modes Interaction with processing modes Interrupt handling Interrupt handling

Memory Handling Virtual memory handling Virtual memory handling Virtual address = 32 bits Virtual address = 32 bits Physical address = 32 bits Physical address = 32 bits Mapping uses multi-level tables Mapping uses multi-level tables Handled entirely by hardware Handled entirely by hardware

Caching Issues Mostly a matter of implementation rather than architecture. Mostly a matter of implementation rather than architecture. Caching not visible to ordinary programs Caching not visible to ordinary programs

Parallel Processing Issues Consider building machine with more than one processor Consider building machine with more than one processor Later … Later …

Implementation Issues Does architecture assume specific implementation details Does architecture assume specific implementation details Scheduling Scheduling Caching Caching Pipelining Pipelining Answer is no to all of the above, since high level of compatibility maintained between many different implementations Answer is no to all of the above, since high level of compatibility maintained between many different implementations

Compiler Issues How is code generated for this machine? How is code generated for this machine? Hard work, because so non-uniform Hard work, because so non-uniform Any special problems? Any special problems? Highly non-uniform registers Highly non-uniform registers Too few registers Too few registers Any special features designed to make translation of specific features easier? Any special features designed to make translation of specific features easier? Yes, but they don’t help much Yes, but they don’t help much

Operating Systems Issues How is an Operating System for this machine constructed? How is an Operating System for this machine constructed? Later … Later … Any special features designed to make the life of an OS easier? Any special features designed to make the life of an OS easier? Yes, special instructions for task swiching, state saving, multiple processes accessing virtual memory etc. Yes, special instructions for task swiching, state saving, multiple processes accessing virtual memory etc. But they don’t help much! But they don’t help much!

End of Lecture See you next Tuesday See you next Tuesday Send any problems to class list Send any problems to class list (see class page for how to sign up) (see class page for how to sign up) Assignment: send one message to class list Assignment: send one message to class list Either an interesting question, or just hello! Either an interesting question, or just hello! These slides will be up on the Web in HTML and Power point formats These slides will be up on the Web in HTML and Power point formats