Volume 1 Basic Architecture (794100), страница 10
Текст из файла (страница 10)
. . . . . . . . . . . . 3-7Three Memory Management Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9General System and Application Programming Registers. . . . . . . . . . . . . . . . . . . . . . .3-15Alternate General-Purpose Register Names . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . .3-16Use of Segment Registers for Flat Memory Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-18Use of Segment Registers in Segmented Memory Model. . . . . . . . . . . . . . . . . . . . .
. .3-19EFLAGS Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-21Memory Operand Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-28Memory Operand Address in 64-Bit Mode. . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-29Offset (or Effective Address) Computation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-31Fundamental Data Types . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1Bytes, Words, Doublewords, Quadwords, and Double Quadwords in Memory . . . . . 4-2Numeric Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . 4-3Pointer Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8Pointers in 64-Bit Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 4-9Bit Field Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-964-Bit Packed SIMD Data Types . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . .4-10128-Bit Packed SIMD Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-11BCD Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . .4-12Binary Real Number System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-15Binary Floating-Point Format. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-15Real Numbers and NaNs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-17Stack Structure . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2Stack on Near and Far Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7Protection Rings . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9Stack Switch on a Call to a Different Privilege Level . . . . . . . . . . . . . . . . . . . . . . . . . . .6-10Stack Usage on Transfers to Interrupt and Exception Handling Routines . . . . . . .6-16Nested Procedures . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-22Stack Frame After Entering the MAIN Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-23Stack Frame After Entering Procedure A. .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-23Stack Frame After Entering Procedure B. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-24Stack Frame After Entering Procedure C . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .6-25Operation of the PUSH Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8Vol. 1 xviiCONTENTSPAGEFigure 7-2.Figure 7-3.Figure 7-4.Figure 7-5.Figure 7-7.Figure 7-6.Figure 7-8.Figure 7-9.Figure 7-10.Figure 7-11.Figure 8-1.Figure 8-2.Figure 8-3.Figure 8-4.Figure 8-5.Figure 8-6.Figure 8-7.Figure 8-8.Figure 8-10.Figure 8-9.Figure 8-12.Figure 8-11.Figure 8-13.Figure 9-1.Figure 9-2.Figure 9-3.Figure 9-4.Figure 10-1.Figure 10-2.Figure 10-3.Figure 10-4.Figure 10-5.Figure 10-6.Figure 10-7.Figure 10-8.Figure 10-9.Figure 11-1.Figure 11-2.Figure 11-3.Figure 11-4.Figure 11-5.Figure 11-6.Figure 11-7.Figure 11-8.Figure 11-9.Figure 12-1.Figure 12-2.xviii Vol.
1Operation of the PUSHA Instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8Operation of the POP Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9Operation of the POPA Instruction . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9Sign Extension. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11SHR Instruction Operation . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16SHL/SAL Instruction Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16SAR Instruction Operation . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17SHLD and SHRD Instruction Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-18ROL, ROR, RCL, and RCR Instruction Operations . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 7-19Flags Affected by the PUSHF, POPF, PUSHFD, and POPFD Instructions. . . . . . . . . 7-30x87 FPU Execution Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3x87 FPU Data Register Stack . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4Example x87 FPU Dot Product Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5x87 FPU Status Word . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6Moving the Condition Codes to the EFLAGS Register . . . . . . . . . . . . . . . . . . . . . . . . . . 8-10x87 FPU Control Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . 8-11x87 FPU Tag Word . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13Contents of x87 FPU Opcode Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 8-15Real Mode x87 FPU State Image in Memory, 32-Bit Format . . . . . . . . . . . . . . . . . . . 8-16Protected Mode x87 FPU State Image in Memory, 32-Bit Format . . . . . . . . . . . . . . 8-16Real Mode x87 FPU State Image in Memory, 16-Bit Format . . . . . . . . . . .
. . . . . . . . 8-17Protected Mode x87 FPU State Image in Memory, 16-Bit Format . . . . . . . . . . . . . . 8-17x87 FPU Data Type Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-19MMX Technology Execution Environment . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2MMX Register Set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3Data Types Introduced with the MMX Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. 9-4SIMD Execution Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5SSE Execution Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3XMM Registers . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4MXCSR Control/Status Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6128-Bit Packed Single-Precision Floating-Point Data Type. . . . . . . . . . . . . . . . . . . . . 10-8Packed Single-Precision Floating-Point Operation . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 10-10Scalar Single-Precision Floating-Point Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10SHUFPS Instruction, Packed Shuffle Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-14UNPCKHPS Instruction, High Unpack and Interleave Operation. . . . . . . . .
. . . . . . . 10-15UNPCKLPS Instruction, Low Unpack and Interleave Operation . . . . . . . . . . . . . . . . 10-15Steaming SIMD Extensions 2 Execution Environment . . . . . . . . . . . . . . . . . . . . . . . . . 11-3Data Types Introduced with the SSE2 Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . 11-5Packed Double-Precision Floating-Point Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6Scalar Double-Precision Floating-Point Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7SHUFPD Instruction, Packed Shuffle Operation . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . 11-11UNPCKHPD Instruction, High Unpack and Interleave Operation . . . . . . . . . . . . . . . 11-11UNPCKLPD Instruction, Low Unpack and Interleave Operation . . . . . . . . . . . . . . . . 11-12SSE and SSE2 Conversion Instructions . . . . . . . . . . . . . . . . .