CIS-261 Home
http://www.c-jump.com/bcc/
Intel Volume 1: Basic Architecture
- Volume 1: Basic Architecture
- TABLE OF CONTENTS
- CHAPTER 1. ABOUT THIS MANUAL
- 1.1.OVERVIEW OF THE INTEL ARCHITECTURE SOFTWARE
- 1.4.NOTATIONAL CONVENTIONS
- 1.4.1.Bit and Byte Order
- CHAPTER 2. INTRODUCTION TO THE INTEL ARCHITECTURE
- 2.2.INCREASING INTEL ARCHITECTURE PERFORMANCE AND
- 2.5.DETAILED DESCRIPTION OF THE P6 FAMILY PROCESSOR
- 2.5.1.Memory Subsystem
- CHAPTER 3. BASIC EXECUTION ENVIRONMENT
- 3.1.MODES OF OPERATION
- 3.2.OVERVIEW OF THE BASIC EXECUTION ENVIRONMENT
- 3.3.MEMORY ORGANIZATION
- 3.4.MODES OF OPERATION
- 3.5.32-BIT VS. 16-BIT ADDRESS AND OPERAND SIZES
- 3.6.REGISTERS
- 3.6.2.Segment Registers
- 3.6.3.EFLAGS Register
- 3.6.3.1.STATUS FLAGS
- 3.6.3.2.DF FLAG
- 3.6.4.System Flags and IOPL Field
- 3.7.INSTRUCTION POINTER
- 3.8.OPERAND-SIZE AND ADDRESS-SIZE ATTRIBUTES
- CHAPTER 4. PROCEDURE CALLS, INTERRUPTS, AND EXCEPTIONS
- 4.1.PROCEDURE CALL TYPES
- 4.2.STACK
- 4.2.4.Procedure Linking Information
- 4.2.4.1.STACK-FRAME BASE POINTER
- 4.2.4.2.RETURN INSTRUCTION POINTER
- 4.3.3.Parameter Passing
- 4.3.3.1.PASSING PARAMETERS THROUGH THE GENERAL-PURPOSE
- 4.3.3.2.PASSING PARAMETERS ON THE STACK
- 4.3.3.3.PASSING PARAMETERS IN AN ARGUMENT LIST
- 4.3.4.Saving Procedure State Information
- 4.3.5.Calls to Other Privilege Levels
- 4.4.INTERRUPTS AND EXCEPTIONS
- 4.4.1.Call and Return Operation for Interrupt or Exception
- 4.5.PROCEDURE CALLS FOR BLOCK-STRUCTURED
- 4.5.1.ENTER Instruction
- 4.5.2.LEAVE Instruction
- CHAPTER 5. DATA TYPES AND ADDRESSING MODES
- 5.1.FUNDAMENTAL DATA TYPES
- 5.1.1.Alignment of Words, Doublewords, and Quadwords
- 5.2.NUMERIC, POINTER, BIT FIELD, AND STRING DATA TYPES
- 5.2.1.Integers
- 5.2.2.Unsigned Integers
- 5.2.3.BCD Integers
- 5.2.4.Pointers
- 5.2.5.Bit Fields
- 5.2.6.Strings
- 5.2.7.Floating-Point Data Types
- 5.2.8.MMX Technology Data Types
- 5.2.9.Streaming SIMD Extensions Data Types
- 5.3.OPERAND ADDRESSING
- 5.3.1.Immediate Operands
- 5.3.2.Register Operands
- 5.3.3.Memory Operands
- 5.3.3.1.SPECIFYING A SEGMENT SELECTOR
- 5.3.3.2.SPECIFYING AN OFFSET
- 5.3.3.3.ASSEMBLER AND COMPILER ADDRESSING MODES
- 5.3.4.I/O Port Addressing
- CHAPTER 6. INSTRUCTION SET SUMMARY
- 6.1.NEW INTEL ARCHITECTURE INSTRUCTIONS
- 6.1.1.New Instructions Introduced with the Streaming SIMD
- 6.1.2.New Instructions Introduced with the MMX Technology
- 6.1.3.New Instructions in the Pentium
- 6.1.4.New Instructions in the Pentium
- 6.1.5.New Instructions in the Intel486 Processor
- 6.2.INSTRUCTION SET LIST
- 6.2.1.Integer Instructions
- 6.2.1.1.DATA TRANSFER INSTRUCTIONS
- 6.2.1.2.BINARY ARITHMETIC INSTRUCTIONS
- 6.2.1.3.DECIMAL ARITHMETIC
- 6.2.1.4.LOGIC INSTRUCTIONS
- 6.2.1.5.SHIFT AND ROTATE INSTRUCTIONS
- 6.2.1.6.BIT AND BYTE INSTRUCTIONS
- 6.2.1.7.CONTROL TRANSFER INSTRUCTIONS
- 6.2.1.8.STRING INSTRUCTIONS
- 6.2.1.9.FLAG CONTROL INSTRUCTIONS
- 6.2.1.10.SEGMENT REGISTER INSTRUCTIONS
- 6.2.1.11.MISCELLANEOUS INSTRUCTIONS
- 6.2.2.MMX Technology Instructions
- 6.2.2.1.MMX DATA TRANSFER INSTRUCTIONS
- 6.2.2.2.MMX CONVERSION INSTRUCTIONS
- 6.2.2.3.MMX PACKED ARITHMETIC INSTRUCTIONS
- 6.2.2.4.MMX COMPARISON INSTRUCTIONS
- 6.2.2.5.MMX LOGIC INSTRUCTIONS
- 6.2.2.6.MMX SHIFT AND ROTATE INSTRUCTIONS
- 6.2.2.7.MMX STATE MANAGEMENT
- 6.2.3.Floating-Point Instructions
- 6.2.3.1.DATA TRANSFER
- 6.2.3.2.BASIC ARITHMETIC
- 6.2.3.3.COMPARISON
- 6.2.3.4.TRANSCENDENTAL
- 6.2.3.5.LOAD CONSTANTS
- 6.2.3.6.FPU CONTROL
- 6.2.4.System Instructions
- 6.2.5.1.STREAMING SIMD EXTENSIONS DATA TRANSFER INSTRUCTIONS
- 6.2.5.2.STREAMING SIMD EXTENSIONS CONVERSION INSTRUCTIONS
- 6.2.5.3.STREAMING SIMD EXTENSIONS PACKED ARITHMETIC
- 6.2.5.4.STREAMING SIMD EXTENSIONS COMPARISON INSTRUCTIONS
- 6.2.5.5.STREAMING SIMD EXTENSIONS LOGICAL INSTRUCTIONS
- 6.2.5.6.STREAMING SIMD EXTENSIONS DATA SHUFFLE INSTRUCTIONS
- 6.2.5.7.STREAMING SIMD EXTENSIONS ADDITIONAL SIMD-INTEGER
- 6.2.5.8.STREAMING SIMD EXTENSIONS CACHEABILITY CONTROL
- 6.2.5.9.STREAMING SIMD EXTENSIONS STATE MANAGEMENT
- 6.3.DATA MOVEMENT INSTRUCTIONS
- 6.3.1.General-Purpose Data Movement Instructions
- 6.3.1.1.MOVE INSTRUCTION
- 6.3.1.2.CONDITIONAL MOVE INSTRUCTIONS
- 6.3.1.3.EXCHANGE INSTRUCTIONS
- 6.3.2.Stack Manipulation Instructions
- 6.3.2.1.TYPE CONVERSION INSTRUCTIONS
- 6.3.2.2.SIMPLE CONVERSION
- 6.3.2.3.MOVE AND CONVERT
- Stack
- 6.4.BINARY ARITHMETIC INSTRUCTIONS
- 6.4.1.Addition and Subtraction Instructions
- 6.4.2.Increment and Decrement Instructions
- 6.4.3.Comparison and Sign Change Instruction
- 6.4.4.Multiplication and Divide Instructions
- 6.5.DECIMAL ARITHMETIC INSTRUCTIONS
- 6.5.1.Packed BCD Adjustment Instructions
- 6.5.2.Unpacked BCD Adjustment Instructions
- 6.6.LOGICAL INSTRUCTIONS
- 6.7.SHIFT AND ROTATE INSTRUCTIONS
- 6.7.1.Shift Instructions
- 6.7.2.Double-Shift Instructions
- 6.7.3.Rotate Instructions
- 6.8.BIT AND BYTE INSTRUCTIONS
- 6.8.1.Bit Test and Modify Instructions
- 6.8.2.Bit Scan Instructions
- 6.8.3.Byte Set on Condition Instructions
- 6.8.4.Test Instruction
- 6.9.CONTROL TRANSFER INSTRUCTIONS
- 6.9.1.Unconditional Transfer Instructions
- 6.9.1.1.JUMP INSTRUCTION
- 6.9.1.2.CALL AND RETURN INSTRUCTIONS
- 6.9.1.3.RETURN FROM INTERRUPT INSTRUCTION
- 6.9.2.1.CONDITIONAL JUMP INSTRUCTIONS
- 6.9.2.Conditional Transfer Instructions
- 6.9.2.2.LOOP INSTRUCTIONS
- 6.9.2.3.JUMP IF ZERO INSTRUCTIONS
- 6.9.3.Software Interrupts
- 6.10.STRING OPERATIONS
- 6.10.1.Repeating String Operations
- 6.11.I/O INSTRUCTIONS
- 6.12.ENTER AND LEAVE INSTRUCTIONS
- 6.13.1.Carry and Direction Flag Instructions
- 6.13.2.Interrupt Flag Instructions
- 6.13.3.EFLAGS Transfer Instructions
- 6.13.4.Interrupt Flag Instructions
- 6.14.SEGMENT REGISTER INSTRUCTIONS
- 6.14.1.Segment-Register Load and Store Instructions
- 6.14.2.Far Control Transfer Instructions
- 6.14.3.Software Interrupt Instructions
- 6.14.4.Load Far Pointer Instructions
- 6.15.MISCELLANEOUS INSTRUCTIONS
- 6.15.1.Address Computation Instruction
- 6.15.2.Table Lookup Instructions
- 6.15.3.Processor Identification Instruction
- 6.15.4.No-Operation and Undefined Instructions
- CHAPTER 7. FLOATING-POINT UNIT
- 7.1.COMPATIBILITY AND EASE OF USE OF THE INTEL
- 7.2.REAL NUMBERS AND FLOATING-POINT FORMATS
- 7.2.1.Real Number System
- 7.2.2.Floating-Point Format
- 7.2.2.1.NORMALIZED NUMBERS
- 7.2.2.2.BIASED EXPONENT
- 7.2.3.Real Number and Non-number Encodings
- 7.2.3.1.SIGNED ZEROS
- 7.2.3.2.NORMALIZED AND DENORMALIZED FINITE NUMBERS
- 7.2.3.3.SIGNED INFINITIES
- 7.2.3.4.NANS
- 7.2.4.Indefinite
- 7.3.FPU ARCHITECTURE
- 7.3.1.FPU Data Registers
- 7.3.1.1.PARAMETER PASSING WITH THE FPU REGISTER STACK
- 7.3.2.FPU Status Register
- 7.3.2.1.TOP OF STACK (TOP) POINTER
- 7.3.2.2.CONDITION CODE FLAGS
- 7.3.2.3.EXCEPTION FLAGS
- 7.3.2.4.STACK FAULT FLAG
- 7.3.3.Branching and Conditional Moves on FPU Condition
- 7.3.4.FPU Control Word
- 7.3.4.1.EXCEPTION-FLAG MASKS
- 7.3.4.2.PRECISION CONTROL FIELD
- 7.3.4.3.ROUNDING CONTROL FIELD
- 7.3.5.Infinity Control Flag
- 7.3.6.FPU Tag Word
- 7.3.7.FPU Instruction and Operand (Data) Pointers
- 7.3.8.Last Instruction Opcode
- 7.3.9.Saving the FPU's State
- 7.4.FLOATING-POINT DATA TYPES AND FORMATS
- 7.4.1.Real Numbers
- 7.4.2.Binary Integers
- 7.4.3.Decimal Integers
- 7.4.4.Unsupported Extended-Real Encodings
- 7.5.1.Escape (ESC) Instructions
- 7.5.2.FPU Instruction Operands
- 7.5.3.Data Transfer Instructions
- 7.5.4.Load Constant Instructions
- 7.5.5.Basic Arithmetic Instructions
- 7.5.6.Comparison and Classification Instructions
- 7.5.6.1.BRANCHING ON THE FPU CONDITION CODES
- 7.5.7.Trigonometric Instructions
- 7.5.8.Pi
- 7.5.9.Logarithmic, Exponential, and Scale
- 7.5.10.Transcendental Instruction Accuracy
- 7.5.11.FPU Control Instructions
- 7.5.12.Waiting Vs. Non-waiting Instructions
- 7.5.13.Unsupported FPU Instructions
- 7.6.OPERATING ON NANS
- 7.6.1.Operating on NaNs with Streaming SIMD Extensions
- 7.6.2.Uses for Signaling NANs
- 7.6.3.Uses for Quiet NANs
- 7.7.FLOATING-POINT EXCEPTION HANDLING
- 7.7.1.Arithmetic vs. Non-arithmetic Instructions
- 7.7.2.Automatic Exception Handling
- 7.7.3.Software Exception Handling
- 7.7.3.1.NATIVE MODE
- 7.7.3.2.MS-DOS* COMPATIBILITY MODE
- 7.7.3.3.TYPICAL FLOATING-POINT EXCEPTION HANDLER ACTIONS
- 7.8.FLOATING-POINT EXCEPTION CONDITIONS
- 7.8.1.Invalid Operation Exception
- 7.8.1.1.STACK OVERFLOW OR UNDERFLOW EXCEPTION (#IS)
- 7.8.1.2.INVALID ARITHMETIC OPERAND EXCEPTION (#IA)
- 7.8.2.Divide-By-Zero Exception (#Z)
- 7.8.3.Denormal Operand Exception (#D)
- 7.8.4.Numeric Overflow Exception (#O)
- 7.8.6.Inexact Result (Precision) Exception (#P)
- 7.8.7.Exception Priority
- 7.9.FLOATING-POINT EXCEPTION SYNCHRONIZATION
- CHAPTER 8. PROGRAMMING WITH THE INTEL MMX TECHNOLOGY
- 8.1.OVERVIEW OF THE MMX TECHNOLOGY PROGRAMMING
- 8.1.3.Single Instruction, Multiple Data (SIMD) Execution Model
- 8.1.4.Memory Data Formats
- 8.1.1.MMX Registers
- 8.1.2.MMX Data Types
- 8.1.5.Data Formats for MMX Registers
- 8.2.MMX INSTRUCTION SET
- 8.2.1.Saturation Arithmetic and Wraparound Mode
- 8.2.2.Instruction Operands
- 8.3.OVERVIEW OF THE MMX INSTRUCTION SET
- 8.3.1.Data Transfer Instructions
- 8.3.2.Arithmetic Instructions
- 8.3.3.Comparison Instructions
- 8.3.2.1.PACKED ADDITION AND SUBTRACTION
- 8.3.2.2.PACKED MULTIPLICATION
- 8.3.2.3.PACKED MULTIPLY ADD
- 8.3.4.Conversion Instructions
- 8.3.5.Logical Instructions
- 8.3.6.Shift Instructions
- 8.3.7.EMMS (Empty MMX State) Instruction
- 8.4.COMPATIBILITY WITH FPU ARCHITECTURE
- 8.4.1.MMX Instructions and the Floating-Point Tag Word
- 8.4.2.Effect of Instruction Prefixes on MMX Instructions
- 8.5.WRITING APPLICATIONS WITH MMX CODE
- 8.5.1.Detecting Support for MMX Technology Using the
- 8.5.2.Using the EMMS Instruction
- 8.5.3.Interfacing with MMX Code
- 8.5.4.Writing Code with MMX and Floating-Point Instructions
- 8.5.4.1.RECOMMENDATIONS AND GUIDELINES
- 8.5.5.Using MMX Code in a Multitasking Operating System
- 8.5.5.1.COOPERATIVE MULTITASKING OPERATING SYSTEM
- 8.5.5.2.PREEMPTIVE MULTITASKING OPERATING SYSTEM
- 8.5.6.Exception Handling in MMX Code
- 8.5.7.Register Mapping
- CHAPTER 9. PROGRAMMING WITH THE STREAMING SIMD EXTENSIONS
- 9.1.OVERVIEW OF THE STREAMING SIMD EXTENSIONS
- 9.1.1.SIMD Floating-Point Registers
- 9.1.2.SIMD Floating-Point Data Types
- 9.1.3.Single Instruction, Multiple Data (SIMD) Execution Model
- 9.1.4.Pentium
- 9.1.5.Memory Data Formats
- 9.1.6.SIMD Floating-Point Register Data Formats
- 9.1.7.SIMD Floating-Point Control/Status Register
- 9.1.8.Rounding Control Field
- 9.1.9.Flush-To-Zero
- 9.2.STREAMING SIMD EXTENSIONS SET
- 9.2.1.Instruction Operands
- 9.3.OVERVIEW OF THE STREAMING SIMD EXTENSIONS SET
- 9.3.1.Data Movement Instructions
- 9.3.2.Arithmetic Instructions
- 9.3.2.1.PACKED/SCALAR ADDITION AND SUBTRACTION
- 9.3.2.2.PACKED/SCALAR MULTIPLICATION AND DIVISION
- 9.3.2.3.PACKED/SCALAR SQUARE ROOT
- 9.3.2.4.PACKED MAXIMUM/MINIMUM
- 9.3.3.Comparison Instructions
- 9.3.4.Conversion Instructions
- 9.3.5.Logical Instructions
- 9.3.6.Additional SIMD Integer Instructions
- 9.3.7.Shuffle Instructions
- 9.3.8.State Management Instructions
- 9.3.9.Cacheability Control Instructions
- 9.4.COMPATIBILITY WITH FPU ARCHITECTURE
- 9.4.1.Effect of Instruction Prefixes on Streaming SIMD
- 9.5.WRITING APPLICATIONS WITH STREAMING SIMD
- 9.5.1.Detecting Support for Streaming SIMD Extensions Using
- 9.5.2.Interfacing with Streaming SIMD Extensions Procedures
- 9.5.3.Writing Code with MMX , Floating-Point, and Streaming
- 9.5.3.1.CACHEABILITY HINT INSTRUCTIONS
- 9.5.3.2.RECOMMENDATIONS AND GUIDELINES
- 9.5.4.Using Streaming SIMD Extensions Code in a Multitasking
- 9.5.4.1.COOPERATIVE MULTITASKING OPERATING SYSTEM
- 9.5.4.2.PREEMPTIVE MULTITASKING OPERATING SYSTEM
- 9.5.5.Exception Handling in Streaming SIMD Extensions
- CHAPTER 10. INPUT/OUTPUT
- 10.1.I/O PORT ADDRESSING
- 10.2.I/O PORT HARDWARE
- 10.3.I/O ADDRESS SPACE
- 10.3.1.Memory-Mapped I/O
- 10.4.I/O INSTRUCTIONS
- 10.5.PROTECTED-MODE I/O
- 10.5.1.I/O Privilege Level
- 10.5.2.I/O Permission Bit Map
- 10.6.ORDERING I/O
- CHAPTER 11. PROCESSOR IDENTIFICATION AND FEATURE DETERMINATION
- 11.1.PROCESSOR IDENTIFICATION
- 11.3.CPUID INSTRUCTION EXTENSIONS
- 11.3.1.Version Information
- 11.3.2.Control Register Extensions
- APPENDIX A. EFLAGS CROSS-REFERENCE
- APPENDIX B. EFLAGS CONDITION CODES
- APPENDIX C. FLOATING-POINT EXCEPTIONS SUMMARY
- APPENDIX D. SIMD FLOATING-POINT EXCEPTIONS SUMMARY
- APPENDIX E. GUIDELINES FOR WRITING FPU EXCEPTIONS HANDLERS
- E.2.1.MS-DOS* Compatibility Mode in the Intel486 and
- E.2.1.1.BASIC RULES: WHEN FERR# IS GENERATED
- E.2.1.2.RECOMMENDED EXTERNAL HARDWARE TO SUPPORT THE
- E.2.1.3.NO-WAIT FPU INSTRUCTIONS CAN GET FPU INTERRUPT IN
- E.3.RECOMMENDED PROTOCOL FOR MS-DOS*
- E.3.1.Floating-Point Exceptions and Their Defaults
- E.3.2.Two Options for Handling Numeric Exceptions
- E.3.2.2.SOFTWARE EXCEPTION HANDLING
- E.3.3.Synchronization Required for Use of FPU Exception
- E.3.3.1.EXCEPTION SYNCHRONIZATION: WHAT, WHY AND WHEN
- E.3.3.2.EXCEPTION SYNCHRONIZATION EXAMPLES
- E.3.3.3.PROPER EXCEPTION SYNCHRONIZATION IN GENERAL
- E.3.3.4.FPU EXCEPTION HANDLING EXAMPLES
- E.3.5.1.SPECULATIVELY DEFERRING FPU SAVES, GENERAL OVERVIEW
- E.3.5.2.TRACKING FPU OWNERSHIP
- E.3.5.3.INTERACTION OF FPU STATE SAVES AND FLOATING-POINT
- E.3.5.4.INTERRUPT ROUTING FROM THE KERNEL
- E.3.5.5.SPECIAL CONSIDERATIONS FOR OPERATING SYSTEMS THAT
- E.4.DIFFERENCES FOR HANDLERS USING NATIVE MODE
- E.4.1.Origin with the Intel 286 and Intel 287, and Intel386 and
- E.4.2.Changes with Intel486 , Pentium
- E.4.3.Considerations When FPU Shared Between Tasks Using
- APPENDIX F. GUIDELINES FOR WRITING SIMD FLOATING-POINT EXCEPTION HANDLERS
- F.1.TWO OPTIONS FOR HANDLING NUMERIC EXCEPTIONS
- F.2.SOFTWARE EXCEPTION HANDLING
- F.4.SIMD FLOATING-POINT EXCEPTIONS AND THE IEEE-754
- F.4.1.Floating-Point Emulation
- F.4.2.Streaming SIMD Extensions Response To Floating-Point
- Exceptions
- F.4.2.1.NUMERIC EXCEPTIONS
- F.4.2.2.RESULTS OF OPERATIONS WITH NAN OPERANDS OR A NAN
- F.4.2.3.CONDITION CODES, EXCEPTION FLAGS, AND RESPONSE FOR MASKED AND UNMASKED NUMERIC EXCEPTIONS
- F.4.3.SIMD Floating-Point Emulation Implementation Example
- INDEX A - B - C
- INDEX D - E
- INDEX F
- INDEX G - H - I
- INDEX J - L - M
- INDEX N - O - P
- INDEX Q - R
- INDEX S - T
- INDEX U - V - W - X - Z