IA-32 Intel® Architecture Software Developer's Manual
Total Page:16
File Type:pdf, Size:1020Kb
IA-32 Intel® Architecture Software Developer’s Manual Volume 1: Basic Architecture NOTE: The IA-32 Intel Architecture Software Developer’s Manual consists of three volumes: Basic Architecture, Order Number 245470-012; Instruction Set Reference, Order Number 245471-012; and the System Programming Guide, Order Number 245472-012. Please refer to all three volumes when evaluating your design needs. 2003 INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL’S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. INTEL PRODUCTS ARE NOT INTENDED FOR USE IN MEDICAL, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS. Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked “reserved” or “undefined.” Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The Intel® IA-32 architecture processors (e.g., Pentium® 4 and Pentium III processors) may contain design defects or errors known as errata. Current characterized errata are available on request. Intel, Intel386, Intel486, Pentium, Intel Xeon, Intel NetBurst, Intel SpeedStep, MMX, Celeron, and Itanium are trademarks or registered trademarks of Intel Corporation and its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others. Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order. Copies of documents which have an ordering number and are referenced in this document, or other Intel literature, may be obtained from: Intel Corporation P.O. Box 7641 Mt. Prospect IL 60056-7641 or call 1-800-879-4683 or visit Intel’s website at http://www.intel.com COPYRIGHT © 1997-2003 INTEL CORPORATION CONTENTS PAGE CHAPTER 1 ABOUT THIS MANUAL 1.1. IA-32 PROCESSORS COVERED IN THIS MANUAL . 1-1 1.2. OVERVIEW OF THE IA-32 INTEL ARCHITECTURE SOFTWARE DEVELOPER’S MANUAL, VOLUME 1: BASIC ARCHITECTURE . 1-2 1.3. NOTATIONAL CONVENTIONS. 1-3 1.3.1. Bit and Byte Order. .1-3 1.3.2. Reserved Bits and Software Compatibility . .1-4 1.3.3. Instruction Operands . .1-5 1.3.4. Hexadecimal and Binary Numbers . .1-5 1.3.5. Segmented Addressing . .1-5 1.3.6. Exceptions. .1-6 1.4. RELATED LITERATURE . 1-6 CHAPTER 2 INTRODUCTION TO THE IA-32 INTEL ARCHITECTURE 2.1. BRIEF HISTORY OF THE IA-32 ARCHITECTURE. 2-1 2.1.1. The First Microprocessors. .2-1 2.1.2. Introduction of Protected Mode Operation. .2-2 2.1.3. Advent of 32-bit Processors . .2-2 2.1.4. The Intel486™ Processor . .2-2 2.1.5. The Intel® Pentium® Processor . .2-3 2.1.6. The P6 Family of Processors . .2-3 2.1.7. The Intel Pentium 4 Processor . .2-5 2.1.8. The Intel® Xeon™ Processor . .2-6 2.1.9. The Intel Pentium M Processor . .2-6 2.2. MORE ON MAJOR TECHNICAL ADVANCES . 2-6 2.2.1. The P6 Family Micro-architecture . .2-7 2.2.2. Streaming SIMD Extensions 2 (SSE2) Technology . .2-8 2.2.3. The Intel® NetBurst™ Micro-Architecture . .2-9 2.2.3.1. The Front End Pipeline. .2-11 2.2.3.2. OUT-OF-order Execution Core. .2-12 2.2.3.3. Retirement Unit. .2-12 2.2.4. Hyper-Threading Technology . .2-12 2.2.4.1. Notes on Implementation . .2-14 2.3. MOORE’S LAW AND IA-32 PROCESSOR GENERATIONS . 2-14 CHAPTER 3 BASIC EXECUTION ENVIRONMENT 3.1. MODES OF OPERATION . 3-1 3.2. OVERVIEW OF THE BASIC EXECUTION ENVIRONMENT . 3-2 3.3. MEMORY ORGANIZATION. 3-5 3.3.1. Modes of Operation vs. Memory Model. .3-7 3.3.2. 32-Bit vs. 16-Bit Address and Operand Sizes . .3-7 3.3.3. Extended Physical Addressing . .3-8 3.4. BASIC PROGRAM EXECUTION REGISTERS . 3-8 3.4.1. General-Purpose Registers. .3-8 3.4.2. Segment Registers . .3-10 iii CONTENTS PAGE 3.4.3. EFLAGS Register . .3-12 3.4.3.1. Status Flags . .3-14 3.4.3.2. DF Flag. .3-15 3.4.4. System Flags and IOPL Field . .3-15 3.5. INSTRUCTION POINTER . 3-16 3.6. OPERAND-SIZE AND ADDRESS-SIZE ATTRIBUTES. 3-16 3.7. OPERAND ADDRESSING. 3-17 3.7.1. Immediate Operands. .3-18 3.7.2. Register Operands . .3-18 3.7.3. Memory Operands. .3-19 3.7.3.1. Specifying a Segment Selector. .3-19 3.7.3.2. Specifying an Offset . .3-20 3.7.3.3. Assembler and Compiler Addressing Modes . .3-22 3.7.4. I/O Port Addressing . .3-22 CHAPTER 4 DATA TYPES 4.1. FUNDAMENTAL DATA TYPES. 4-1 4.1.1. Alignment of Words, Doublewords, Quadwords, and Double Quadwords . .4-2 4.2. NUMERIC DATA TYPES . 4-3 4.2.1. Integers . .4-4 4.2.1.1. Unsigned Integers. .4-4 4.2.1.2. Signed Integers. .4-4 4.2.2. Floating-Point Data Types. .4-5 4.3. POINTER DATA TYPES . 4-7 4.4. BIT FIELD DATA TYPE . 4-7 4.5. STRING DATA TYPES . 4-8 4.6. PACKED SIMD DATA TYPES . 4-8 4.6.1. 64-Bit SIMD Packed Data Types. .4-8 4.6.2. 128-Bit Packed SIMD Data Types. .4-9 4.7. BCD AND PACKED BCD INTEGERS . 4-10 4.8. REAL NUMBERS AND FLOATING-POINT FORMATS. 4-11 4.8.1. Real Number System . .4-12 4.8.2. Floating-Point Format . .4-12 4.8.2.1. Normalized Numbers . .4-14 4.8.2.2. Biased Exponent. .4-14 4.8.3. Real Number and Non-number Encodings . .4-14 4.8.3.1. Signed Zeros . .4-16 4.8.3.2. Normalized and Denormalized Finite Numbers . ..