![](https://csdnimg.cn/release/download_crawler_static/899663/bg1.jpg)
Intel Architecture
Software Developer’s
Manual
Volume 2:
Instruction Set Reference
NOTE
: The Intel Architecture Software Developer’s Manual consists of
three volumes: Basic Architecture, Order Number 243190; Instruction Set
Reference, Order Number 243191; and the System Programming Guide,
Order Number 243192.
Please refer to all three volumes when evaluating your design needs.
1997
ch01.bk : title.fm4 Page 1 Friday, January 17, 1997 12:59 PM
![](https://csdnimg.cn/release/download_crawler_static/899663/bg2.jpg)
3/26/97 1:23 PM IADISC2.DOC
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.
Intel’s Intel Architecture processors (e.g., Pentium
®
processor, Pentium processor with MMX™ technology,
and Pentium Pro
processor) may contain design defects or errors known as errata which may cause the product to deviate from published
specifications. Such errata are not covered by Intel’s warranty. Current characterized errata are available on request.
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 © Intel Corporation 1996, 1997.
* Third-party brands and names are the property of their respective owners.
![](https://csdnimg.cn/release/download_crawler_static/899663/bg3.jpg)
v
TABLE OF CONTENTS
PAGE
CHAPTER 1
ABOUT THIS MANUAL
1.1. OVERVIEW OF THE
INTEL ARCHITECTURE SOFTWARE
DEVELOPER’S MANUAL, VOLUME 2
: INSTRUCTION SET REFERENCE . . . . . .1-1
1.2. OVERVIEW OF THE
INTEL ARCHITECTURE SOFTWARE
DEVELOPER’S MANUAL, VOLUME 1
: BASIC ARCHITECTURE . . . . . . . . . . . . . .1-2
1.3. OVERVIEW OF THE
INTEL ARCHITECTURE SOFTWARE
DEVELOPER’S MANUAL, VOLUME 3
: SYSTEM PROGRAMMING GUIDE . . . . . .1-3
1.4. NOTATIONAL CONVENTIONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-5
1.4.1. Bit and Byte Order. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-5
1.4.2. Reserved Bits and Software Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-5
1.4.3. Instruction Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-6
1.4.4. Hexadecimal and Binary Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-6
1.4.5. Segmented Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-7
1.4.6. Exceptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-7
1.5. RELATED LITERATURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-8
CHAPTER 2
INSTRUCTION FORMAT
2.1. GENERAL INSTRUCTION FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
2.2. INSTRUCTION PREFIXES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
2.3. OPCODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-2
2.4. MODR/M AND SIB BYTES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-2
2.5. DISPLACEMENT AND IMMEDIATE BYTES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
2.6. ADDRESSING-MODE ENCODING OF MODR/M AND SIB BYTES. . . . . . . . . . . . .2-3
CHAPTER 3
INSTRUCTION SET REFERENCE
3.1. INTERPRETING THE INSTRUCTION REFERENCE PAGES . . . . . . . . . . . . . . . . .3-1
3.1.1. Instruction Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1
3.1.1.1. Opcode Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1
3.1.1.2. Instruction Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-2
3.1.1.3. Description Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4
3.1.1.4. Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-4
3.1.2. Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-5
3.1.3. Flags Affected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-8
3.1.4. FPU Flags Affected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-8
3.1.5. Protected Mode Exceptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-8
3.1.6. Real-Address Mode Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9
3.1.7. Virtual-8086 Mode Exceptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-9
3.1.8. Floating-Point Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10
3.2. INSTRUCTION REFERENCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10
AAA—ASCII Adjust After Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-11
AAD—ASCII Adjust AX Before Division. . . . . . . . . . . . . . . . . . . . . . . . . . .3-12
AAM—ASCII Adjust AX After Multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-13
AAS—ASCII Adjust AL After Subtraction. . . . . . . . . . . . . . . . . . . . . . . . . .3-14
ADC—Add with Carry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-15
ADD—Add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-17
ch01.bk : ch01.toc Page v Friday, January 17, 1997 12:59 PM
![](https://csdnimg.cn/release/download_crawler_static/899663/bg4.jpg)
TABLE OF CONTENTS
vi
PAGE
AND—Logical AND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-19
ARPL—Adjust RPL Field of Segment Selector . . . . . . . . . . . . . . . . . . . . .3-21
BOUND—Check Array Index Against Bounds. . . . . . . . . . . . . . . . . . . . . .3-23
BSF—Bit Scan Forward. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-25
BSR—Bit Scan Reverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-27
BSWAP—Byte Swap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-29
BT—Bit Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-30
BTC—Bit Test and Complement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-32
BTR—Bit Test and Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-34
BTS—Bit Test and Set. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-36
CALL—Call Procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-38
CBW/CWDE—Convert Byte to Word/Convert Word to Doubleword . . . . .3-49
CDQ—Convert Double to Quad. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-50
CLC—Clear Carry Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-51
CLD—Clear Direction Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-52
CLI—Clear Interrupt Flag. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-53
CLTS—Clear Task-Switched Flag in CR0. . . . . . . . . . . . . . . . . . . . . . . . .3-55
CMC—Complement Carry Flag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-56
CMOVcc—Conditional Move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-57
CMP—Compare Two Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-61
CMPS/CMPSB/CMPSW/CMPSD—Compare String Operands . . . . . . . .3-63
CMPXCHG—Compare and Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . .3-66
CMPXCHG8B—Compare and Exchange 8 Bytes. . . . . . . . . . . . . . . . . . .3-68
CPUID—CPU Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-70
CWD/CDQ—Convert Word to Doubleword/Convert Doubleword
to Quadword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-77
CWDE—Convert Word to Doubleword . . . . . . . . . . . . . . . . . . . . . . . . . . .3-78
DAA—Decimal Adjust AL after Addition . . . . . . . . . . . . . . . . . . . . . . . . . .3-79
DAS—Decimal Adjust AL after Subtraction . . . . . . . . . . . . . . . . . . . . . . . .3-81
DEC—Decrement by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-82
DIV—Unsigned Divide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-84
EMMS—Empty MMX™ State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-87
ENTER—Make Stack Frame for Procedure Parameters. . . . . . . . . . . . . .3-88
F2XM1—Compute 2x–1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-91
FABS—Absolute Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-93
FADD/FADDP/FIADD—Add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-95
FBLD—Load Binary Coded Decimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-98
FBSTP—Store BCD Integer and Pop . . . . . . . . . . . . . . . . . . . . . . . . . . .3-100
FCHS—Change Sign. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-103
FCLEX/FNCLEX—Clear Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-105
FCMOVcc—Floating-Point Conditional Move . . . . . . . . . . . . . . . . . . . . .3-107
FCOM/FCOMP/FCOMPP—Compare Real . . . . . . . . . . . . . . . . . . . . . . .3-109
FCOMI/FCOMIP/ FUCOMI/FUCOMIP—Compare Real and
Set EFLAGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-112
FCOS—Cosine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-115
FDECSTP—Decrement Stack-Top Pointer . . . . . . . . . . . . . . . . . . . . . . .3-117
FDIV/FDIVP/FIDIV—Divide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-118
ch01.bk : ch01.toc Page vi Friday, January 17, 1997 12:59 PM
![](https://csdnimg.cn/release/download_crawler_static/899663/bg5.jpg)
vii
TABLE OF CONTENTS
PAGE
FDIVR/FDIVRP/FIDIVR—Reverse Divide . . . . . . . . . . . . . . . . . . . . . . . 3-122
FFREE—Free Floating-Point Register. . . . . . . . . . . . . . . . . . . . . . . . . . 3-126
FICOM/FICOMP—Compare Integer . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-127
FILD—Load Integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-129
FINCSTP—Increment Stack-Top Pointer . . . . . . . . . . . . . . . . . . . . . . . 3-131
FINIT/FNINIT—Initialize Floating-Point Unit. . . . . . . . . . . . . . . . . . . . . . 3-132
FIST/FISTP—Store Integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-134
FLD—Load Real . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-137
FLD1/FLDL2T/FLDL2E/FLDPI/FLDLG2/FLDLN2/FLDZ—
Load Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-139
FLDCW—Load Control Word. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-141
FLDENV—Load FPU Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-143
FMUL/FMULP/FIMUL—Multiply. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-145
FNOP—No Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-148
FPATAN—Partial Arctangent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-149
FPATAN—Partial Arctangent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-151
FPREM1—Partial Remainder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-154
FPTAN—Partial Tangent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-157
FRNDINT—Round to Integer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-159
FRSTOR—Restore FPU State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-160
FSAVE/FNSAVE—Store FPU State . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-162
FSCALE—Scale. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-165
FSIN—Sine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-167
FSINCOS—Sine and Cosine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-169
FSQRT—Square Root . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-171
FST/FSTP—Store Real . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-173
FSTCW/FNSTCW—Store Control Word . . . . . . . . . . . . . . . . . . . . . . . . 3-176
FSTENV/FNSTENV—Store FPU Environment . . . . . . . . . . . . . . . . . . . 3-178
FSTSW/FNSTSW—Store Status Word . . . . . . . . . . . . . . . . . . . . . . . . . 3-180
FSUB/FSUBP/FISUB—Subtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-182
FSUBR/FSUBRP/FISUBR—Reverse Subtract . . . . . . . . . . . . . . . . . . . 3-185
FTST—TEST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-188
FUCOM/FUCOMP/FUCOMPP—Unordered Compare Real . . . . . . . . . 3-190
FWAIT—Wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-193
FXAM—Examine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-194
FXCH—Exchange Register Contents . . . . . . . . . . . . . . . . . . . . . . . . . . 3-196
FXTRACT—Extract Exponent and Significand . . . . . . . . . . . . . . . . . . . 3-198
FYL2X—Compute y * log2x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-200
FYL2XP1—Compute y * log2(x +1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-202
HLT—Halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-204
IDIV—Signed Divide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-205
IMUL—Signed Multiply. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-208
IN—Input from Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-211
INC—Increment by 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-213
INS/INSB/INSW/INSD—Input from Port to String . . . . . . . . . . . . . . . . . 3-215
INT n/INTO/INT 3—Call to Interrupt Procedure . . . . . . . . . . . . . . . . . . . 3-218
INVD—Invalidate Internal Caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-230
ch01.bk : ch01.toc Page vii Friday, January 17, 1997 12:59 PM
- 1
- 2
- 3
- 4
前往页