Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

x86 instruction listings

From Wikipedia, the free encyclopedia
(Redirected fromX86 instruction set)
List of x86 microprocessor instructions
Part of a series on
x86 instruction listings

Thex86instruction set refers to the set of instructions thatx86-compatiblemicroprocessors support. The instructions are usually part of anexecutable program, often stored as acomputer file and executed on the processor.

The x86 instruction set has been extended several times, introducing widerregisters and datatypes as well as new functionality.[1]

x86 integer instructions

[edit]
Main article:x86 assembly language

Below is the full8086/8088 instruction set of Intel (81 instructions total).[2] These instructions are also available in 32-bit mode, in which they operate on 32-bit registers (eax,ebx, etc.) and values instead of their 16-bit (ax,bx, etc.) counterparts. The updated instruction set is grouped according to architecture (i186,i286,i386,i486,i586/i686) and is referred to as (32-bit)x86 and (64-bit)x86-64 (also known asAMD64).

Original 8086/8088 instructions

[edit]

This is the original instruction set. In the 'Notes' column,r meansregister,m meansmemory address andimm meansimmediate (i.e. a value).

Original 8086/8088 instruction set
In-
struc-
tion
MeaningNotesOpcode
AAAASCII adjust AL after additionused with unpackedbinary-coded decimal0x37
AADASCII adjust AX before division8086/8088 datasheet documents only base 10 version of the AAD instruction (opcode0xD50x0A), but any other base will work. Later Intel's documentation has the generic form too.NEC V20 and V30 (and possibly other NEC V-series CPUs) always use base 10, and ignore the argument, causing a number of incompatibilities0xD5
AAMASCII adjust AX after multiplicationOnly base 10 version (Operand is 0xA) is documented, see notes for AAD0xD4
AASASCII adjust AL after subtraction0x3F
ADCAdd with carry(1) r += (r/m/imm+CF); (2)m += (r/imm+CF);0x10...0x15,0x80...0x81/2,0x83/2
ADDAdd(1) r += r/m/imm; (2)m += r/imm;0x00...0x05,0x80/0...0x81/0,0x83/0
ANDLogical AND(1) r &= r/m/imm; (2)m &= r/imm;0x20...0x25,0x80...0x81/4,0x83/4
CALLCall procedurepusheip; eip points to the instruction directly after the call0x9A,0xE8,0xFF/2,0xFF/3
CBWConvert byte to wordAX = AL ; sign extended0x98
CLCClearcarry flagCF = 0;0xF8
CLDCleardirection flagDF = 0;0xFC
CLIClearinterrupt flagIF = 0;0xFA
CMCComplement carry flagCF = !CF;0xF5
CMPCompare operands(1) r - r/m/imm; (2)m - r/imm;0x38...0x3D,0x80...0x81/7,0x83/7
CMPSBCompare bytes in memory. May be used with aREPE orREPNE prefix to test and repeat the instructionCX times.
if(DF==0)*(byte*)SI++-*(byte*)ES:DI++;else*(byte*)SI---*(byte*)ES:DI--;
0xA6
CMPSWCompare words. May be used with aREPE orREPNE prefix to test and repeat the instructionCX times.
if(DF==0)*(word*)SI++-*(word*)ES:DI++;else*(word*)SI---*(word*)ES:DI--;
0xA7
CWDConvert word to doubleword0x99
DAADecimal adjust AL after addition(used with packedbinary-coded decimal)0x27
DASDecimal adjust AL after subtraction0x2F
DECDecrement by 10x48...0x4F,0xFE/1,0xFF/1
DIVUnsigned divide(1)AX = DX:AX / r/m; resultingDX = remainder (2)AL = AX / r/m; resultingAH = remainder0xF7/6,0xF6/6
ESCUsed withfloating-point unit0xD8..0xDF
HLTEnter halt state0xF4
IDIVSigned divide(1)AX = DX:AX / r/m; resultingDX = remainder (2)AL = AX / r/m; resultingAH = remainder0xF7/7,0xF6/7
IMULSigned multiply in One-operand form(1)DX:AX = AX * r/m; (2)AX = AL * r/m0xF7/5,0xF6/5
INInput from port(1)AL = port[imm]; (2)AL = port[DX]; (3)AX = port[imm]; (4)AX = port[DX];0xE4,0xE5,0xEC,0xED
INCIncrement by 10x40...0x47,0xFE/0,0xFF/0
INTCall tointerrupt0xCC,0xCD
INTOCall to interrupt if overflow0xCE
IRETReturn from interrupt0xCF
JccJump if condition(JA, JAE, JB, JBE, JC, JE, JG, JGE, JL, JLE, JNA, JNAE, JNB, JNBE, JNC, JNE, JNG, JNGE, JNL, JNLE, JNO, JNP, JNS, JNZ, JO, JP, JPE, JPO, JS, JZ)0x70...0x7F
JCXZJump if CX is zero0xE3
JMPJump0xE9...0xEB,0xFF/4,0xFF/5
LAHFLoad FLAGS into AH register0x9F
LDSLoad DS:r with far pointer r = m; DS = 2 + m;0xC5
LEALoad Effective Address0x8D
LESLoad ES:r with far pointer r = m; ES = 2 + m;0xC4
LOCKAssert BUS LOCK# signal(for multiprocessing)0xF0
LODSBLoad string byte. May be used with aREP prefix to repeat the instructionCX times.if(DF==0)AL=*SI++;elseAL=*SI--;0xAC
LODSWLoad string word. May be used with aREP prefix to repeat the instructionCX times.if(DF==0)AX=*SI++;elseAX=*SI--;0xAD
LOOP/
LOOPx
Loop control(LOOPE, LOOPNE, LOOPNZ, LOOPZ)if(x&&--CX)gotolbl;0xE0...0xE2
MOVMove(1) r = r/m/imm; (2)m = r/imm; (3) r/m = sreg; (4) sreg = r/m;0xA0...0xA3,0x8C,0x8E
MOVSBMove byte from string to string. May be used with aREP prefix to repeat the instructionCX times.
if(DF==0)*(byte*)ES:DI++=*(byte*)SI++;else*(byte*)ES:DI--=*(byte*)SI--;
.
0xA4
MOVSWMove word from string to string. May be used with aREP prefix to repeat the instructionCX times.
if(DF==0)*(word*)ES:DI++=*(word*)SI++;else*(word*)ES:DI--=*(word*)SI--;
0xA5
MULUnsigned multiply(1)DX:AX = AX * r/m; (2)AX = AL * r/m;0xF7/4,0xF6/4
NEGTwo's complement negationr/m=0r/m;0xF6/3...0xF7/3
NOPNo operationopcode equivalent toXCHG EAX, EAX0x90
NOTNegate the operand,logical NOTr/m^=-1;0xF6/2...0xF7/2
ORLogical OR(1) r ∣= r/m/imm; (2)m ∣= r/imm;0x08...0x0D,0x80...0x81/1,0x83/1
OUTOutput to port(1)port[imm] = AL; (2)port[DX] = AL; (3)port[imm] = AX; (4)port[DX] = AX;0xE6,0xE7,0xEE,0xEF
POPPop data fromstackr/m/sreg = *SP++;0x07,0x17,0x1F,0x58...0x5F,0x8F/0
POPFPopFLAGS register from stackFLAGS = *SP++;0x9D
PUSHPush data onto stack*--SP=r/m/sreg;0x06,0x0E,0x16,0x1E,0x50...0x57,0xFF/6
PUSHFPush FLAGS onto stack*--SP=FLAGS;0x9C
RCLRotate left (with carry)0xC0...0xC1/2 (186+),0xD0...0xD3/2
RCRRotate right (with carry)0xC0...0xC1/3 (186+),0xD0...0xD3/3
REPxxRepeat MOVS/STOS/CMPS/LODS/SCAS(REP, REPE, REPNE, REPNZ, REPZ)0xF2,0xF3
RETReturn from procedureNot a real instruction. The assembler will translate these to a RETN or a RETF depending on the memory model of the target system.
RETNReturn from near procedure0xC2,0xC3
RETFReturn from far procedure0xCA,0xCB
ROLRotate left0xC0...0xC1/0 (186+),0xD0...0xD3/0
RORRotate right0xC0...0xC1/1 (186+),0xD0...0xD3/1
SAHFStore AH into FLAGS0x9E
SALShift Arithmetically left (signed shift left)(1)r/m <<= 1; (2)r/m <<= CL;0xC0...0xC1/4 (186+),0xD0...0xD3/4
SARShift Arithmetically right (signed shift right)(1)(signed) r/m >>= 1; (2)(signed) r/m >>= CL;0xC0...0xC1/7 (186+),0xD0...0xD3/7
SBBSubtraction with borrow(1) r -= (r/m/imm+CF); (2)m -= (r/imm+CF); alternative 1-byte encoding ofSBB AL, AL is available viaundocumented SALC instruction0x18...0x1D,0x80...0x81/3,0x83/3
SCASBCompare byte string. May be used with aREPE orREPNE prefix to test and repeat the instructionCX times.if(DF==0)AL-*ES:DI++;elseAL-*ES:DI--;0xAE
SCASWCompare word string. May be used with aREPE orREPNE prefix to test and repeat the instructionCX times.if(DF==0)AX-*ES:DI++;elseAX-*ES:DI--;0xAF
SHLShift left (unsigned shift left)0xC0...0xC1/4 (186+),0xD0...0xD3/4
SHRShift right (unsigned shift right)0xC0...0xC1/5 (186+),0xD0...0xD3/5
STCSet carry flagCF = 1;0xF9
STDSet direction flagDF = 1;0xFD
STISet interrupt flagIF = 1;0xFB
STOSBStore byte in string. May be used with aREP prefix to repeat the instructionCX times.if(DF==0)*ES:DI++=AL;else*ES:DI--=AL;0xAA
STOSWStore word in string. May be used with aREP prefix to repeat the instructionCX times.if(DF==0)*ES:DI++=AX;else*ES:DI--=AX;0xAB
SUBSubtraction(1) r -= r/m/imm; (2)m -= r/imm;0x28...0x2D,0x80...0x81/5,0x83/5
TESTLogical compare (AND)(1) r & r/m/imm; (2)m & r/imm;0x84,0x85,0xA8,0xA9,0xF6/0,0xF7/0
WAITWait until not busyWaits until BUSY# pin is inactive (used withfloating-point unit)0x9B
XCHGExchange datar:=:r/m; Aspinlock typically uses xchg as anatomic operation. (coma bug).0x86,0x87,0x91...0x97
XLATTable look-up translationbehaves likeMOV AL, [BX+AL]0xD7
XORExclusive OR(1) r ^+= r/m/imm; (2)m ^= r/imm;0x30...0x35,0x80...0x81/6,0x83/6

Added in specific processors

[edit]

Added with80186/80188

[edit]
InstructionOpcodeMeaningNotes
BOUND62/rCheck array index against boundsraises software interrupt 5 if test fails
ENTERC8iw ibEnter stack frameModifies stack for entry to procedure for high level language. Takes two operands: the amount of storage to be allocated on the stack and the nesting level of the procedure.
INSB/INSW6CInput from port to string. May be used with a REP prefix to repeat the instruction CX times.equivalent to:
INAL,DXMOVES:[DI],ALINCDI; adjust DI according to operand size and DF
6D
LEAVEC9Leave stack frameReleases the local stack storage created by the previous ENTER instruction.
OUTSB/OUTSW6EOutput string to port. May be used with a REP prefix to repeat the instruction CX times.equivalent to:
MOVAL,DS:[SI]OUTDX,ALINCSI; adjust SI according to operand size and DF
6F
POPA61Pop all general purpose registers from stackequivalent to:
POPDIPOPSIPOPBPPOPAX; no POP SP here, all it does is ADD SP, 2 (since AX will be overwritten later)POPBXPOPDXPOPCXPOPAX
PUSHA60Push all general purpose registers onto stackequivalent to:
PUSHAXPUSHCXPUSHDXPUSHBXPUSHSP; The value stored is the initial SP valuePUSHBPPUSHSIPUSHDI
PUSH immediate6AibPush an immediate byte/word value onto the stackexample:
PUSH12hPUSH1200h
68iw
IMUL immediate6B/r ibSigned and unsigned multiplication of immediate byte/word valueexample:
IMULBX,12hIMULDX,1200hIMULCX,DX,12hIMULBX,SI,1200hIMULDI,wordptr[BX+SI],12hIMULSI,wordptr[BP-4],1200h

Note that since the lower half is the same for unsigned and signed multiplication, this version of the instruction can be used for unsigned multiplication as well.

69/r iw
SHL/SHR/SAL/SAR/ROL/ROR/RCL/RCR immediateC0Rotate/shift bits with an immediate value greater than 1example:
ROLAX,3SHRBL,3
C1

Added with80286

[edit]

The new instructions added in 80286 add support for x86protected mode. Some but not all of the instructions are available inreal mode as well.

InstructionOpcodeInstruction descriptionReal modeRing
LGDT m16&32[a]0F 01 /2Load GDTR (Global Descriptor Table Register) from memory.[b]Yes0
LIDT m16&32[a]0F 01 /3Load IDTR (Interrupt Descriptor Table Register) from memory.[b]
The IDTR controls not just the address/size of the IDT (interrupt Descriptor Table) inprotected mode, but the IVT (Interrupt Vector Table) inreal mode as well.
LMSW r/m160F 01 /6Load MSW (Machine Status Word) from 16-bit register or memory.[c][d]
CLTS0F 06Clear task-switched flag in the MSW.
LLDT r/m160F 00 /2Load LDTR (Local Descriptor Table Register) from 16-bit register or memory.[b]#UD
LTR r/m160F 00 /3Load TR (Task Register) from 16-bit register or memory.[b]

The TSS (Task State Segment) specified by the 16-bit argument is marked busy, but a task switch is not done.

SGDT m16&32[a]0F 01 /0Store GDTR to memory.YesUsually 3[e]
SIDT m16&32[a]0F 01 /1Store IDTR to memory.
SMSW r/m160F 01 /4Store MSW to register or 16-bit memory.[f]
SLDT r/m160F 00 /0Store LDTR to register or 16-bit memory.[f]#UD
STR r/m160F 00 /1Store TR to register or 16-bit memory.[f]
ARPL r/m16,r1663 /r[g]Adjust RPL (RequestedPrivilege Level) field of selector. The operation performed is:
if (dst & 3) < (src & 3) then   dst = (dst & 0xFFFC) | (src & 3)   eflags.zf = 1else   eflags.zf = 0
#UD[h]3
LAR r,r/m160F 02 /rLoad access rights byte from the specifiedsegment descriptor.
Reads bytes 4-7 of segment descriptor, bitwise-ANDs it with0x00FxFF00,[i] then stores the bottom 16/32 bits of the result in destination register. SetsEFLAGS.ZF=1 if the descriptor could be loaded, ZF=0 otherwise.[j]
#UD
LSL r,r/m160F 03 /rLoad segment limit from the specified segment descriptor. Sets ZF=1 if the descriptor could be loaded, ZF=0 otherwise.[j]
VERR r/m160F 00 /4Verify a segment for reading. Sets ZF=1 if segment can be read, ZF=0 otherwise.
VERW r/m160F 00 /5Verify a segment for writing. Sets ZF=1 if segment can be written, ZF=0 otherwise.[k]
 LOADALL[l] 0F 05Load all CPU registers from a 102-byte data structure starting at physical address800h, including "hidden" part of segment descriptor registers.Yes0
 STOREALL[l] F1 0F 04Store all CPU registers to a 102-byte data structure starting at physical address800h, then shut down CPU.
  1. ^abcdThe descriptors used by theLGDT,LIDT,SGDT andSIDT instructions consist of a 2-part data structure. The first part is a 16-bit value, specifying table size in bytes minus 1. The second part is a 32-bit value (64-bit value in 64-bit mode), specifying the linear start address of the table.
    ForLGDT andLIDT with a 16-bit operand size, the address is ANDed with 00FFFFFFh.On Intel (but not AMD) CPUs, theSGDT andSIDT instructions with a 16-bit operand size is – as ofIntel SDM revision 079, March 2023 – documented to write a descriptor to memory with the last byte being set to 0. However, observed behavior is that bits 31:24 of the descriptor table address are written instead.[3]
  2. ^abcdTheLGDT,LIDT,LLDT andLTR instructions are serializing onPentium and later processors.
  3. ^TheLMSW instruction is serializing on Intel processors fromPentium onwards, but not on AMD processors.
  4. ^On 80386 and later, the "Machine Status Word" is the same as theCR0 control register – however, theLMSW instruction can only modify the bottom 4 bits of this register and cannot clear bit 0. The inability to clear bit 0 means thatLMSW can be used to enter but not leave x86Protected Mode.
    On 80286, it is not possible to leave Protected Mode at all (neither withLMSW nor withLOADALL[4]) without aCPU reset – on 80386 and later, it is possible to leave Protected Mode, but this requires the use of the 80386-and-laterMOV toCR0 instruction.
  5. ^IfCR4.UMIP=1 is set, then theSGDT,SIDT,SLDT,SMSW andSTR instructions can only run in Ring 0.
    These instructions were unprivileged on all x86 CPUs from 80286 onwards until the introduction of UMIP in 2017.[5]This has been a significant security problem for software-based virtualization, since it enables these instructions to be used by a VM guest to detect that it is running inside a VM.[6][7]
  6. ^abcTheSMSW,SLDT andSTR instructions always use an operand size of 16 bits when used with a memory argument. With a register argument on 80386 or later processors, wider destination operand sizes are available and behave as follows:
    • SMSW: Stores fullCR0 in x86-64long mode, undefined otherwise.
    • SLDT: Zero-extends 16-bit argument onPentium Pro and later processors, undefined on earlier processors.
    • STR: Zero-extends 16-bit argument.
  7. ^In 64-bitlong mode, theARPL instruction is not available – the63 /r opcode has been reassigned to the 64-bit-mode-onlyMOVSXD instruction.
  8. ^TheARPL instruction causes #UD inReal mode andVirtual 8086 Mode – Windows 95 and OS/2 2.x are known to make extensive use of this #UD to use the63 opcode as a one-byte breakpoint to transition from Virtual 8086 Mode to kernel mode.[8][9]
  9. ^Bits 19:16 of this mask are documented as "undefined" on Intel CPUs.[10] On AMD CPUs, the mask is documented as0x00FFFF00.
  10. ^abFor theLAR andLSL instructions, if the specified segment descriptor could not be loaded, then the instruction's destination register is left unmodified.
  11. ^On some Intel CPU/microcode combinations from 2019 onwards, theVERW instruction also flushes microarchitectural data buffers. This enables it to be used as part of workarounds forMicroarchitectural Data Sampling security vulnerabilities.[11][12] Some of the microarchitectural buffer-flushing functions that have been added toVERW may require the instruction to be executed with a memory operand.[13]
  12. ^abUndocumented, 80286 only.[4][14][15] (A different variant ofLOADALL with a different opcode and memory layout exists on 80386.)

Added with80386

[edit]

The 80386 added support for 32-bit operation to the x86 instruction set. This was done by widening the general-purpose registers to 32 bits and introducing the concepts ofOperandSize andAddressSize – most instruction forms that would previously take 16-bit data arguments were given the ability to take 32-bit arguments by setting their OperandSize to 32 bits, and instructions that could take 16-bit address arguments were given the ability to take 32-bit address arguments by setting their AddressSize to 32 bits. (Instruction forms that work on 8-bit data continue to be 8-bit regardless of OperandSize. Using a data size of 16 bits will cause only the bottom 16 bits of the 32-bit general-purpose registers to be modified – the top 16 bits are left unchanged.)

The default OperandSize and AddressSize to use for each instruction is given by the D bit of thesegment descriptor of the current code segment -D=0 makes both 16-bit,D=1 makes both 32-bit. Additionally, they can be overridden on a per-instruction basis with two new instruction prefixes that were introduced in the 80386:

  • 66h: OperandSize override. Will change OperandSize from 16-bit to 32-bit ifCS.D=0, or from 32-bit to 16-bit ifCS.D=1.
  • 67h: AddressSize override. Will change AddressSize from 16-bit to 32-bit ifCS.D=0, or from 32-bit to 16-bit ifCS.D=1.

The 80386 also introduced the two new segment registersFS andGS as well as the x86control,debug andtest registers.

The new instructions introduced in the 80386 can broadly be subdivided into two classes:

  • Pre-existing opcodes that needed new mnemonics for their 32-bit OperandSize variants (e.g.CWDE,LODSD)
  • New opcodes that introduced new functionality (e.g.SHLD,SETcc)

For instruction forms where the operand size can be inferred from the instruction's arguments (e.g.ADD EAX,EBX can be inferred to have a 32-bit OperandSize due to its use of EAX as an argument), new instruction mnemonics are not needed and not provided.

80386: new instruction mnemonics for 32-bit variants of older opcodes
TypeInstruction mnemonicOpcodeDescriptionMnemonic for older 16-bit variantRing
String instructions[a][b]LODSDADLoad string doubleword:EAX := DS:[rSI±±]LODSW3
STOSDABStore string doubleword:ES:[rDI±±] := EAXSTOSW
MOVSDA5Move string doubleword:ES:[rDI±±] := DS:[rSI±±]MOVSW
CMPSDA7Compare string doubleword:
temp1 := DS:[rSI±±]temp2 := ES:[rDI±±]CMP temp1, temp2 /* 32-bit compare and set EFLAGS */
CMPSW
SCASDAFScan string doubleword:
temp1 := ES:[rDI±±]CMP EAX, temp1 /* 32-bit compare and set EFLAGS */
SCASW
INSD6DInput string from doubleword I/O port:ES:[rDI±±] := port[DX][c]INSWUsually 0[d]
OUTSD6FOutput string to doubleword I/O port:port[DX] := DS:[rSI±±]OUTSW
OtherCWDE98Sign-extend 16-bit value in AX to 32-bit value in EAX[e]CBW3
CDQ99Sign-extend 32-bit value in EAX to 64-bit value in EDX:EAX.

Mainly used to prepare a dividend for the 32-bitIDIV (signed divide) instruction.

CWD
JECXZ rel8E3cb[f]Jump if ECX is zeroJCXZ
PUSHAD60Push all 32-bit registers onto stack[g]PUSHA
POPAD61Pop all 32-bit general-purpose registers off stack[h]POPA
PUSHFD9CPush 32-bit EFLAGS register onto stackPUSHFUsually 3[i]
POPFD9DPop 32-bit EFLAGS register off stackPOPF
IRETDCF32-bit interrupt return. Differs from the older 16-bitIRET instruction in that it will pop interrupt return items (EIP,CS,EFLAGS; also ESP[j] and SS if there is aCPL change; and also ES,DS,FS,GS if returning tovirtual 8086 mode) off the stack as 32-bit items instead of 16-bit items. Should be used to return from interrupts when the interrupt handler was entered through a 32-bitIDT interrupt/trap gate.

Instruction is serializing.

IRET
  1. ^For the 32-bit string instructions, the ±± notation is used to indicate that the indicated register is post-decremented by 4 ifEFLAGS.DF=1 and post-incremented by 4 otherwise.
    For the operands where the DS segment is indicated, the DS segment can be overridden by a segment-override prefix – where the ES segment is indicated, the segment is always ES and cannot be overridden.
    The choice of whether to use the 16-bit SI/DI registers or the 32-bit ESI/EDI registers as the address registers to use is made by AddressSize, overridable with the67 prefix.
  2. ^The 32-bit string instructions accept repeat-prefixes in the same way as older 8/16-bit string instructions.
    ForLODSD,STOSD,MOVSD,INSD andOUTSD, theREP prefix (F3) will repeat the instruction the number of times specified in rCX (CX or ECX, decided by AddressSize), decrementing rCX for each iteration (with rCX=0 resulting in no-op and proceeding to the next instruction).
    ForCMPSD andSCASD, theREPE (F3) andREPNE (F2) prefixes are available, which will repeat the instruction, decrementing rCX for each iteration, but only as long as the flag condition (ZF=1 forREPE, ZF=0 forREPNE) holds true AND rCX ≠ 0.
  3. ^For theINSB/W/D instructions, the memory access rights for theES:[rDI] memory address might not be checked until after the port access has been performed – if this check fails (e.g. page fault or other memory exception), then the data item read from the port is lost. As such, it is not recommended to use this instruction to access an I/O port that performs any kind of side effect upon read.
  4. ^I/O port access is only allowed whenCPL≤IOPL or theI/O port permission bitmap bits for the port to access are all set to 0.
  5. ^TheCWDE instruction differs from the olderCWD instruction in thatCWD would sign-extend the 16-bit value in AX into a 32-bit value in the DX:AX register pair.
  6. ^For theE3 opcode (JCXZ/JECXZ), the choice of whether the instruction will useCX orECX for its comparison (and consequently which mnemonic to use) is based on the AddressSize, not OperandSize. (OperandSize instead controls whether the jump destination should be truncated to 16 bits or not).
    This also applies to the loop instructionsLOOP,LOOPE,LOOPNE (opcodesE0,E1,E2), however, unlikeJCXZ/JECXZ, these instructions have not been given new mnemonics for their ECX-using variants.
  7. ^ForPUSHA(D), the value of SP/ESP pushed onto the stack is the value it had just before thePUSHA(D) instruction started executing.
  8. ^ForPOPA/POPAD, the stack item corresponding to SP/ESP is popped off the stack (performing a memory read), but not placed into SP/ESP.
  9. ^ThePUSHFD andPOPFD instructions will cause a #GP exception if executed invirtual 8086 mode if IOPL is not 3.
    ThePUSHF,POPF,IRET andIRETD instructions will cause a #GP exception if executed in Virtual-8086 mode if IOPL is not 3 and VME is not enabled.
  10. ^IfIRETD is used to return from kernel mode to user mode (which will entail a CPL change) and the user-mode stacksegment indicated by SS is a 16-bit segment, then theIRETD instruction will only restore the low 16 bits of the stack pointer (ESP/RSP), with the remaining bits keeping whatever value they had in kernel code before theIRETD. This has necessitated complex workarounds on both Linux ("ESPFIX")[16] and Windows.[17] This issue also affects the later 64-bitIRETQ instruction.
80386: new opcodes introduced
Instruction mnemonicsOpcodeDescriptionRing
BT r/m, r0F A3 /rBit Test.[a]

Second operand specifies which bit of the first operand to test. The bit to test is copied toEFLAGS.CF.

3
BT r/m, imm80F BA /4ib
BTS r/m, r0F AB /rBitTest-and-set.[a][b]

Second operand specifies which bit of the first operand to test and set.

BTS r/m, imm80F BA /5ib
BTR r/m, r0F B3 /rBit Test and Reset.[a][b]

Second operand specifies which bit of the first operand to test and clear.

BTR r/m, imm80F BA /6ib
BTC r/m, r0F BB /rBit Test and Complement.[a][b]

Second operand specifies which bit of the first operand to test and toggle.

BTC r/m, imm80F BA /7ib
BSF r, r/mNFx 0F BC /r[c]Bit scan forward. Returns bit index of lowest set bit in input.[d]3
BSR r, r/mNFx 0F BD /r[e]Bit scan reverse. Returns bit index of highest set bit in input.[d]
SHLD r/m, r, imm80F A4 /ribShift Left Double.
The operation ofSHLD arg1,arg2,shamt is:
arg1 := (arg1<<shamt) | (arg2>>(operand_size - shamt))[f]
SHLD r/m, r, CL0F A5 /r
SHRD r/m, r, imm80F AC /ribShift Right Double.
The operation ofSHRD arg1,arg2,shamt is:
arg1 := (arg1>>shamt) | (arg2<<(operand_size - shamt))[f]
SHRD r/m, r, CL0F AD /r
MOVZX reg, r/m80F B6 /rMove from 8/16-bit source to 16/32-bit register with zero-extension.3
MOVZX reg, r/m160F B7 /r
MOVSX reg, r/m80F BE /rMove from 8/16-bit source to 16/32/64-bit register withsign-extension.
MOVSX reg, r/m160F BF /r
SETcc r/m80F 9x /0[g][h]Set byte to 1 if condition is satisfied, 0 otherwise.
Jccrel16
Jccrel32
0F 8xcw
0F 8xcd[g]
Conditional jump near.

Differs from older variants of conditional jumps in that they accept a 16/32-bit offset rather than just an 8-bit offset.

IMUL r, r/m0F AF /rTwo-operand non-widening integer multiply.
FS:64Segment-override prefixes for FS and GS segment registers.3
GS:65
PUSH FS0F A0Push/pop FS and GS segment registers.
POP FS0F A1
PUSH GS0F A8
POP GS0F A9
LFS r16, m16&16
LFS r32, m32&16
0F B4 /rLoadfar pointer from memory.

Offset part is stored in destination register argument, segment part in FS/GS/SS segment register as indicated by the instruction mnemonic.[i]

LGS r16, m16&16
LGS r32, m32&16
0F B5 /r
LSS r16, m16&16
LSS r32, m32&16
0F B2 /r
MOV reg,CRx0F 20 /r[j]Move fromcontrol register to general register.[k]0
MOV CRx,reg0F 22 /r[j]Move from general register to control register.[k]

Moves to theCR3 control register are serializing and will flush theTLB.[l]

On Pentium and later processors, moves to theCR0 andCR4 control registers are also serializing.[m]

MOV reg,DRx0F 21 /r[j]Move fromx86 debug register to general register.[k]
MOV DRx,reg0F 23 /r[j]Move from general register to x86 debug register.[k]

On Pentium and later processors, moves to the DR0-DR7 debug registers are serializing.

MOV reg,TRx0F 24 /r[j]Move from x86test register to general register.[n]
MOV TRx,reg0F 26 /r[j]Move from general register to x86 test register.[n]
 ICEBP,
 INT01,
 INT1[o]
 F1In-circuit emulation breakpoint.

Performs software interrupt #1 if executed when not using in-circuit emulation.[p]

3
 UMOV r/m, r8 0F 10 /rUser Move – perform data moves that can access user memory while in In-circuit emulation HALT mode.

Performs same operation asMOV if executed when not doing in-circuit emulation.[q]

 UMOV r/m, r16/32 0F 11 /r
 UMOV r8, r/m 0F 12 /r
 UMOV r16/32, r/m 0F 13 /r
 XBTS reg,r/m 0F A6 /rBitfield extract (early 386 only).[r][s]
 IBTS r/m,reg 0F A7 /rBitfield insert (early 386 only).[r][s]
 LOADALLD,
 LOADALL386
[t]
 0F 07Load all CPU registers from a 296-byte data structure starting at ES:EDI, including "hidden" part of segment descriptor registers.0
  1. ^abcdFor theBT,BTS,BTR andBTC instructions:
    • If the first argument to the instruction is a register operand and/or the second argument is an immediate, then the bit-index in the second argument is taken modulo operand size (16/32/64, in effect using only the bottom 4, 5 or 6 bits of the index.)
    • If the first argument is a memory operand and the second argument is a register operand, then the bit-index in the second argument is used in full – it is interpreted as a signed bit-index that is used to offset the memory address to use for the bit test.
  2. ^abcTheBTS,BTC andBTR instructions accept theLOCK (F0) prefix when used with a memory argument – this results in the instruction executing atomically.
  3. ^If theF3 prefix is used with the0F BC /r opcode, then the instruction will execute asTZCNT on systems that support the BMI1 extension.TZCNT differs fromBSF in thatTZCNT but notBSR is defined to return operand size if the source operand is zero – for other source operand values, they produce the same result (except for flags).
  4. ^abBSF andBSR set the EFLAGS.ZF flag to 1 if the source argument was all-0s and 0 otherwise.
    If the source argument was all-0s, then the destination register is documented as being left unchanged on AMD processors, but set to an undefined value on Intel processors.
  5. ^If theF3 prefix is used with the0F BD /r opcode, then the instruction will execute asLZCNT on systems that support the ABM or LZCNT extensions.LZCNT produces a different result fromBSR for most input values.
  6. ^abForSHLD andSHRD, the shift-amount is masked – the bottom 5 bits are used for 16/32-bit operand size and 6 bits for 64-bit operand size.
    SHLD andSHRD with 16-bit arguments and a shift-amount greater than 16 produce undefined results. (Actual results differ between different Intel CPUs, with at least three different behaviors known.[18])
  7. ^abThe condition codes supported for theSETcc andJcc near instructions (opcodes0F 9x /0 and0F 8x respectively, with thex nibble specifying the condition) are:
    xccCondition (EFLAGS)
    0OOF=1: "Overflow"
    1NOOF=0:"Not Overflow"
    2C,B,NAECF=1: "Carry", "Below","Not Above or Equal"
    3NC,NB,AECF=0:"Not Carry","Not Below","Above or Equal"
    4Z,EZF=1: "Zero", "Equal"
    5NZ,NEZF=0:"Not Zero","Not Equal"
    6NA,BE(CF=1 or ZF=1):"Not Above","Below or Equal"
    7A,NBE(CF=0 and ZF=0): "Above","Not Below or Equal"
    8SSF=1: "Sign"
    9NSSF=0:"Not Sign"
    AP,PEPF=1: "Parity","Parity Even"
    BNP,POPF=0:"Not Parity","Parity Odd"
    CL,NGESF≠OF: "Less","Not Greater Or Equal"
    DNL,GESF=OF:"Not Less","Greater Or Equal"
    ELE,NG(ZF=1 or SF≠OF):"Less or Equal","Not Greater"
    FNLE,G(ZF=0 and SF=OF):"Not Less or Equal","Greater"
  8. ^ForSETcc, while the opcode is commonly specified as /0 – implying that bits 5:3 of the instruction'sModR/M byte should be 000 – modern x86 processors (Pentium and later) ignore bits 5:3 and will execute the instruction asSETcc regardless of the contents of these bits.
  9. ^ForLFS,LGS andLSS, the size of the offset part of the far pointer is given by operand size – the size of the segment part is always 16 bits. In 64-bit mode, using theREX.W prefix with these instructions will cause them to load afar pointer with a 64-bit offset on Intel but not AMD processors.
  10. ^abcdefForMOV to/from theCRx,DRx andTRx registers, the reg part of theModR/M byte is used to indicateCRx/DRx/TRx register and r/m part the general-register.Uniquely for theMOV CRx/DRx/TRx opcodes, the top two bits of theModR/M byte is ignored – these opcodes are decoded and executed as if the top two bits of the ModR/M byte are11b.
  11. ^abcdFor moves to/from theCRx andDRx registers, the operand size is always 64 bits in 64-bit mode and 32 bits otherwise.
  12. ^On processors that support global pages (Pentium and later), global page table entries will not be flushed by aMOV toCR3 − instead, these entries can be flushed by toggling the CR4.PGE bit.
    On processors that supportPCIDs, writing to CR3 while PCIDs are enabled will only flush TLB entries belonging to the PCID specified in bits 11:0 of the value written to CR3 (this flush can be suppressed by setting bit 63 of the written value to 1). Flushing pages belonging to other PCIDs can instead be done by toggling the CR4.PGE bit, clearing the CR4.PCIDE bit, or using theINVPCID instruction.
  13. ^On processors prior toPentium, moves toCR0 would not serialize the instruction stream – in part for this reason, it is usually required to perform a far jump[19] immediately after aMOV toCR0 if such aMOV is used to enable/disableprotected mode and/ormemory paging.
    MOV toCR2 is architecturally listed as serializing, but has been reported to benon-serializing on at least some Intel Core-i7 processors.[20]
    MOV toCR8 (introduced with x86-64) is serializing on AMD but not Intel processors.
  14. ^abTheMOV TRx instructions were discontinued from Pentium onwards.
  15. ^TheINT1/ICEBP (F1) instruction is present on all known Intel x86 processors from the 80386 onwards,[21] but only fully documented for Intel processors from the May 2018 release of the Intel SDM (rev 067) onwards.[22] Before this release, mention of the instruction in Intel material was sporadic, e.g. AP-526 rev 001.[23]
    For AMD processors, the instruction has been documented since 2002.[24]
  16. ^The operation of theF1(ICEBP) opcode differs from the operation of the regular software interrupt opcodeCD 01 in several ways:
      In protected mode,CD 01 will check CPL against the interrupt descriptor's DPL field as an access-rights check, whileF1 will not.
    • In virtual-8086 mode,CD 01 will also check CPL against IOPL as an access-rights check, whileF1 will not.
    • In virtual-8086 mode with VME enabled, interrupt redirection is supported forCD 01 but notF1.
  17. ^The UMOV instruction is present on 386 and 486 processors only.[21]
  18. ^abTheXBTS andIBTS instructions were discontinued with the B1 stepping of 80386.
    They have been used by software mainly for detection of the buggy[25] B0 stepping of the 80386. Microsoft Windows (v2.01 and later) will attempt to run theXBTS instruction as part of its CPU detection ifCPUID is not present, and will refuse to boot ifXBTS is found to be working.[26]
  19. ^abForXBTS andIBTS, the r/m argument represents the data to extract/insert a bitfield from/to, the reg argument the bitfield to be inserted/extracted, AX/EAX a bit-offset and CL a bitfield length.[27]
  20. ^Undocumented, 80386 only.[28]

Added with80486

[edit]
InstructionOpcodeDescriptionRing
BSWAP r320F C8+rByte Order Swap. Usually used to convert between big-endian and little-endian data representations. For 32-bit registers, the operation performed is:
r =   (r << 24)    | ((r << 8) & 0x00FF0000)    | ((r >> 8) & 0x0000FF00)    | (r >> 24);

UsingBSWAP with a 16-bit register argument produces an undefined result.[a]

3
CMPXCHG r/m8,r80F B0 /r[b]Compare and Exchange. If accumulator (AL/AX/EAX/RAX) compares equal to first operand,[c] thenEFLAGS.ZF is set to 1 and the first operand is overwritten with the second operand. Otherwise,EFLAGS.ZF is set to 0, and first operand is copied into the accumulator.

Instruction atomic only if used withLOCK prefix.

CMPXCHG r/m,r16
CMPXCHG r/m,r32
0F B1 /r[b]
XADD r/m,r80F C0 /reXchange and ADD. Exchanges the first operand with the second operand, then stores the sum of the two values into the destination operand.

Instruction atomic only if used withLOCK prefix.

XADD r/m,r16
XADD r/m,r32
0F C1 /r
INVLPG m80F 01 /7Invalidate theTLB entries that would be used for the 1-byte memory operand.[d]

Instruction is serializing.

0
INVD0F 08Invalidate Internal Caches.[e] Modified data in the cache are not written back to memory, potentially causing data loss.[f]
WBINVDNFx 0F 09[g]Write Back and Invalidate Cache.[e] Writes back all modified cache lines in the processor's internal cache to main memory and invalidates the internal caches.
  1. ^UsingBSWAP with 16-bit registers is not disallowed per se (it will execute without producing an #UD or other exceptions) but is documented to produce undefined results – it is reported to produce various different results on 486,[29] 586, andBochs/QEMU.[30]
  2. ^abOn Intel 80486 stepping A,[31] theCMPXCHG instruction uses a different encoding -0F A6 /r for 8-bit variant,0F A7 /r for 16/32-bit variant. The0F B0/B1 encodings are used on 80486 stepping B and later.[32][33]
  3. ^TheCMPXCHG instruction setsEFLAGS in the same way as aCMP instruction that uses the accumulator (AL/AX/EAX/RAX) as its first argument would do.
  4. ^INVLPG executes as no-operation if the m8 argument is invalid (e.g. unmapped page or non-canonical address).
    INVLPG can be used to invalidate TLB entries for individual global pages.
  5. ^abTheINVD andWBINVD instructions will invalidate all cache lines in the CPU's L1 caches. It is implementation-defined whether they will invalidate L2/L3 caches as well.
    These instructions are serializing – on some processors, they may block interrupts until completion as well.
  6. ^UnderIntel VT-x virtualization, theINVD instruction will cause a mandatory #VMEXIT. Also, on processors that supportIntel SGX, if the PRM (Processor Reserved Memory) has been set up by using the PRMRRs (PRM range registers), then theINVD instruction is not permitted and will cause a #GP(0) exception.[34]
  7. ^If theF3 prefix is used with the0F 09 opcode, then the instruction will execute asWBNOINVD on processors that support the WBNOINVD extension – this will not invalidate the cache.

Added inP5/P6-class processors

[edit]

Integer/system instructions that were not present in the basic 80486 instruction set, but were added in various x86 processors prior to the introduction of SSE. (Discontinued instructions are not included.)

InstructionOpcodeDescriptionRingAdded in
RDMSR0F 32ReadModel-specific register. The MSR to read is specified in ECX. The value of the MSR is then returned as a 64-bit value in EDX:EAX.[a]0IBM386SLC,[35]
IntelPentium,
AMDK5,
Cyrix6x86MX,MediaGXm,
IDTWinChip C6,
TransmetaCrusoe,
DM&PVortex86DX3
WRMSR0F 30WriteModel-specific register. The MSR to write is specified in ECX, and the data to write is given in EDX:EAX.[b]

Instruction is, with some exceptions, serializing.[c]

RSM[42]0F AAResume fromSystem Management Mode.

Instruction is serializing.

-2
(SMM)
Intel 386SL,[43][44]486SL,[d]
IntelPentium,
AMD5x86,
Cyrix486SLC/e,[45]
IDTWinChip C6,
TransmetaCrusoe,
RisemP6
CPUID0F A2CPU Identification and feature information. Takes as input a CPUID leaf index in EAX and, depending on leaf, a sub-index in ECX. Result is returned in EAX,EBX,ECX,EDX.[e]

Instruction is serializing, and causes a mandatory #VMEXIT under virtualization.

Support forCPUID can be checked by toggling bit 21 ofEFLAGS (EFLAGS.ID) – if this bit can be toggled,CPUID is present.

Usually 3[f]IntelPentium,[g]
AMD5x86,[g]
Cyrix5x86,[h]
IDTWinChip C6,
TransmetaCrusoe,
RisemP6,
NexGenNx586,[i]
UMCGreen CPU
CMPXCHG8B m640F C7 /1Compare and Exchange 8 bytes. Compares EDX:EAX with m64. If equal, set ZF[j] and store ECX:EBX into m64. Else, clear ZF and load m64 into EDX:EAX.

Instruction atomic only if used withLOCK prefix.[k]

3IntelPentium,
AMDK5,
Cyrix6x86L,MediaGXm,
IDTWinChip C6,[l]
TransmetaCrusoe,[l]
RisemP6[l]
RDTSC0F 31Read 64-bitTime Stamp Counter (TSC) into EDX:EAX.[m][a]

In early processors, the TSC was a cycle counter, incrementing by 1 for each clock cycle (which could cause its rate to vary on processors that could change clock speed at runtime) – in later processors, it increments at a fixed rate that doesn't necessarily match the CPU clock speed.[n]

Usually 3[o]IntelPentium,
AMDK5,
Cyrix6x86MX,MediaGXm,
IDTWinChip C6,
TransmetaCrusoe,
RisemP6
RDPMC0F 33ReadPerformance Monitoring Counter. The counter to read is specified by ECX and its value is returned in EDX:EAX.[m][a]Usually 3[p]IntelPentium MMX,
IntelPentium Pro,
AMDK7,
Cyrix6x86MX,
IDTWinChip C6,
AMDGeode LX,
VIANano[q]
CMOVcc reg,r/m0F 4x /r[r]Conditional move to register. The source operand may be either register or memory.[s]3IntelPentium Pro,
AMDK7,
Cyrix6x86MX,MediaGXm,
TransmetaCrusoe,
VIAC3 "Nehemiah",[t]
DM&PVortex86DX3
NOP r/m,
NOPL r/m
NFx 0F 1F /0[u]Official longNOP.

Other than AMD K7/K8, broadly unsupported in non-Intel processors released before 2005.[v][60]

3IntelPentium Pro,[w]
AMDK7,x86-64,[x]
VIAC7[64]
UD2,[y]
UD2A[z]
0F 0BUndefined Instructions – will generate aninvalid opcode (#UD) exception in all operating modes.[aa]

These instructions are provided for software testing to explicitly generate invalid opcodes. The opcodes for these instructions are reserved for this purpose.

(3)(80186),[ab]
IntelPentium[69]
UD1 reg,r/m,[ac]
UD2B reg,r/m[z]
0F B9,
0F B9 /r[ad]
OIO,
UD0,
UD0 reg,r/m[ae]
0F FF,
0F FF /r[ad]
(80186),[ab]
Cyrix 6x86,[75]
AMD K5[77]
SYSCALL0F 05FastSystem call.3AMDK6,[af]
x86-64[ag][ah]
SYSRET0F 07[ai]Fast Return from System Call. Designed to be used together withSYSCALL.0[aj]
SYSENTER0F 34FastSystem call.3[aj]IntelPentium II,[ak]
AMDK7,[82][al]
TransmetaCrusoe,[am]
NatSemiGeode GX2,
VIAC3 "Nehemiah",[an]
DM&PVortex86DX3
SYSEXIT0F 35[ai]Fast Return from System Call. Designed to be used together withSYSENTER.0[aj]
  1. ^abcIn 64-bit mode, theRDMSR,RDTSC andRDPMC instructions will set the top 32 bits of RDX and RAX to zero.
  2. ^On Intel and AMD CPUs, theWRMSR instruction is also used to update theCPU microcode. This is done by writing the virtual address of the new microcode to upload to MSR79h on Intel CPUs and MSRC001_0020h[36] on AMD CPUs.
  3. ^Writes to the following MSRs are not serializing:[37][38]
    NumberName
    48hSPEC_CTRL
    49hPRED_CMD
    10BhFLUSH_CMD
    122hTSX_CTRL
    6E0hTSC_DEADLINE
    6E1hPKRS
    774hHWP_REQUEST
    (non-serializing only if the FAST_IA32_­HWP_REQUEST bit it set)
    802h to83Fh(x2APIC MSRs)
    1B01hUARCH_MISC_CTL
    C001_0100hFS_BASE (non-serializing on AMDZen 4 and later)[39]
    C001_0101hGS_BASE (Zen 4 and later)
    C001_0102hKernelGSbase (Zen 4 and later)
    C001_011BhDoorbell Register (AMD-specific)

    WRMSR to the x2APIC ICR (Interrupt Command Register; MSR830h) is commonly used to produce an IPI (Inter-processor interrupt) - on Intel[40] but not AMD[41] CPUs, such an IPI can be reordered before an older memory store.

  4. ^System Management Mode and theRSM instruction were made available on non-SL variants of the Intel 486 only after the initial release of the Intel Pentium in 1993.
  5. ^On some older 32-bit processors, executingCPUID with a leaf index (EAX) greater than 0 may leave EBX and ECX unmodified, keeping their old values. For this reason, it is recommended to zero out EBX and ECX before executingCPUID.
    Processors noted to exhibit this behavior include Cyrix MII[46] and IDT WinChip 2.[47]

    In 64-bit mode,CPUID will set the top 32 bits of RAX, RBX, RCX and RDX to zero.
  6. ^On some Intel processors starting fromIvy Bridge, there exists MSRs that can be used to restrictCPUID to ring 0. Such MSRs are documented for at least Ivy Bridge[48] and Denverton.[49]
    The ability to restrictCPUID to ring 0 also exists on AMD processors supporting the "CpuidUserDis" feature (Zen 4 "Raphael" and later).[50]
  7. ^abCPUID is also available on some Intel and AMD 486 processor variants that were released after the initial release of the Intel Pentium.
  8. ^On the Cyrix 5x86 and 6x86 CPUs,CPUID is not enabled by default and must be enabled through a Cyrix configuration register.
  9. ^On NexGen CPUs,CPUID is only supported with some system BIOSes. On some NexGen CPUs that do supportCPUID, EFLAGS.ID is not supported but EFLAGS.AC is, complicating CPU detection.[51]
  10. ^Unlike the olderCMPXCHG instruction, theCMPXCHG8B instruction does not modify anyEFLAGS bits other than ZF.
  11. ^LOCK CMPXCHG8B with a register operand (which is an invalid encoding) will, on some IntelPentium CPUs, cause ahang rather than the expected #UD exception - this is known as thePentium F00F bug.
  12. ^abcOn IDT WinChip, Transmeta Crusoe and Rise mP6 processors, theCMPXCHG8B instruction is always supported, however its CPUID bit may be missing. This is a workaround for a bug in Windows NT.[52]
  13. ^abTheRDTSC andRDPMC instructions are not ordered with respect to other instructions, and may sample their respective counters before earlier instructions are executed or after later instructions have executed. Invocations ofRDPMC (but notRDTSC) may be reordered relative to each other even for reads of the same counter.
    In order to impose ordering with respect to other instructions,LFENCE or serializing instructions (e.g.CPUID) are needed.[53]
  14. ^Fixed-rate TSC was introduced in two stages:
    Constant TSC
    TSC running at a fixed rate as long as the processor core is not in a deep-sleep (C2 or deeper) mode, but not synchronized between CPU cores. Introduced in IntelPrescott,Yonah andBonnell. Also present in allTransmeta andVIA Nano[54] CPUs. Does not have a CPUID bit.
    Invariant TSC
    TSC running at a fixed rate, and remaining synchronized between CPU cores in allP-,C- and T-states (but not necessarily S-states).
    Present inAMD K10 and later; IntelNehalem/Saltwell[55] and later;Zhaoxin WuDaoKou[56] and later. Indicated with a CPUID bit (leaf8000_0007:EDX[8]).
  15. ^RDTSC can be run outside Ring 0 only ifCR4.TSD=0.
    On Intel Pentium and AMD K5,RDTSC cannot be run in Virtual-8086 mode.[57] Later processors removed this restriction.
  16. ^RDPMC can be run outside Ring 0 only ifCR4.PCE=1.
  17. ^TheRDPMC instruction is not present in VIA processors prior to the Nano.
  18. ^The condition codes supported forCMOVcc instruction (opcode0F 4x /r, with thex nibble specifying the condition) are:
    xccCondition (EFLAGS)
    0OOF=1: "Overflow"
    1NOOF=0:"Not Overflow"
    2C,B,NAECF=1: "Carry", "Below","Not Above or Equal"
    3NC,NB,AECF=0:"Not Carry","Not Below","Above or Equal"
    4Z,EZF=1: "Zero", "Equal"
    5NZ,NEZF=0:"Not Zero","Not Equal"
    6NA,BE(CF=1 or ZF=1):"Not Above","Below or Equal"
    7A,NBE(CF=0 and ZF=0): "Above","Not Below or Equal"
    8SSF=1: "Sign"
    9NSSF=0:"Not Sign"
    AP,PEPF=1: "Parity","Parity Even"
    BNP,POPF=0:"Not Parity","Parity Odd"
    CL,NGESF≠OF: "Less","Not Greater Or Equal"
    DNL,GESF=OF:"Not Less","Greater Or Equal"
    ELE,NG(ZF=1 or SF≠OF):"Less or Equal","Not Greater"
    FNLE,G(ZF=0 and SF=OF):"Not Less or Equal","Greater"
  19. ^In 64-bit mode,CMOVcc with a 32-bit operand size will clear the upper 32 bits of the destination register even if the condition is false.
    ForCMOVcc with a memory source operand, the CPU will always read the operand from memory – potentially causing memory exceptions and cache line-fills – even if the condition for the move is not satisfied. (The IntelAPX extension defines a set of newEVEX-encoded variants ofCMOVcc that will suppress memory exceptions if the condition is false.)
  20. ^On pre-Nehemiah VIA C3 variants ("Samuel"/"Ezra"), thereg,reg but notreg,[mem] forms of theCMOVcc instructions have been reported to be present as undocumented instructions.[58]
  21. ^Intel's recommended byte encodings for multi-byte NOPs of lengths 2 to 9 bytes in 32/64-bit mode are (in hex):[59]
    LengthByte Sequence
    266 90
    30F 1F 00
    40F 1F 40 00
    50F 1F 44 00 00
    666 0F 1F 44 00 00
    70F 1F 80 00 00 00 00
    80F 1F 84 00 00 00 00 00
    966 0F 1F 84 00 00 00 00 00

    For cases where there is a need to use more than 9 bytes of NOP padding, it is recommended to use multiple NOPs.

  22. ^Unlike other instructions added inPentium Pro, long NOP does not have aCPUID feature bit.
  23. ^0F 1F /0 as long-NOP was introduced in the Pentium Pro, but remained undocumented until 2006.[61]The whole0F 18..1F opcode range wasNOP in Pentium Pro. However, except for0F 1F /0, Intel does not guarantee that these opcodes will remainNOP in future processors, and have indeed assigned some of these opcodes to other instructions in at least some processors.[62]
  24. ^Documented for AMD x86-64 since 2002.[63]
  25. ^While the0F 0B opcode was officially reserved as an invalid opcode from Pentium onwards, it only got assigned the mnemonicUD2 fromPentium Pro onwards.[65]
  26. ^abGNU Binutils have used theUD2A andUD2B mnemonics for the0F 0B and0F B9 opcodes since version 2.7.[66]
    NeitherUD2A norUD2B originally took any arguments -UD2B was later modified to accept aModR/M byte, in Binutils version 2.30.[67]
  27. ^TheUD2 (0F 0B) instruction will additionally stop subsequent bytes from being decoded as instructions, even speculatively. For this reason, if an indirect branch instruction is followed by something that is not code, it is recommended to place anUD2 instruction after the indirect branch.[68]
  28. ^abThe UD0/1/2 opcodes -0F 0B,0F B9 and0F FF - will cause an #UD exception on all x86 processors from the80186 onwards (exceptNEC V-series processors), but did not get explicitly reserved for this purpose until P5-class processors.
  29. ^While the0F B9 opcode was officially reserved as an invalid opcode from Pentium onwards, it only got assigned its mnemonicUD1 much later – AMD APM started listingUD1 in its opcode maps from rev 3.17 onwards,[70] while Intel SDM started listing it from rev 061 onwards.[71]
  30. ^abFor both the0F B9 and0F FF opcodes, different x86 implementations are known to differ regarding whether the opcodes accept aModR/M byte.[72][73][74]
  31. ^For the0F FF opcode, theOIO mnemonic was introduced by Cyrix,[75] while theUD0 menmonic (without arguments) was introduced by AMD and Intel at the same time as theUD1 mnemonic for0F B9.[70][71] Later Intel (but not AMD) documentation modified its description ofUD0 to add aModR/M byte and take two arguments.[76]
  32. ^On K6, theSYSCALL/SYSRET instructions were available on Model 7 (250nm "Little Foot") and later, not on the earlier Model 6.[78]
  33. ^SYSCALL andSYSRET were made an integral part of x86-64 – as a result, the instructions are available in 64-bit mode on all x86-64 processors from AMD, Intel, VIA and Zhaoxin.
    Outside 64-bit mode, the instructions are available on AMD processors only.
  34. ^The exact semantics ofSYSRET differs slightly between AMD and Intel processors: non-canonical return addresses cause a #GP exception to be thrown in Ring 3 on AMD CPUs but Ring 0 on Intel CPUs. This has been known to cause security issues.[79]
  35. ^abFor theSYSRET andSYSEXIT instructions under x86-64, it is necessary to add theREX.W prefix for variants that will return to 64-bit user-mode code.
    Encodings of these instructions without theREX.W prefix are used to return to 32-bit user-mode code. (Neither of these instructions can be used to return to 16-bit user-mode code — for return to 16-bit code,IRET/IRETD/IRETQ should be used.)
  36. ^abcTheSYSRET,SYSENTER andSYSEXIT instructions are unavailable inReal mode. (SYSENTER is, however, available inVirtual 8086 mode.)
  37. ^TheCPUID flags that indicate support forSYSENTER/SYSEXIT are set on the Pentium Pro, even though the processor does not officially support these instructions.[80]
    Third party testing indicates that the opcodes are present on the Pentium Pro but too buggy to be usable.[81]
  38. ^On AMD CPUs, theSYSENTER andSYSEXIT instructions are not available in x86-64long mode (#UD).
  39. ^On Transmeta CPUs, theSYSENTER andSYSEXIT instructions are only available with version 4.2 or higher of the Transmeta Code Morphing software.[83]
  40. ^On Nehemiah,SYSENTER andSYSEXIT are available only on stepping 8 and later.[84]

Added as instruction set extensions

[edit]

Added withx86-64

[edit]

These instructions can only be encoded in 64 bit mode. They fall in four groups:

  • original instructions that reuse existing opcodes for a different purpose (MOVSXD replacingARPL)
  • original instructions with new opcodes (SWAPGS)
  • existing instructions extended to a 64 bit address size (JRCXZ)
  • existing instructions extended to a 64 bit operand size (remaining instructions)

Most instructions with a 64 bit operand size encode this using aREX.W prefix; in the absence of theREX.W prefix,the corresponding instruction with 32 bit operand size is encoded. This mechanism also applies to most other instructions with 32 bit operandsize. These are not listed here as they do not gain a new mnemonic in Intel syntax when used with a 64 bit operand size.

InstructionEncodingMeaningRing
CDQEREX.W 98Sign extend EAX into RAX3
CQOREX.W 99Sign extend RAX into RDX:RAX
CMPSQREX.W A7CoMPare String Quadword
CMPXCHG16B m128[a][b]REX.W 0F C7 /1CoMPare and eXCHanGe 16 Bytes.
Atomic only if used with LOCK prefix.
IRETQREX.W CF64-bit Return from Interrupt
JRCXZ rel8E3cbJump if RCX is zero
LODSQREX.W ADLoaD String Quadword
MOVSXD r64,r/m32REX.W 63 /r[c]MOV with Sign Extend 32-bit to 64-bit
MOVSQREX.W A5Move String Quadword
POPFQ9DPOP RFLAGS Register
PUSHFQ9CPUSH RFLAGS Register
SCASQREX.W AFSCAn String Quadword
STOSQREX.W ABSTOre String Quadword
SWAPGS0F 01 F8Exchange GS base with KernelGSBase MSR0
  1. ^The memory operand toCMPXCHG16B must be 16-byte aligned.
  2. ^TheCMPXCHG16B instruction was absent from a few of the earliest Intel/AMD x86-64 processors. On Intel processors, the instruction was missing fromXeon "Nocona" stepping D,[85] but added in stepping E.[86] OnAMD K8 family processors, it was added in stepping F, at the same time as DDR2 support was introduced.[87]
    For this reason,CMPXCHG16B has its own CPUID flag, separate from the rest of x86-64.
  3. ^Encodings ofMOVSXD without REX.W prefix are permitted but discouraged[88] – such encodings behave identically to 16/32-bitMOV (8B /r).

Bit manipulation extensions

[edit]
Main article:X86 Bit manipulation instruction set

Bit manipulation instructions. For all of theVEX-encoded instructions defined by BMI1 and BMI2, the operand size may be 32 or 64 bits, controlled by the VEX.W bit – none of these instructions are available in 16-bit variants. The VEX-encoded instructions are not available in Real Mode and Virtual-8086 mode - other than that, the bit manipulation instructions are available in all operating modes on supported CPUs.

Bit Manipulation ExtensionInstruction
mnemonics
OpcodeInstruction descriptionAdded in
ABM (LZCNT)[a]
Advanced Bit Manipulation
POPCNT r16,r/m16
POPCNT r32,r/m32
F3 0F B8 /rPopulation Count. Counts the number of bits that are set to 1 in its source argument.K10,
Bobcat,
Haswell,
ZhangJiang,
Gracemont
POPCNT r64,r/m64F3 REX.W 0F B8 /r
LZCNT r16,r/m16
LZCNT r32,r/m32
F3 0F BD /rCount Leading zeroes.[b]
If source operand is all-0s, thenLZCNT will return operand size in bits (16/32/64) and set CF=1.
LZCNT r64,r/m64F3 REX.W 0F BD /r
BMI1
Bit Manipulation Instruction Set 1
TZCNT r16,r/m16
TZCNT r32,r/m32
F3 0F BC /rCount Trailing zeroes.[c]
If source operand is all-0s, thenTZCNT will return operand size in bits (16/32/64) and set CF=1.
Haswell,
Piledriver,
Jaguar,
ZhangJiang,
Gracemont
TZCNT r64,r/m64F3 REX.W 0F BC /r
ANDN ra,rb,r/mVEX.LZ.0F38 F2 /rBitwise AND-NOT:ra = r/m AND NOT(rb)
BEXTR ra,r/m,rbVEX.LZ.0F38 F7 /rBitfield extract. Bitfield start position is specified in bits [7:0] ofrb, length in bits[15:8] ofrb. The bitfield is then extracted from ther/m value with zero-extension, then stored inra. Equivalent to[d]
mask = (1 << rb[15:8]) - 1ra = (r/m >> rb[7:0]) AND mask
BLSI reg,r/mVEX.LZ.0F38 F3 /3Extract lowest set bit in source argument. Returns 0 if source argument is 0. Equivalent to
dst = (-src) AND src
BLSMSK reg,r/mVEX.LZ.0F38 F3 /2Generate a bitmask of all-1s bits up to the lowest bit position with a 1 in the source argument. Returns all-1s if source argument is 0. Equivalent to
dst = (src-1) XOR src
BLSR reg,r/mVEX.LZ.0F38 F3 /1Copy all bits of the source argument, then clear the lowest set bit. Equivalent to
dst = (src-1) AND src
BMI2
Bit Manipulation Instruction Set 2
BZHI ra,r/m,rbVEX.LZ.0F38 F5 /rZero out high-order bits inr/m starting from the bit position specified inrb, then write result tord. Equivalent to
ra = r/m AND NOT(-1 << rb[7:0])
Haswell,
Excavator,[e]
ZhangJiang,
Gracemont
MULX ra,rb,r/mVEX.LZ.F2.0F38 F6 /rWidening unsigned integer multiply without setting flags. Multiplies EDX/RDX withr/m, then stores the low half of the multiplication result inra and the high half inrb. Ifra andrb specify the same register, only the high half of the result is stored.
PDEP ra,rb,r/mVEX.LZ.F2.0F38 F5 /rParallel Bit Deposit. Scatters contiguous bits fromrb to the bit positions set inr/m, then stores result tora. Operation performed is:
ra=0; k=0; mask=r/mfor i=0 to opsize-1 do   if (mask[i] == 1) then       ra[i]=rb[k]; k=k+1
PEXT ra,rb,r/mVEX.LZ.F3.0F38 F5 /rParallel Bit Extract. Usesr/m argument as a bit mask to select bits inrb, then compacts the selected bits into a contiguous bit-vector. Operation performed is:
ra=0; k=0; mask=r/mfor i=0 to opsize-1 do   if (mask[i] == 1) then       ra[k]=rb[i]; k=k+1
RORX reg,r/m,imm8VEX.LZ.F2.0F3A F0 /ribRotate right by immediate without affecting flags.
SARX ra,r/m,rbVEX.LZ.F3.0F38 F7 /rArithmetic shift right without updating flags.
ForSARX,SHRX andSHLX, the shift-amount specified inrb is masked to 5 bits for 32-bit operand size and 6 bits for 64-bit operand size.
SHRX ra,r/m,rbVEX.LZ.F2.0F38 F7 /rLogical shift right without updating flags.
SHLX ra,r/m,rbVEX.LZ.66.0F38 F7 /rShift left without updating flags.
  1. ^On AMD CPUs, the "ABM" extension provides bothPOPCNT andLZCNT. On Intel CPUs, however, the CPUID bit for "ABM" is only documented to indicate the presence of theLZCNT instruction and is listed as "LZCNT", whilePOPCNT has its own separate CPUID feature bit.
    However, all known processors that implement the "ABM"/"LZCNT" extensions also implementPOPCNT and set the CPUID feature bit for POPCNT, so the distinction is theoretical only.
    (The converse is not true – there exist processors that supportPOPCNT but not ABM, such as IntelNehalem andVIA Nano 3000.)
  2. ^TheLZCNT instruction will execute asBSR on systems that do not support the LZCNT or ABM extensions.BSR computes the index of the highest set bit in the source operand, producing a different result fromLZCNT for most input values.
  3. ^TheTZCNT instruction will execute asBSF on systems that do not support the BMI1 extension.BSF produces the same result asTZCNT for all input operand values except zero – for whichTZCNT returns input operand size, butBSF produces undefined behavior (leaves destination unmodified on most modern CPUs).
  4. ^ForBEXTR, the start position and length are not masked and can take values from 0 to 255. If the selected bits extend beyond the end of ther/m argument (which has the usual 32/64-bit operand size), then the out-of-bounds bits are read out as 0.
  5. ^On AMD processors before Zen 3, thePEXT andPDEP instructions are quite slow[89] and exhibit data-dependent timing due to the use of a microcoded implementation (about 18 to 300 cycles, depending on the number of bits set in the mask argument). As a result, it is often faster to use other instruction sequences on these processors.[90][91]

Added with Intel TSX

[edit]
Main article:Transactional Synchronization Extensions
TSX SubsetInstructionOpcodeDescriptionAdded in
RTM
RestrictedTransactional memory
XBEGIN rel16
XBEGIN rel32
C7 F8cw
C7 F8cd
Start transaction. If transaction fails, perform a branch to the given relative offset.Haswell
(Deprecated on desktop/laptop CPUs from 10th generation (Ice Lake,Comet Lake) onwards, but continues to be available onXeon-branded server parts (e.g.Ice Lake-SP,Sapphire Rapids))
XABORT imm8C6 F8ibAbort transaction with 8-bit immediate as error code.
XENDNP 0F 01 D5End transaction.
XTESTNP 0F 01 D6Test if in transactional execution. SetsEFLAGS.ZF to 0 if executed inside a transaction (RTM or HLE), 1 otherwise.
HLE
Hardware Lock Elision
XACQUIREF2Instruction prefix to indicate start of hardware lock elision, used with memory atomic instructions only (for other instructions, theF2 prefix may have other meanings). When used with such instructions, may start a transaction instead of performing the memory atomic operation.Haswell
(Discontinued – the last processors to support HLE wereCoffee Lake andCascade Lake)
XRELEASEF3Instruction prefix to indicate end of hardware lock elision, used with memory atomic/store instructions only (for other instructions, theF3 prefix may have other meanings). When used with such instructions during hardware lock elision, will end the associated transaction instead of performing the store/atomic.
TSXLDTRK
Load Address Tracking suspend/resume
XSUSLDTRKF2 0F 01 E8Suspend Tracking Load AddressesSapphire Rapids
XRESLDTRKF2 0F 01 E9Resume Tracking Load Addresses

Added withIntel CET

[edit]

Intel CET (Control-Flow Enforcement Technology) adds two distinct features to help protect against security exploits such asreturn-oriented programming: ashadow stack (CET_SS), andindirect branch tracking (CET_IBT).

CET SubsetInstructionOpcodeDescriptionRingAdded in
CET_SS
Shadow stack.
When shadow stacks are enabled, return addresses are pushed on both the regular stack and the shadow stack when a function call is made. They are then both popped on return from the function call – if they do not match, then the stack is assumed to be corrupted, and a #CP exception is issued.
The shadow stack is additionally required to be stored in specially marked memory pages which cannot be modified by normal memory store instructions.
INCSSPD r32F3 0F AE /5Increment shadow stack pointer3Tiger Lake,
Zen 3
INCSSPQ r64F3 REX.W 0F AE /5
RDSSPD r32F3 0F 1E /1Read shadow stack pointer into register (low 32 bits)[a]
RDSSPQ r64F3 REX.W 0F 1E /1Read shadow stack pointer into register (full 64 bits)[a]
SAVEPREVSSPF3 0F 01 EASave previous shadow stack pointer
RSTORSSP m64F3 0F 01 /5Restore saved shadow stack pointer
WRSSD m32,r32NP 0F 38 F6 /rWrite 4 bytes to shadow stack
WRSSQ m64,r64NP REX.W 0F 38 F6 /rWrite 8 bytes to shadow stack
WRUSSD m32,r3266 0F 38 F5 /rWrite 4 bytes to user shadow stack0
WRUSSQ m64,r6466 REX.W 0F 38 F5 /rWrite 8 bytes to user shadow stack
SETSSBSYF3 0F 01 E8Mark shadow stack busy
CLRSSBSY m64F3 0F AE /6Clear shadow stack busy flag
CET_IBT
Indirect Branch Tracking.
When IBT is enabled, an indirect branch (jump, call, return) to any instruction that is not anENDBR32/64 instruction will cause a #CP exception.
ENDBR32F3 0F 1E FBTerminate indirect branch in 32-bit mode[b]3Tiger Lake
ENDBR64F3 0F 1E FATerminate indirect branch in 64-bit mode[b]
NOTRACK3E[c]Prefix used with indirectCALL/JMP near instructions (opcodesFF /2 andFF /4) to indicate that the branch target is not required to start with anENDBR32/64 instruction. Prefix only honored when NO_TRACK_EN flag is set.
  1. ^abTheRDSSPD andRDSSPQ instructions act as NOPs on processors where shadow stacks are disabled or CET is not supported.
  2. ^abENDBR32 andENDBR64 act as NOPs on processors that don't support CET_IBT or where IBT is disabled.
  3. ^This prefix has the same encoding as the DS: segment override prefix – as of April 2022, Intel documentation does not appear to specify whether this prefix also retains its old segment-override function when used as a no-track prefix, nor does it provide an official mnemonic for this prefix.[92][93] (GNU binutils use "notrack"[94])

Added with XSAVE

[edit]

The XSAVE instruction set extensions are designed to save/restore CPU extended state (typically for the purpose ofcontext switching) in a manner that can be extended to cover new instruction set extensions without the OS context-switching code needing to understand the specifics of the new extensions. This is done by defining a series ofstate-components, each with a size and offset within a given save area, and each corresponding to a subset of the state needed for one CPU extension or another. TheEAX=0DhCPUID leaf is used to provide information about which state-components the CPU supports and what their sizes/offsets are, so that the OS can reserve the proper amount of space and set the associated enable-bits.

XSAVE ExtensionInstruction
mnemonics
Opcode[a]Instruction descriptionRingAdded in
XSAVE
Processor Extended State Save/Restore.
XSAVE mem
XSAVE64 mem
NP 0F AE /4
NP REX.W 0F AE /4
Save state components specified by bitmap in EDX:EAX to memory.3Penryn,[b]
Bulldozer,
Jaguar,
Goldmont,
ZhangJiang
XRSTOR mem
XRSTOR64 mem
NP 0F AE /5
NP REX.W 0F AE /5
Restore state components specified by EDX:EAX from memory.
XGETBVNP 0F 01 D0Get value of Extended Control Register.
Reads an XCR specified by ECX into EDX:EAX.[c]
XSETBVNP 0F 01 D1Set Extended Control Register.[d]
Write the value in EDX:EAX to the XCR specified by ECX.
0
XSAVEOPT
Processor Extended State Save/Restore Optimized
XSAVEOPT mem
XSAVEOPT64 mem
NP 0F AE /6
NP REX.W 0F AE /6
Save state components specified by EDX:EAX to memory.
Unlike the olderXSAVE instruction,XSAVEOPT may abstain from writing processor state items to memory when the CPU can determine that they haven't been modified since the most recent correspondingXRSTOR.
3Sandy Bridge,
Steamroller,
Puma,
Goldmont,
ZhangJiang
XSAVEC
Processor Extended State save/restore with compaction.
XSAVEC mem
XSAVEC64 mem
NP 0F C7 /4
NP REX.W 0F C7 /4
Save processor extended state components specified by EDX:EAX to memory with compaction.3Skylake,
Goldmont,
Zen 1
XSS
Processor Extended State save/restore, including supervisor state.
XSAVES mem
XSAVES64 mem
NP 0F C7 /5
NP REX.W 0F C7 /5
Save processor extended state components specified by EDX:EAX to memory with compaction and optimization if possible.0Skylake,
Goldmont,
Zen 1
XRSTORS mem
XRSTORS64 mem
NP 0F C7 /3
NP REX.W 0F C7 /3
Restore state components specified by EDX:EAX from memory.
  1. ^Under Intel APX, theXSAVE* andXRSTOR* instructions cannot be encoded with the REX2 prefix.
  2. ^XSAVE was added in steppings E0/R0 of Penryn and is not available in earlier steppings.
  3. ^On some processors (starting withSkylake,Goldmont andZen 1), executingXGETBV with ECX=1 is permitted – this will not returnXCR1 (no such register exists) but instead returnXCR0 bitwise-ANDed with the current value of the "XINUSE" state-component bitmap (a bitmap of XSAVE state-components that are not known to be in their initial state).
    The presence of this functionality ofXGETBV is indicated byCPUID.(EAX=0Dh,ECX=1):EAX[bit 2].
  4. ^TheXSETBV instruction will cause a mandatory #VMEXIT if executed underIntel VT-x virtualization.

Added with other cross-vendor extensions

[edit]
Instruction Set ExtensionInstruction
mnemonics
OpcodeInstruction descriptionRingAdded in
SSE[a]
(non-SIMD)
PREFETCHNTA m80F 18 /0Prefetch with Non-Temporal Access.
Prefetch data under the assumption that the data will be used only once, and attempt to minimize cache pollution from said data. The methods used to minimize cache pollution are implementation-dependent.[b]
3Pentium III,
(K7),[a]
(Geode GX2),[a]
Nehemiah,
Efficeon
PREFETCHT0 m80F 18 /1Prefetch data to all levels of the cache hierarchy.[b]
PREFETCHT1 m80F 18 /2Prefetch data to all levels of the cache hierarchy except L1 cache.[b]
PREFETCHT2 m80F 18 /3Prefetch data to all levels of the cache hierarchy except L1 and L2 caches.[b]
SFENCENP 0F AE F8+x[c]Store Fence.[d]
SSE2
(non-SIMD)
LFENCENP 0F AE E8+x[c]Load Fence and Dispatch Serialization.[e]3Pentium 4,
K8,
Efficeon,
C7 Esther
MFENCENP 0F AE F0+x[c]Memory Fence.[f]
MOVNTI m32,r32
MOVNTI m64,r64
NP 0F C3 /r
NP REX.W 0F C3 /r
Non-Temporal Memory Store.
PAUSEF3 90[g]Pauses CPU thread for a short time period.[h]
Intended for use in spinlocks.[i]
CLFSH[j]
Cache Line Flush.
CLFLUSH m8NP 0F AE /7Flush one cache line to memory.
In a system with multiplecache hierarchy levels and/or multiple processors each with their own caches, the line is flushed from all of them.
3(SSE2),
Geode LX
MONITOR[k]
Monitor a memory location for memory writes.
MONITOR[l]
MONITOR EAX,ECX,EDX
NP 0F 01 C8Start monitoring a memory location for memory writes. The memory address to monitor is given by DS:AX/EAX/RAX.[m]
ECX and EDX are reserved for extra extension and hint flags, respectively.[n]
Usually 0[o]Prescott,
Yonah,
Bonnell,
K10,
Nano
MWAIT[l]
MWAIT EAX,ECX
NP 0F 01 C9Wait for a write to a monitored memory location previously specified withMONITOR.[p]
ECX and EAX are used to provide extra extension[q] and hint[r] flags, respectively.MWAIT hints are commonly used for CPU power management.
SMX
Safer Mode Extensions.
Load, authenticate and execute a digitally signed "Authenticated Code Module" as part of IntelTrusted Execution Technology.
GETSECNP 0F 37[s]Perform an SMX function. The leaf function to perform is given in EAX.[t]
Depending on leaf function, the instruction may take additional arguments in RBX, ECX and EDX.
Usually 0[u]Conroe/Merom,
WuDaoKou,[107]
Tremont
RDTSCP
ReadTime Stamp Counter and Processor ID.
RDTSCP0F 01 F9Read Time Stamp Counter and processor core ID.[v]
The TSC value is placed in EDX:EAX and the core ID in ECX.[w]
Usually 3[x]K8,[y]
Nehalem,
Silvermont,
Nano
POPCNT[z]
Population Count.
POPCNT r16,r/m16
POPCNT r32,r/m32
F3 0F B8 /rCount the number of bits that are set to 1 in its source argument.3K10,
Nehalem,
Nano 3000
POPCNT r64,r/m64F3 REX.W 0F B8 /r
SSE4.2
(non-SIMD)
CRC32 r32,r/m8F2 0F 38 F0 /rAccumulateCRC value using the CRC-32C (Castagnoli) polynomial 0x11EDC6F41 (normal form 0x1EDC6F41). This is the polynomial used in iSCSI. In contrast to the more popular one used in Ethernet, its parity is even, and it can thus detect any error with an odd number of changed bits.3Nehalem,
Bulldozer,
ZhangJiang
CRC32 r32,r/m16
CRC32 r32,r/m32
F2 0F 38 F1 /r
CRC32 r64,r/m64F2 REX.W 0F 38 F1 /r
FSGSBASE
Read/write base address of FS and GS segments from user-mode.
Available in 64-bit mode only.
RDFSBASE r32
RDFSBASE r64
F3 0F AE /0
F3 REX.W 0F AE /0
Read base address of FS: segment.3Ivy Bridge,
Steamroller,
Goldmont,
ZhangJiang
RDGSBASE r32
RDGSBASE r64
F3 0F AE /1
F3 REX.W 0F AE /1
Read base address of GS: segment.
WRFSBASE r32
WRFSBASE r64
F3 0F AE /2
F3 REX.W 0F AE /2
Write base address of FS: segment.
WRGSBASE r32
WRGSBASE r64
F3 0F AE /3
F3 REX.W 0F AE /3
Write base address of GS: segment.
MOVBE
Move to/from memory withbyte order swap.
MOVBE r16,m16
MOVBE r32,m32
NFx 0F 38 F0 /rLoad from memory to register with byte-order swap.3Bonnell,
Haswell,
Jaguar,
Steamroller,
ZhangJiang
MOVBE r64,m64NP REX.W 0F 38 F0 /r[aa]
MOVBE m16,r16
MOVBE m32,r32
NFx 0F 38 F1 /rStore to memory from register with byte-order swap.
MOVBE m64,r64NP REX.W 0F 38 F1 /r[aa]
INVPCID
InvalidateTLB entries byProcess-context identifier.
INVPCID reg,m12866 0F 38 82 /rInvalidate entries in TLB and paging-structure caches based on invalidation type in register[ab] and descriptor in m128. The descriptor contains a memory address and a PCID.[ac]

Instruction is serializing on AMD but not Intel CPUs.

0Haswell,
ZhangJiang,
Zen 3,
Gracemont
PREFETCHW[ad]
Cache-line prefetch with intent to write.
PREFETCHW m80F 0D /1Prefetch cache line with intent to write.[b]3K6-2,
(Cedar Mill),[ae]
Silvermont,
Broadwell,
ZhangJiang
PREFETCH m8[af]0F 0D /0Prefetch cache line.[b]
ADX
Enhanced variants of add-with-carry.
ADCX r32,r/m32
ADCX r64,r/m64
66 0F 38 F6 /r
66 REX.W 0F 38 F6 /r
Add-with-carry. Differs from the olderADC instruction in that it leaves flags other thanEFLAGS.CF unchanged.3Broadwell,
Zen 1,
ZhangJiang,
Gracemont
ADOX r32,r/m32
ADOX r64,r/m64
F3 0F 38 F6 /r
F3 REX.W 0F 38 F6 /r
Add-with-carry, with the overflow-flagEFLAGS.OF serving as carry input and output, with other flags left unchanged.
SMAP
Supervisor Mode Access Prevention.
Repurposes theEFLAGS.AC (alignment check) flag to a flag that prevents access to user-mode memory while in ring 0, 1 or 2.
CLACNP 0F 01 CAClearEFLAGS.AC.0Broadwell,
Goldmont,
Zen 1,
LuJiaZui[ag]
STACNP 0F 01 CBSetEFLAGS.AC.
CLFLUSHOPT
Optimized Cache Line Flush.
CLFLUSHOPT m8NFx 66 0F AE /7Flush cache line.
Differs from the olderCLFLUSH instruction in that it has more relaxed ordering rules with respect to memory stores and other cache line flushes, enabling improved performance.
3Skylake,
Goldmont,
Zen 1
PREFETCHWT1
Cache-line prefetch into L2 cache with intent to write.
PREFETCHWT1 m80F 0D /2Prefetch data with T1 locality hint (fetch into L2 cache, but not L1 cache) and intent-to-write hint.[b]3Knights Landing,
YongFeng
PKU
Protection Keys for user pages.
RDPKRUNP 0F 01 EERead User Page Key register into EAX.3Skylake-X,
Comet Lake,
Gracemont,
Zen 3,
LuJiaZui[ag]
WRPKRUNP 0F 01 EFWrite data from EAX into User Page Key Register, and perform a Memory Fence.
CLWB
Cache Line Writeback to memory.
CLWB m8NFx 66 0F AE /6Write one cache line back to memory without invalidating the cache line.3Skylake-X,
Zen 2,
Tiger Lake,
Tremont
RDPID
Read processor core ID.
RDPID r32F3 0F C7 /7Read processor core ID into register.[v]3[ah]Goldmont Plus,
Zen 2,
Ice Lake,
LuJiaZui[ag]
MOVDIRI
Move to memory as Direct Store.
MOVDIRI m32,r32
MOVDIRI m64,r64
NP 0F 38 F9 /r
NP REX.W 0F 38 F9 /r
Store to memory using Direct Store (memory store that is not cached or write-combined with other stores).3Tiger Lake,
Tremont,
Zen 5
MOVDIR64B
Move 64 bytes as Direct Store.
MOVDIR64B reg,m51266 0F 38 F8 /rMove 64 bytes of data from m512 to address given by ES:reg. The 64-byte write is done atomically with Direct Store.[ai]3Tiger Lake,
Tremont,
Zen 5
WBNOINVD
Whole Cache Writeback without invalidate.
WBNOINVDF3 0F 09Write back all dirty cache lines to memory without invalidation.[aj] Instruction is serializing.0Zen 2,
Ice Lake-SP
PREFETCHI
Instruction prefetch.
PREFETCHIT0 m80F 18 /7Prefetch code to all levels of the cache hierarchy.[ak]3Zen 5,
Granite Rapids
PREFETCHIT1 m80F 18 /6Prefetch code to all levels of the cache hierarchy except first-level cache.[ak]
  1. ^abcAMDAthlon processors prior to the Athlon XP did not support full SSE, but did introduce the non-SIMD instructions of SSE as part of"MMX Extensions".[95] These extensions (without full SSE) are also present onGeode GX2 and later Geode processors.
  2. ^abcdefgAll of thePREFETCH* instructions are hint instructions with effects only on performance, not program semantics. Providing an invalid address (e.g. address of an unmapped page or a non-canonical address) will cause the instruction to act as a NOP without any exceptions generated.
  3. ^abcFor theSFENCE,LFENCE andMFENCE instructions, the bottom 3 bits of the ModR/M byte are ignored, and any value of x in the range 0..7 will result in a valid instruction.
  4. ^TheSFENCE instruction ensures that all memory stores after theSFENCE instruction are made globally observable after all memory stores before theSFENCE. This imposes ordering on stores that can otherwise be reordered, such as non-temporal stores and stores to WC (Write-Combining) memory regions.[96]
    On Intel CPUs, as well as AMD CPUs from Zen1 onwards (but not older AMD CPUs),SFENCE also acts as a reordering barrier on cache flushes/writebacks performed with theCLFLUSH,CLFLUSHOPT andCLWB instructions. (Older AMD CPUs requireMFENCE to orderCLFLUSH.)
    SFENCE is not ordered with respect toLFENCE, and anSFENCE+LFENCE sequence is not sufficient to prevent a load from being reordered past a previous store.[97] To prevent such reordering, it is necessary to execute anMFENCE,LOCK or a serializing instruction.
  5. ^TheLFENCE instruction ensures that all memory loads after theLFENCE instruction are made globally observable after all memory loads before theLFENCE.
    On all Intel CPUs that support SSE2, theLFENCE instruction provides a stronger ordering guarantee:[98] it isdispatch-serializing, meaning that instructions after theLFENCE instruction are allowed to start executing only after all instructions before it have retired (which will ensure that all preceding loads but not necessarily stores have completed). The effect of dispatch-serialization is thatLFENCE also acts as aspeculation barrier and a reordering barrier for accesses to non-memory resources such as performance counters (accessed through e.g.RDTSC orRDPMC) andx2apic MSRs.
    On AMD CPUs,LFENCE is not necessarily dispatch-serializing by default – however, on all AMD CPUs that support any form of non-dispatch-serializingLFENCE, it can be made dispatch-serializing by setting bit 1 of MSRC001_1029.[99]
  6. ^TheMFENCE instruction ensures that all memory loads, stores and cacheline-flushes after theMFENCE instruction are made globally observable after all memory loads, stores and cacheline-flushes before theMFENCE.
    On Intel CPUs,MFENCE isnot dispatch-serializing, and therefore cannot be used on its own to enforce ordering on accesses to non-memory resources such as performance counters and x2apic MSRs.MFENCE is still ordered with respect toLFENCE, so if there is a need to enforce ordering between memory stores and subsequent non-memory accesses, then such an ordering can be obtained by issuing anMFENCE followed by anLFENCE.[53][100]
    On AMD CPUs,MFENCE is serializing.
  7. ^The operation of thePAUSE instruction in 64-bit mode is, unlikeNOP, unaffected by the presence of theREX.R prefix. NeitherNOP norPAUSE are affected by the other bits of theREX prefix. A few examples of how opcode90 interacts with various prefixes in 64-bit mode are:
    • 90 isNOP
    • 41 90 isXCHG R8D,EAX
    • 4E 90 isNOP
    • 49 90 isXCHG R8,RAX
    • F3 90 isPAUSE
    • F3 41 90 isPAUSE
    • F3 4F 90 isPAUSE
  8. ^The actual length of the pause performed by thePAUSE instruction is implementation-dependent.
    On systems without SSE2,PAUSE will execute as NOP.
  9. ^Under VT-x or AMD-V virtualization, executingPAUSE many times in a short time interval may cause a #VMEXIT. The number ofPAUSE executions and interval length that can trigger #VMEXIT are platform-specific.
  10. ^While theCLFLUSH instruction was introduced together with SSE2, it has its own CPUID flag and may be present on processors not otherwise implementing SSE2 and/or absent from processors that otherwise implement SSE2. (E.g. AMDGeode LX supportsCLFLUSH but not SSE2.)
  11. ^While theMONITOR andMWAIT instructions were introduced at the same time as SSE3, they have their own CPUID flag that needs to be checked separately from the SSE3 CPUID flag (e.g.Athlon 64 X2 andVIA C7 supported SSE3 but not MONITOR.)
  12. ^abFor theMONITOR andMWAIT instructions, older Intel documentation[101] lists instruction mnemonics with explicit operands (MONITOR EAX,ECX,EDX andMWAIT EAX,ECX), while newer documentation omits these operands. Assemblers/disassemblers may support one or both of these variants.[102]
  13. ^ForMONITOR, the DS: segment can be overridden with a segment prefix.
    The memory area that will be monitored will be not just the single byte specified by DS:rAX, but a linear memory region containing the byte – the size and alignment of this memory region is implementation-dependent and can be queried through CPUID.
    The memory location to monitor should have memory type WB (write-back cacheable), or else monitoring may fail.
  14. ^As of April 2024, no extensions or hints have been defined for theMONITOR instruction. As such, the instruction requires ECX=0 and ignores EDX.
  15. ^On some processors, such as IntelXeon Phi x200[103] and AMD K10[104] and later, there exist documented MSRs that can be used to enableMONITOR andMWAIT to run in Ring 3.
  16. ^The wait performed byMWAITmay be ended by system events other than a memory write (e.g. cacheline evictions, interrupts) – the exact set of events that can cause the wait to end is implementation-specific.
    Regardless of whether the wait was ended by a memory write or some other event, monitoring will have ended and it will be necessary to set up monitoring again withMONITOR before usingMWAIT to wait for memory writes again.
  17. ^The extension flags available forMWAIT in the ECX register are:
    BitsMWAIT Extension
    0Treat interrupts as break events, even when masked (EFLAGS.IF=0). (Available on all non-NetBurst implementations ofMWAIT.)
    1Timed MWAIT: end the wait when theTSC reaches or exceeds the value in EDX:EBX. (Undocumented, reportedly present in IntelSkylake and later Intel processors)[105]
    2Monitorless MWAIT[106]
    31:3Not used, must be set to zero.
  18. ^The hint flags available forMWAIT in the EAX register are:
    BitsMWAIT Hint
    3:0Sub-state within a C-state (see bits 7:4) (Intel processors only)
    7:4TargetCPU power C-state during wait, minus 1. (E.g. 0000b for C1, 0001b for C2, 1111b for C0)
    31:8Not used.

    The C-states are processor-specific power states, which do not necessarily correspond 1:1 toACPI C-states.

  19. ^For theGETSEC instruction, theREX.W prefix enables 64-bit addresses for the EXITAC leaf function only - REX prefixes are otherwise permitted but ignored for the instruction.
  20. ^The leaf functions defined forGETSEC (selected by EAX) are:
    EAXFunction
    0 (CAPABILITIES)Report SMX capabilities
    2 (ENTERACCES)Enter execution of authenticated code module
    3 (EXITAC)Exit execution of authenticated code module
    4 (SENTER)Enter measured environment
    5 (SEXIT)Exit measured environment
    6 (PARAMETERS)Report SMX parameters
    7 (SMCTRL)SMX Mode Control
    8 (WAKEUP)Wake up sleeping processors in measured environment

    Any unsupported value in EAX causes an #UD exception.

  21. ^ForGETSEC, most leaf functions are restricted to Ring 0, but the CAPABILITIES (EAX=0) and PARAMETERS (EAX=6) leaf functions are available in Ring 3.
  22. ^abThe "core ID" value read byRDTSCP andRDPID is actually theTSC_AUX MSR (MSRC000_0103h). Whether this value actually corresponds to a processor ID is a matter of operating system convention.
  23. ^Unlike the olderRDTSC instruction,RDTSCP will delay the TSC read until all previous instructions have retired, guaranteeing ordering with respect to preceding memory loads (but not stores).RDTSCP is not ordered with respect to subsequent instructions, though.
  24. ^RDTSCP can be run outside Ring 0 only ifCR4.TSD=0.
  25. ^Support forRDTSCP was added in stepping F of the AMD K8, and is not available on earlier steppings.
  26. ^While thePOPCNT instruction was introduced at the same time as SSE4.2, it is not considered to be a part of SSE4.2, but instead a separate extension with its own CPUID flag.
    On AMD processors, it is considered to be a part of the ABM extension, but still has its own CPUID flag.
  27. ^abFor theMOVBE instruction, encodings that use both the66h prefix and theREX.W prefix will cause #UD on some processors (e.g. Haswell[108]) and should therefore be avoided.
  28. ^The invalidation types defined forINVPCID (selected by register argument) are:
    ValueFunction
    0Invalidate TLB entries matching PCID and virtual memory address in descriptor, excluding global entries
    1Invalidate TLB entries matching PCID in descriptor, excluding global entries
    2Invalidate all TLB entries, including global entries
    3Invalidate all TLB entries, excluding global entries

    Any unsupported value in the register argument causes a #GP exception.

  29. ^Unlike the olderINVLPG instruction,INVPCID will cause a #GP exception if the provided memory address is non-canonical. This discrepancy has been known to cause security issues.[109]
  30. ^ThePREFETCH andPREFETCHW instructions are mandatory parts of the3DNow! instruction set extension, but are also available as a standalone extension on systems that do not support 3DNow!
  31. ^The opcodes forPREFETCH andPREFETCHW (0F 0D /r) execute as NOPs on Intel CPUs from Cedar Mill (65nmPentium 4) onwards, withPREFETCHW gaining prefetch functionality from Broadwell onwards.
  32. ^ThePREFETCH (0F 0D /0) instruction is a3DNow! instruction, present on all processors with 3DNow! but not necessarily on processors with the PREFETCHW extension.
    On AMD CPUs with PREFETCHW, opcode0F 0D /0 as well as opcodes0F 0D /2../7 are all documented to be performing prefetch.
    On Intel processors with PREFETCHW, these opcodes are documented as performing reserved-NOPs[110] (except0F 0D /2 beingPREFETCHWT1 m8 onXeon Phi only) – third party testing[111] indicates that some or all of these opcodes may be performing prefetch on at least some Intel Core CPUs.
  33. ^abcThe SMAP, PKU and RDPID instruction set extensions are supported on stepping 2[112] and later ofZhaoxin LuJiaZui, but not on earlier steppings.
  34. ^Unlike the olderRDTSCP instruction which can also be used to read the processor ID, user-modeRDPID is not disabled byCR4.TSD=1.
  35. ^ForMOVDIR64, the destination address given by ES:reg must be 64-byte aligned.
    The operand size for the register argument is given by the address size, which may be overridden by the67h prefix.
    The 64-byte memory source argument does not need to be 64-byte aligned, and is not guaranteed to be read atomically.
  36. ^TheWBNOINVD instruction will execute asWBINVD if run on a system that doesn't support the WBNOINVD extension.
    WBINVD differs fromWBNOINVD in thatWBINVD will invalidate all cache lines after writeback.
  37. ^abIn initial implementations, thePREFETCHIT0 andPREFETCHIT1 instructions will perform code prefetch only when using the RIP-relative addressing mode and act as NOPs otherwise.
    The PREFETCHI instructions are hint instructions only - if an attempt is made to prefetch an invalid address, the instructions will act as NOPs with no exceptions generated. On processors that support Long-NOP but do not support the PREFETCHI instructions, these instructions will always act as NOPs.

Added with other Intel-specific extensions

[edit]
Instruction Set ExtensionInstruction
mnemonics
OpcodeInstruction descriptionRingAdded in
SSE2branch hints
Instruction prefixes that can be used with theJcc instructions to provide branch taken/not-taken hints.
HWNT,
hint-not-taken[a]
2E[b]Instruction prefix: branch hint weakly not taken.3Pentium 4,[c]
Meteor Lake[116]
HST,
hint-taken[a]
3E[b]Instruction prefix: branch hint strongly taken.
SGX
Software Guard Extensions.
Set up an encrypted enclave in which a guest can execute code that a compromised or malicious host cannot inspect or tamper with.
ENCLSNP 0F 01 CFPerform an SGX Supervisor function. The function to perform is given in EAX[d] - depending on function, the instruction may take additional input operands in RBX, RCX and RDX.

Depending on function, the instruction may return data in RBX and/or an error code in EAX.

0
SGX1
Skylake,[e]
Goldmont Plus
SGX2
Goldmont Plus,
Ice Lake-SP[120]
OVERSUB[117]
Ice Lake-SP,
Tremont
ENCLUNP 0F 01 D7Perform an SGX User function. The function to perform is given in EAX[f] - depending on function, the instruction may take additional input operands in RBX, RCX and RDX.

Depending on function, the instruction may return data/status information in EAX and/or RCX.

3[g]
ENCLVNP 0F 01 C0Perform an SGX Virtualization function. The function to perform is given in EAX[h] - depending on function, the instruction may take additional input operands in RBX, RCX and RDX.

Instruction returns status information in EAX.

0[i]
PTWRITE
Write data to a Processor Trace Packet.
PTWRITE r/m32
PTWRITE r/m64
F3 0F AE /4
F3 REX.W 0F AE /4
Read data from register or memory to encode into a PTW packet.[j]3Kaby Lake,
Goldmont Plus
PCONFIG
Platform Configuration, including TME-MK ("Total Memory Encryption – Multi-Key") and TSE ("Total Storage Encryption").
PCONFIGNP 0F 01 C5Perform a platform feature configuration function. The function to perform is specified in EAX[k] - depending on function, the instruction may take additional input operands in RBX, RCX and RDX.

If the instruction fails, it will set EFLAGS.ZF=1 and return an error code in EAX. If it is successful, it sets EFLAGS.ZF=0 and EAX=0.

0Ice Lake-SP
CLDEMOTE
Cache Line Demotion Hint.
CLDEMOTE m8NP 0F 1C /0Move cache line containing m8 from CPU L1 cache to a more distant level of the cache hierarchy.[l]3(Tremont),
(Alder Lake),
Sapphire Rapids[m]
WAITPKG
User-mode memory monitoring and waiting.
UMONITOR r16/32/64F3 0F AE /6Start monitoring a memory location for memory writes. The memory address to monitor is given by the register argument.[n]3Tremont,
Alder Lake
UMWAIT r32
UMWAIT r32,EDX,EAX
F2 0F AE /6Timed wait for a write to a monitored memory location previously specified withUMONITOR. In the absence of a memory write, the wait will end when either the TSC reaches the value specified by EDX:EAX or the wait has been going on for an OS-controlled maximum amount of time.[o]Usually 3[p]
TPAUSE r32
TPAUSE r32,EDX,EAX
66 0F AE /6Wait until theTime Stamp Counter reaches the value specified in EDX:EAX.[o]

The register argument to theUMWAIT andTPAUSE instructions specifies extra flags to control the operation of the instruction.[q]

SERIALIZE
Instruction Execution Serialization.
SERIALIZENP 0F 01 E8Serialize instruction fetch and execution.[r]3Alder Lake
HRESET
Processor History Reset.
HRESET imm8F3 0F 3A F0 C0ibRequest that the processor reset selected components of hardware-maintained prediction history. A bitmap of which components of the CPU's prediction history to reset is given in EAX (the imm8 argument is ignored).[s]0Alder Lake
UINTR
User Interprocessor interrupt.
Available in 64-bit mode only.
SENDUIPI regF3 0F C7 /6Send Interprocessor User Interrupt.[t]3Sapphire Rapids
UIRETF3 0F 01 ECUser Interrupt Return.

PopsRIP,RFLAGS andRSP off the stack, in that order.[u]

TESTUIF3 0F 01 EDTest User Interrupt Flag.
Copies UIF toEFLAGS.CF .
CLUIF3 0F 01 EEClear User Interrupt Flag.
STUIF3 0F 01 EFSet User Interrupt Flag.
ENQCMD
Enqueue Store.

Part of Intel DSA (Data Streaming Accelerator Architecture).[124]

ENQCMD reg,m512F2 0F 38 F8 /rEnqueue Command. Reads a 64-byte "command data" structure from memory (m512 argument) and writes atomically to a memory-mapped Enqueue Store device (register argument provides the memory address of this device, using ES segment and requiring 64-byte alignment.[v]) Sets ZF=0 to indicate that device accepted the command, or ZF=1 to indicate that command was not accepted (e.g. queue full or the memory location was not an Enqueue Store device.)3Sapphire Rapids
ENQCMDS reg,m512F3 0F 38 F8 /rEnqueue Command Supervisor. Differs fromENQCMD in that it can place an arbitrary PASID (process address-space identifier) and a privilege-bit in the "command data" to enqueue.0
WRMSRNS
Non-serializing Write toModel-specific register.
WRMSRNSNP 0F 01 C6Write Model-specific register. The MSR to write is specified in ECX, and the data to write is given in EDX:EAX.

The instruction differs from the olderWRMSR instruction in that it is not serializing.

0Sierra Forest
MSRLIST
Read/write multipleModel-specific registers.
Available in 64-bit mode only.
RDMSRLISTF2 0F 01 C6Read multiple MSRs. RSI points to a table of up to 64 MSR indexes to read (64 bits each), RDI points to a table of up to 64 data items that the MSR read-results will be written to (also 64 bits each), and RCX provides a 64-entry bitmap of which of the table entries to actually perform an MSR read for.[w]0Sierra Forest
WRMSRLISTF3 0F 01 C6Write multiple MSRs. RSI points to a table of up to 64 MSR indexes to write (64 bits each), RDI points to a table of up to 64 data items to write into the MSRs (also 64 bits each), and RCX provides a 64-entry bitmap of which of the table entries to actually perform an MSR write for.[w] The MSRs are written in table order.

The instruction is not serializing.

CMPCCXADD
Atomically perform a compare - and afetch-and-add if the condition is met.
Available in 64-bit mode only.
CMPccXADD m32,r32,r32
CMPccXADD m64,r64,r64
 
VEX.128.66.0F38.W0 Ex /r
VEX.128.66.0F38.W1 Ex /r

[x][y] 
Read value from memory, then compare to first register operand. If the comparison passes, then add the second register operand to the memory value. The instruction as a whole is performed atomically.
The operation ofCMPccXADD [mem],reg1,reg2 is:
temp1 := [mem]EFLAGS := CMP temp1, reg1 // sets EFLAGS like regular comparereg1 := temp1if( condition )    [mem] := temp1 + reg2
3Sierra Forest,
Lunar Lake
PBNDKB
Platform Bind Key to Binary Large Object.

Part of Intel TSE (Total Storage Encryption), and available in 64-bit mode only.

PBNDKBNP 0F 01 C7Bind information to a platform by encrypting it with a platform-specific wrapping key. The instruction takes as input the addresses to two 256-byte-aligned "bind structures" in RBX and RCX, reads the structure pointed to by RBX and writes a modified structure to the address given in RCX.

If the instruction fails, it will set EFLAGS.ZF=1 and return an error code in EAX. If it is successful, it sets EFLAGS.ZF=0 and EAX=0.

0Lunar Lake
  1. ^abThe branch hint mnemonicsHWNT andHST are listed in earlyWillamette documentation only[113] - later Intel documentation lists the branch hint prefixes without assigning them a mnemonic.[114]

    Intel XED uses the mnemonicshint-taken andhint-not-taken for these branch hints.[115]

  2. ^abThe2E and3E prefixes are interpreted as branch hints only when used with theJcc conditional branch instructions (opcodes70..7F and0F 80..8F) - when used with other opcodes, they may take other meanings (e.g. for instructions with memory operands outside 64-bit mode, they will work as segment-override prefixesCS: andDS:, respectively). On processors that don't support branch hints, these prefixes are accepted but ignored when used withJcc.
  3. ^Branch hints are supported on allNetBurst (Pentium 4 family) processors - but not supported on any other known processor prior to their re-introduction in "Redwood Cove" CPUs, starting with "Meteor Lake" in 2023.
  4. ^The leaf functions defined forENCLS (selected by EAX) are:
    EAXFunction
    0 (ECREATE)Create an enclave
    1 (EADD)Add a page
    2 (EINIT)Initialize an enclave
    3 (EREMOVE)Remove a page from EPC (Enclave Page Cache)
    4 (EDBGRD)Read data by debugger
    5 (EDBGWR)Write data by debugger
    6 (EEXTEND)Extend EPC page measurement
    7 (ELDB)Load an EPC page as blocked
    8 (ELDU)Load an EPC page as unblocked
    9 (EBLOCK)Block an EPC page
    A (EPA)Add version array
    B (EWB)Writeback/invalidate EPC page
    C (ETRACK)Activate EBLOCK checks
    Added with SGX2
    D (EAUG)Add page to initialized enclave
    E (EMODPTR)Restrict permissions of EPC page
    F (EMODT)Change type of EPC page
    Added with OVERSUB[117]
    10 (ERDINFO)Read EPC page type/status info
    11 (ETRACKC)Activate EBLOCK checks
    12 (ELDBC)Load EPC page as blocked with enhanced error reporting
    13 (ELDUC)Load EPC page as unblocked with enhanced error reporting
    Other
    18 (EUPDATESVN)Update SVN (Security Version Number) after live microcode update[118]

    Any unsupported value in EAX causes a #GP exception.

  5. ^SGX is deprecated on desktop/laptop processors from 11th generation (Rocket Lake,Tiger Lake) onwards, but continues to be available onXeon-branded server parts.[119]
  6. ^The leaf functions defined forENCLU (selected by EAX) are:
    EAXFunction
    0 (EREPORT)Create a cryptographic report
    1 (EGETKEY)Create a cryptographic key
    2 (EENTER)Enter an Enclave
    3 (ERESUME)Re-enter an Enclave
    4 (EEXIT)Exit an Enclave
    Added with SGX2
    5 (EACCEPT)Accept changes to EPC page
    6 (EMODPE)Extend EPC page permissions
    7 (EACCEPTCOPY)Initialize pending page
    Added with TDX[121]
    8 (EVERIFYREPORT2)Verify a cryptographic report of a trust domain
    Added with AEX-Notify
    9 (EDECCSSA)Decrement TCS.CSSA

    Any unsupported value in EAX causes a #GP exception.
    The EENTER and ERESUME functions cannot be executed inside an SGX enclave – the other functions can only be executed inside an enclave.

  7. ^ENCLU can only be executed in ring 3, not rings 0/1/2.
  8. ^The leaf functions defined forENCLV (selected by EAX) are:
    EAXFunction
    Added with OVERSUB[117]
    0 (EDECVIRTCHILD)Decrement VIRTCHILDCNT in SECS
    1 (EINCVIRTCHILD)Increment VIRTCHILDCNT in SECS
    2 (ESETCONTEXT)Set ENCLAVECONTEXT field in SECS

    Any unsupported value in EAX causes a #GP exception.
    TheENCLV instruction is only present on systems that support the EPC Oversubscription Extensions to SGX ("OVERSUB").

  9. ^ENCLV is only available if Intel VMX operation is enabled withVMXON, and will produce #UD otherwise.
  10. ^ForPTWRITE, the write to the Processor Trace Packet will only happen if a set of enable-bits (the "TriggerEn", "ContextEn", "FilterEn" bits of theRTIT_STATUS MSR and the "PTWEn" bit of theRTIT_CTL MSR) are all set to 1.
    ThePTWRITE instruction is indicated in the SDM to cause an #UD exception if the 66h instruction prefix is used, regardless of other prefixes.
  11. ^The leaf functions defined forPCONFIG (selected by EAX) are:
    EAXFunction
    0MKTME_KEY_PROGRAM:
    Program key and encryption mode to use with an TME-MK Key ID.
    Added with TSE
    1TSE_KEY_PROGRAM:
    Direct key programming for TSE.
    2TSE_KEY_PROGRAM_WRAPPED:
    Wrapped key programming for TSE.

    Any unsupported value in EAX causes a #GP(0) exception.

  12. ^ForCLDEMOTE, the cache level that it will demote a cache line to is implementation-dependent.
    Since the instruction is considered a hint, it will execute as a NOP without any exceptions if the provided memory address is invalid or not in the L1 cache. It may also execute as a NOP under other implementation-dependent circumstances as well.
    On systems that do not support the CLDEMOTE extension, it executes as a NOP.
  13. ^Intel documentation lists Tremont and Alder Lake as the processors in which CLDEMOTE was introduced. However, as of May 2022, no Tremont or Alder Lake models have been observed to have the CPUID feature bit for CLDEMOTE set, while several of them have the CPUID bit cleared.[122]
    As of April 2023, the CPUID feature bit for CLDEMOTE has been observed to be set for Sapphire Rapids.[123]
  14. ^ForUMONITOR, the operand size of the address argument is given by the address size, which may be overridden by the67h prefix. The default segment used is DS:, which can be overridden with a segment prefix.
  15. ^abFor theUMWAIT andTPAUSE instructions, the operating system can use theIA32_UMWAIT_CONTROL MSR to limit the maximum amount of time that a singleUMWAIT/TPAUSE invocation is permitted to wait. TheUMWAIT andTPAUSE instructions will setRFLAGS.CF to 1 if they reached theIA32_UMWAIT_CONTROL-defined time limit and 0 otherwise.
  16. ^TPAUSE andUMWAIT can be run outside Ring 0 only ifCR4.TSD=0.
  17. ^For the register argument to theUMWAIT andTPAUSE instructions, the following flag bits are supported:
    BitsUsage
    0Preferred optimization state.
    • 0 = C0.2 (slower wakeup, improves performance of other SMT threads on same core)
    • 1 = C0.1 (faster wakeup)
    31:1(Reserved)
  18. ^While serialization can be performed with older instructions such as e.g.CPUID andIRET, these instructions perform additional functions, causing side-effects and reduced performance when stand-alone instruction serialization is needed. (CPUID additionally has the issue that it causes a mandatory #VMEXIT when executed under virtualization, which causes a very large overhead.) TheSERIALIZE instruction performs serialization only, avoiding these added costs.
  19. ^A bitmap of CPU history components that can be reset throughHRESET is provided byCPUID.(EAX=20h,ECX=0):EBX.
    As of July 2023, the following bits are defined:
    BitUsage
    0Intel Thread Director history
    31:1(Reserved)
  20. ^The register argument toSENDUIPI is an index to pick an entry from the UITT (User-Interrupt Target Table, a table specified by the newUINTR_TT andUINT_MISCMSRs.)
  21. ^OnSapphire Rapids processors, theUIRET instruction always sets UIF (User Interrupt Flag) to 1. OnSierra Forest and later processors,UIRET will set UIF to the value of bit 1 of the value popped off the stack for RFLAGS - this functionality is indicated byCPUID.(EAX=7,ECX=1):EDX[17].
  22. ^ForENQCMD andEMQCMDS, the operand-size of the register argument is given by the current address-size, which can be overridden with the67h prefix.
  23. ^abFor theRDMSRLIST andWRMSRLIST instructions, the addresses specified in the RSI and RDI registers must be 8-byte aligned.
  24. ^The condition codes supported for theCMPccXADD instructions (opcodeVEX.128.66.0F38 Ex /r with thex nibble specifying the condition) are:
    xccCondition (EFLAGS)
    0OOF=1: "Overflow"
    1NOOF=0:"Not Overflow"
    2BCF=1: "Below"
    3NBCF=0:"Not Below"
    4ZZF=1: "Zero"
    5NZZF=0:"Not Zero"
    6BE(CF=1 or ZF=1):"Below or Equal"
    7NBE(CF=0 and ZF=0):"Not Below or Equal"
    8SSF=1: "Sign"
    9NSSF=0:"Not Sign"
    APPF=1: "Parity"
    BNPPF=0:"Not Parity"
    CLSF≠OF: "Less"
    DNLSF=OF:"Not Less"
    ELE(ZF=1 or SF≠OF):"Less or Equal"
    FNLE(ZF=0 and SF=OF):"Not Less or Equal"
  25. ^Even though theCMPccXADD instructions perform a locked memory operation, they do not require or accept theLOCK (F0h) prefix - attempting to use this prefix results in #UD.

Added with other AMD-specific extensions

[edit]
Instruction Set ExtensionInstruction
mnemonics
OpcodeInstruction descriptionRingAdded in
AltMovCr8
Alternative mechanism to access the CR8control register.[a]
MOV reg,CR8F0 0F 20 /0[b]Read the CR8 register.0K8[c]
MOV CR8,regF0 0F 22 /0[b]Write to the CR8 register.
MONITORX
Monitor a memory location for writes in user mode.
MONITORXNP 0F 01 FAStart monitoring a memory location for memory writes. Similar to olderMONITOR, except available in user mode.3Excavator
MWAITXNP 0F 01 FBWait for a write to a monitored memory location previously specified withMONITORX.
MWAITX differs from the olderMWAIT instruction mainly in that it runs in user mode and that it can accept an optional timeout argument (given in TSC time units) in EBX (enabled by setting bit[1] of ECX to 1.)
CLZERO
Zero out full cache line.
CLZERO rAXNP 0F 01 FCWrite zeroes to all bytes in a memory region that has the size and alignment of a CPU cache line and contains the byte addressed by DS:rAX.[d]3Zen 1
RDPRU
Read processor register in user mode.
RDPRUNP 0F 01 FDRead selectedMSRs (mainly performance counters) in user mode. ECX specifies which register to read.[e]

The value of the MSR is returned in EDX:EAX.

Usually 3[f]Zen 2
MCOMMIT
Commit Stores To Memory.
MCOMMITF3 0F 01 FAEnsure that all preceding stores in thread have been committed to memory, and that any errors encountered by these stores have been signalled to any associated error logging resources. The set of errors that can be reported and the logging mechanism are platform-specific.
SetsEFLAGS.CF to 0 if any errors occurred, 1 otherwise.
3Zen 2
INVLPGB
Invalidate TLB Entries with broadcast.
INVLPGBNP 0F 01 FEInvalidate TLB Entries for a range of pages, with broadcast. The invalidation is performed on the processor executing the instruction, and also broadcast to all other processors in the system.
rAX takes the virtual address to invalidate and some additional flags, ECX takes the number of pages to invalidate, and EDX specifies ASID and PCID to perform TLB invalidation for.
0Zen 3
TLBSYNCNP 0F 01 FFSynchronize TLB invalidations.
Wait until all TLB invalidations signalled by preceding invocations of theINVLPGB instruction on the same logical processor have been responded to by all processors in the system. Instruction is serializing.
  1. ^The standard way to access the CR8 register is to use an encoding that makes use of theREX.R prefix, e.g.44 0F 20 07 (MOV RDI,CR8). However, theREX.R prefix is only available in 64-bit mode.
    The AltMovCr8 extension adds an additional method to access CR8, using theF0 (LOCK) prefix instead ofREX.R – this provides access to CR8 outside 64-bit mode.
  2. ^abLike other variants of MOV to/from the CRx registers, the AltMovCr8 encodings ignore the top 2 bits of the instruction's ModR/M byte, and always execute as if these two bits are set to11b.
    The AltMovCr8 encodings are available in 64-bit mode. However, combining theLOCK prefix with theREX.R prefix is not permitted and will cause an #UD exception.
  3. ^Support for AltMovCR8 was added in stepping F of the AMD K8, and is not available on earlier steppings.
  4. ^ForCLZERO, the address size and 67h prefix control whether to use AX, EAX or RAX as address. The default segment DS: can be overridden by a segment-override prefix. The provided address does not need to be aligned – hardware will align it as necessary.
    TheCLZERO instruction is intended for recovery from otherwise-fatal Machine Check errors. It is non-cacheable, cannot be used to allocate a cache line without a memory access, and should not be used for fast memory clears.[125]
  5. ^The register numbering used byRDPRU does not necessarily match that ofRDMSR/WRMSR.
    The registers supported byRDPRU as of December 2022 are:
    ECXRegister
    0MPERF (MSR 0E7h: Maximum Performance Frequency Clock Count)
    1APERF (MSR 0E8h: Actual Performance Frequency Clock Count)

    Unsupported values in ECX return 0.

  6. ^IfCR4.TSD=1, then theRDPRU instruction can only run in ring 0.

x87 floating-point instructions

[edit]

Thex87 coprocessor, if present, provides support for floating-point arithmetic. The coprocessor provides eight data registers, each holding one 80-bit floating-point value (1 sign bit, 15 exponent bits, 64 mantissa bits) – these registers are organized as a stack, with the top-of-stack register referred to as "st" or "st(0)", and the other registers referred to as st(1), st(2), ...st(7). It additionally provides a number of control and status registers, including "PC" (precision control, to control whether floating-point operations should be rounded to 24, 53 or 64 mantissa bits) and "RC" (rounding control, to pick rounding-mode: round-to-zero, round-to-positive-infinity, round-to-negative-infinity, round-to-nearest-even) and a 4-bit condition code register "CC", whose four bits are individually referred to as C0, C1, C2 and C3). Not all of the arithmetic instructions provided by x87 obey PC and RC.

Original8087 instructions

[edit]
Instruction descriptionMnemonicOpcodeAdditional items
x87 Non-Waiting[a] FPU Control InstructionsWaiting
mnemonic[b]
Initialize x87 FPUFNINITDB E3FINIT
Load x87 Control WordFLDCW m16D9 /5(none)
Store x87 Control WordFNSTCW m16D9 /7FSTCW
Store x87 Status WordFNSTSW m16[c]DD /7FSTSW
Clear x87 Exception FlagsFNCLEXDB E2FCLEX
Load x87 FPU EnvironmentFLDENV m112/m224[d]D9 /4(none)
Store x87 FPU EnvironmentFNSTENV m112/m224[d]D9 /6FSTENV
Save x87 FPU State, then initialize x87 FPUFNSAVE m752/m864[d]DD /6FSAVE
Restore x87 FPU StateFRSTOR m752/m864[d]DD /4(none)
Enable Interrupts (8087 only)[e]FNENIDB E0FENI
Disable Interrupts (8087 only)[e]FNDISIDB E1FDISI
x87 Floating-point Load/Store/Move Instructionsprecision
control
rounding
control
Load floating-point value onto stackFLD m32D9 /0No
FLD m64DD /0
FLD m80DB /5
FLD st(i)D9 C0+i
Store top-of-stack floating-point value to memory or stack registerFST m32D9 /2NoYes
FST m64DD /2
FST st(i)[f]DD D0+iNo
Store top-of-stack floating-point value to memory or stack register, then popFSTP m32D9 /3NoYes
FSTP m64DD /3
FSTP m80[f]DB /7No
FSTP st(i)[f][g]DD D8+i
DF D0+i[h]
DF D8+i[h]
Push +0.0 onto stackFLDZD9 EENo
Push +1.0 onto stackFLD1D9 E8
Pushπ (approximately 3.14159) onto stackFLDPID9 EBNo387[i]
Pushlog2(10){\displaystyle \log _{2}\left(10\right)} (approximately 3.32193) onto stackFLDL2TD9 E9
Pushlog2(e){\displaystyle \log _{2}\left(e\right)} (approximately 1.44269) onto stackFLDL2ED9 EA
Pushlog10(2){\displaystyle \log _{10}\left(2\right)} (approximately 0.30103) onto stackFLDLG2D9 EC
Pushln(2){\displaystyle \ln \left(2\right)} (approximately 0.69315) onto stackFLDLN2D9 ED
Exchange top-of-stack register with other stack registerFXCH st(i)[j][k]D9 C8+iNo
DD C8+i[h]
DF C8+i[h]
x87 Integer Load/Store Instructionsprecision
control
rounding
control
Load signed integer value onto stack from memory, with conversion to floating-pointFILD m16DF /0No
FILD m32DB /0
FILD m64DF /5
Store top-of-stack value to memory, with conversion to signed integerFIST m16DF /2NoYes
FIST m32DB /2
Store top-of-stack value to memory, with conversion to signed integer, then pop stackFISTP m16DF /3NoYes
FISTP m32DB /3
FISTP m64DF /7
Load 18-digit Binary-Coded-Decimal integer value onto stack from memory, with conversion to floating-point[l]FBLD m80DF /4No
Store top-of-stack value to memory, with conversion to 18-digit Binary-Coded-Decimal integer, then pop stackFBSTP m80DF /6No387[i]
x87 Basic Arithmetic Instructionsprecision
control
rounding
control
Floating-point add
dst <- dst + src
FADD m32D8 /0YesYes
FADD m64DC /0
FADD st,st(i)D8 C0+i
FADD st(i),stDC C0+i
Floating-point multiply
dst <- dst * src
FMUL m32D8 /1YesYes
FMUL m64DC /1
FMUL st,st(i)D8 C8+i
FMUL st(i),stDC C8+i
Floating-point subtract
dst <- dst – src
FSUB m32D8 /4YesYes
FSUB m64DC /4
FSUB st,st(i)D8 E0+i
FSUB st(i),stDC E8+i
Floating-point reverse subtract
dst <- src – dst
FSUBR m32D8 /5YesYes
FSUBR m64DC /5
FSUBR st,st(i)D8 E8+i
FSUBR st(i),stDC E0+i
Floating-point divide[m]
dst <- dst / src
FDIV m32D8 /6YesYes
FDIV m64DC /6
FDIV st,st(i)D8 F0+i
FDIV st(i),stDC F8+i
Floating-point reverse divide
dst <- src / dst
FDIVR m32D8 /7YesYes
FDIVR m64DC /7
FDIVR st,st(i)D8 F8+i
FDIVR st(i),stDC F0+i
Floating-point compare
CC <- result_of( st(0) – src )
Same operation as subtract, except that it updates the x87 CC status register instead of any of the FPU stack registers
FCOM m32D8 /2No
FCOM m64DC /2
FCOM st(i)[j]D8 D0+i
DC D0+i[h]
x87 Basic Arithmetic Instructions with Stack Popprecision
control
rounding
control
Floating-point add and popFADDP st(i),st[j]DE C0+iYesYes
Floating-point multiply and popFMULP st(i),st[j]DE C8+iYesYes
Floating-point subtract and popFSUBP st(i),st[j]DE E8+iYesYes
Floating-point reverse-subtract and popFSUBRP st(i),st[j]DE E0+iYesYes
Floating-point divide and popFDIVP st(i),st[j]DE F8+iYesYes
Floating-point reverse-divide and popFDIVRP st(i),st[j]DE F0+iYesYes
Floating-point compare and popFCOMP m32D8 /3No
FCOMP m64DC /3
FCOMP st(i)[j]D8 D8+i
DC D8+i[h]
DE D0+i[h]
Floating-point compare to st(1), then pop twiceFCOMPPDE D9No
x87 Basic Arithmetic Instructions with Integer Source Argumentprecision
control
rounding
control
Floating-point add by integerFIADD m16DA /0YesYes
FIADD m32DE /0
Floating-point multiply by integerFIMUL m16DA /1YesYes
FIMUL m32DE /1
Floating-point subtract by integerFISUB m16DA /4YesYes
FISUB m32DE /4
Floating-point reverse-subtract by integerFISUBR m16DA /5YesYes
FISUBR m32DE /5
Floating-point divide by integerFIDIV m16DA /6YesYes
FIDIV m32DE /6
Floating-point reverse-divide by integerFIDIVR m16DA /7YesYes
FIDIVR m32DE /7
Floating-point compare to integerFICOM m16DA /2No
FICOM m32DE /2
Floating-point compare to integer, and stack popFICOMP m16DA /3No
FICOMP m32DE /3
x87 Additional Arithmetic Instructionsprecision
control
rounding
control
Floating-point change signFCHSD9 E0No
Floating-point absolute valueFABSD9 E1No
Floating-point compare top-of-stack value to 0FTSTD9 E4No
Classify top-of-stack st(0) register value.
The classification result is stored in the x87 CC register.[n]
FXAMD9 E5No
Split the st(0) value into two valuesE andM representing the exponent and mantissa of st(0).
The split is done such thatM2E=st(0){\displaystyle M*2^{E}=st(0)}, whereE is an integer andM is a number whose absolute value is within the range1|M|<2{\displaystyle 1\leq \left|M\right|<2}.  [o]
st(0) is then replaced withE, after whichM is pushed onto the stack.
FXTRACTD9 F4No
Floating-point partial[p] remainder (notIEEE 754 compliant):QIntegerRoundToZero(st(0)st(1)){\displaystyle Q\leftarrow {\mathtt {IntegerRoundToZero}}\left({\frac {st(0)}{st(1)}}\right)}st(0)st(0)st(1)Q{\displaystyle st(0)\leftarrow st(0)-st(1)*Q}FPREMD9 F8No[q]
Floating-pointsquare rootFSQRTD9 FAYesYes
Floating-point round to integerFRNDINTD9 FCNoYes
Floating-point power-of-2 scaling. Rounds the value of st(1) to integer with round-to-zero, then uses it as a scale factor for st(0):[r]st(0)st(0)2IntegerRoundToZero(st(1)){\displaystyle st(0)\leftarrow st(0)*2^{{\mathtt {IntegerRoundToZero}}\left(st(1)\right)}}FSCALED9 FDNoYes[s]
x87 Transcendental Instructions[t]Source operand
range restriction
Base-2 exponential minus 1, with extra precision for st(0) close to 0:st(0)2st(0)1{\displaystyle st(0)\leftarrow 2^{st(0)}-1}F2XM1D9 F08087: 0st(0)12{\displaystyle 0\leq st(0)\leq {\frac {1}{2}}}
80387: 1st(0)1{\displaystyle -1\leq st(0)\leq 1}
Base-2Logarithm and multiply:[u]
st(1)st(1)log2(st(0)){\displaystyle st(1)\leftarrow st(1)*\log _{2}\left(st(0)\right)}followed by stack pop
FYL2XD9 F1no restrictions
Partial Tangent: Computes from st(0) a pair of valuesX andY, such thattan(st(0))=YX{\displaystyle \tan \left(st(0)\right)={\frac {Y}{X}}}TheY value replaces the top-of-stack value, and thenX is pushed onto the stack.
On 80387 and later x87, but not original 8087,X is always 1.0
FPTAND9 F28087: 0|st(0)|π4{\displaystyle 0\leq \left|st(0)\right|\leq {\frac {\pi }{4}}}
80387: 0|st(0)|<263{\displaystyle 0\leq \left|st(0)\right|<2^{63}}
Two-argument arctangent with quadrant adjustment:[v]st(1)arctan(st(1)st(0)){\displaystyle st(1)\leftarrow \arctan \left({\frac {st(1)}{st(0)}}\right)} followed by stack popFPATAND9 F38087: |st(1)||st(0)|<{\displaystyle \left|st(1)\right|\leq \left|st(0)\right|<\infty }
80387: no restrictions
Base-2 Logarithm plus 1 with extra precision for st(0) close to 0, followed by multiply:[u]
st(1)st(1)log2(st(0)+1){\displaystyle st(1)\leftarrow st(1)*\log _{2}\left(st(0)+1\right)}followed by stack pop
FYL2XP1D9 F9Intel: |st(0)|<(112){\displaystyle \left|st(0)\right|<\left(1-{\sqrt {\frac {1}{2}}}\right)}
AMD: (121)<st(0)<(21){\displaystyle \left({\sqrt {\frac {1}{2}}}-1\right)<st(0)<\left({\sqrt {2}}-1\right)}
Other x87 Instructions
No operation[w]FNOPD9 D0
Decrement x87 FPU Register Stack PointerFDECSTPD9 F6
Increment x87 FPU Register Stack PointerFINCSTPD9 F7
Free x87 FPU RegisterFFREE st(i)DD C0+i
Check and handle pending unmasked x87 FPU exceptionsWAIT,
FWAIT
9B
Floating-point store and pop, without stack underflow exception[x]FSTPNCE st(i)D9 D8+i[h]
Free x87 register, then stack popFFREEP st(i)DF C0+i[h]
  1. ^x87 coprocessors (other than the 8087) handle exceptions in a fairly unusual way. When an x87 instruction generates an unmasked arithmetic exception, it will still complete without causing a CPU fault – instead of causing a fault, it will record within the coprocessor information needed to handle the exception (instruction pointer, opcode, data pointer if the instruction had a memory operand) and set FPU status-word flag to indicate that a pending exception is present. This pending exception will then cause a CPU fault when the next x87, MMX orWAIT instruction is executed.
    The exception to this is x87's "Non-Waiting" instructions, which will execute without causing such a fault even if a pending exception is present (with some caveats, see application note AP-578[126]). These instructions are mostly control instructions that can inspect and/or modify the pending-exception state of the x87 FPU.
  2. ^For each non-waiting x87 instruction whose mnemonic begins withFN, there exists a pseudo-instruction that has the same mnemonic except without the N. These pseudo-instructions consist of aWAIT instruction (opcode9B) followed by the corresponding non-waiting x87 instruction. For example:
    • FNCLEX is an instruction with the opcodeDB E2. The corresponding pseudo-instructionFCLEX is then encoded as9B DB E2.
    • FNSAVE ES:[BX+6] is an instruction with the opcode26 DD 77 06. The corresponding pseudo-instructionFSAVE ES:[BX+6] is then encoded as9B 26 DD 77 06
    These pseudo-instructions are commonly recognized by x86 assemblers and disassemblers and treated as single instructions, even though all x86 CPUs with x87 coprocessors execute them as a sequence of two instructions.
  3. ^F(N)STSW with the AX register as a destination is available on 80287 and later, but not on the 8087.
  4. ^abcdOn 80387 and later x87 FPUs,FLDENV,F(N)STENV,FRSTOR andF(N)SAVE exist in 16-bit and 32-bit variants. The 16-bit variants will load/store a 14-byte floating-point environment data structure to/from memory – the 32-bit variants will load/store a 28-byte data structure instead. (F(N)SAVE/FRSTOR will additionally load/store an additional 80 bytes of FPU data register content after the FPU environment, for a total of 94 or 108 bytes). The choice between the 16-bit and 32-bit variants is based on theCS.D bit and the presence of the66h instruction prefix. On 8087 and 80287, only the 16-bit variants are available.
    64-bit variants of these instructions do not exist – usingREX.W under x86-64 will cause the 32-bit variants to be used. Since these can only load/store the bottom 32 bits of FIP and FDP, it is recommended to useFXSAVE64/FXRSTOR64 instead if 64-bit operation is desired.
  5. ^abIn the case of an x87 instruction producing an unmasked FPU exception, the 8087 FPU will signal anIRQ some indeterminate time after the instruction was issued. This may not always be possible to handle,[127] and so the FPU offers theF(N)DISI andF(N)ENI instructions to set/clear the Interrupt Mask bit (bit 7) of the x87 Control Word,[128] to control the interrupt.
    Later x87 FPUs, from 80287 onwards, changed the FPU exception mechanism to instead produce a CPU exception on the next x87 instruction. This made the Interrupt Mask bit unnecessary, so it was removed.[129] In later Intel x87 FPUs, theF(N)ENI andF(N)DISI instructions were kept for backwards compatibility, executing as NOPs that do not modify any x87 state.
  6. ^abcFST/FSTP with an 80-bit destination (m80 or st(i)) and an sNaN source value is documented to produce exceptions on AMD but not Intel FPUs.
  7. ^FSTP ST(0) is a commonly used idiom for popping a single register off the x87 register stack.
  8. ^abcdefghiIntel x87 alias opcode. Use of this opcode is not recommended.
    On the Intel 8087 coprocessor, several reserved opcodes would perform operations behaving similarly to existing defined x87 instructions. These opcodes were documented for the 8087[130] and 80287,[131] but then omitted from later manuals until the October 2017 update of the Intel SDM.[132]
    They are present on all known Intel x87 FPUs but unavailable on some older non-Intel FPUs, such as AMD Geode GX/LX, DM&P Vortex86[133] and NexGen 586PF.[134]
  9. ^abOn the 8087 and 80287,FBSTP and the load-constant instructions always use the round-to-nearest rounding mode. On the 80387 and later x87 FPUs, these instructions will use the rounding mode specified in the x87 RC register.
  10. ^abcdefghiFor theFADDP,FSUBP,FSUBRP,FMULP,FDIVP,FDIVRP,FCOM,FCOMP andFXCH instructions, x86 assemblers/disassemblers may recognize variants of the instructions with no arguments. Such variants are equivalent to variants using st(1) as their first argument.
  11. ^On Intel Pentium and later processors,FXCH is implemented as a register renaming rather than a true data move. This has no semantic effect, but enables zero-cycle-latency operation. It also allows the instruction to break data dependencies for the x87 top-of-stack value, improving attainable performance for code optimized for these processors.
  12. ^The result of executing theFBLD instruction on non-BCD data is undefined.
  13. ^On early IntelPentium processors, floating-point divide was subject to thePentium FDIV bug. This also affected instructions that perform divide as part of their operations, such asFPREM andFPATAN.[135]
  14. ^TheFXAM instruction will set C0, C2 and C3 based on value type in st(0) as follows:
    C3C2C0Classification
    000Unsupported (unnormal or pseudo-NaN)
    001NaN
    010Normal finite number
    011Infinity
    100Zero
    101Empty
    110Denormal number
    111Empty (may occur on 8087/80287 only)

    C1 is set to the sign-bit of st(0), regardless of whether st(0) is Empty or not.

  15. ^ForFXTRACT, the behavior that results from st(0) being zero or ±∞, differs between 8087 and 80387:
    • If st(0) is ±0, then on 8087/80287,E andM are both set equal to st(0) with no exception reported — on 80387 and later,M is set equal to st(0),E is set to -∞, and a zero-divide exception is raised.
    • If st(0) is ±∞, then on 8087/80287, an invalid-operation exception is raised and bothM andE are set to NaN — on 80387 and later,M is set equal to st(0) andE is set to +∞ with no exception reported.[136]
  16. ^ForFPREM, if the quotientQ is larger than263{\displaystyle 2^{63}}, then the remainder calculation may have been done only partially – in this case, theFPREM instruction will need to be run again in order to complete the remainder calculation. This is indicated by the instruction settingC2 to 1.
    If the instruction did complete the remainder calculation, it will setC2 to 0 and set the three bits{C0,C3,C1} to the bottom three bits of the quotientQ.
    On 80387 and later, if the instruction didn't complete the remainder calculation, then the computed remainderQ used for argument reduction will have been rounded to a multiple of 8 (or larger power-of-2), so that the bottom 3 bits of the quotient can still be correctly retrieved in a later pass that does complete the remainder calculation.
  17. ^The remainder computation done by theFPREM instruction is always exact with no roundoff errors.
  18. ^For theFSCALE instruction on 8087 and 80287, st(1) is required to be in the range215st(1)<215{\displaystyle -2^{15}\leq st(1)<2^{15}}. Also, its absolute value must be either 0 or at least 1. If these requirements are not satisfied, the result is undefined.
    These restrictions were removed in the 80387.
  19. ^ForFSCALE, rounding is only applied in the case of overflow, underflow or subnormal result.
  20. ^The x87 transcendental instructions do not obey PC or RC, but instead compute full 80-bit results. These results are not necessarily correctly rounded (seeTable-maker's dilemma) – they may have an error of up to ±1ulp onPentium or later, or up to ±1.5 ulps on earlier x87 coprocessors.
  21. ^abFor theFYL2X andFYL2XP1 instructions, the maximum error bound of ±1 ulp only holds for st(1)=1.0 – for other values of st(1), the error bound is increased to ±1.35 ulps.
    FYL2X can produce a #Z (divide-by-zero exception) if st(0)=0 and st(1) is a finite nonzero value.FYL2XP1, however, cannot produce #Z.
  22. ^ForFPATAN, the following adjustments are done as compared to just computing a one-argument arctangent of the ratiost(1)st(0){\displaystyle {\frac {st(1)}{st(0)}}}:
    • If both st(0) and st(1) are ±∞, then the arctangent is computed as if each of st(0) and st(1) had been replaced with ±1 of the same sign. This produces a result that is an odd multiple ofπ4{\displaystyle {\frac {\pi }{4}}}.
    • If both st(0) and st(1) are ±0, then the arctangent is computed as if st(0) but not st(1) had been replaced with ±1 of the same sign, producing a result of ±0 or±π{\displaystyle \pm \pi }.
    • If st(0) is negative (has sign bit set), then an addend of±π{\displaystyle \pm \pi } with the same sign as st(1) is added to the result.
  23. ^WhileFNOP is a no-op in the sense that will leave the x87 FPU register stack unmodified, it may still modify FIP and CC, and it may fault if a pending x87 FPU exception is present.
  24. ^If the top-of-stack register st(0) is Empty, then theFSTPNCE instruction will behave likeFINCSTP, incrementing the stack pointer with no data movement and no exceptions reported.

x87 instructions added in later processors

[edit]
Instruction descriptionMnemonicOpcodeAdditional items
x87 Non-Waiting Control Instructions added in80287Waiting
mnemonic
Notify FPU of entry intoProtected Mode[a]FNSETPMDB E4FSETPM
Store x87 Status Word to AXFNSTSW AXDF E0FSTSW AX
x87 Instructions added in80387[b]Source operand
range restriction
Floating-point unordered compare.
Similar to the regular floating-point compare instructionFCOM, except will not produce an exception in response to anyqNaN operands.
FUCOM st(i)[c]DD E0+ino restrictions
Floating-point unordered compare and popFUCOMP st(i)[c]DD E8+i
Floating-point unordered compare to st(1), then pop twiceFUCOMPPDA E9
IEEE 754 compliant floating-point partial remainder.[d]FPREM1D9 F5
Floating-point sine and cosine.
Computes two valuesS=sin(kst(0)){\displaystyle S=\sin \left(k*st(0)\right)} andC=cos(kst(0)){\displaystyle C=\cos \left(k*st(0)\right)} [e]
Top-of-stack st(0) is replaced withS, after whichC is pushed onto the stack.
FSINCOSD9 FB|st(0)|<263{\displaystyle \left|st(0)\right|<2^{63}}[f]
Floating-point sine.[e]st(0)sin(kst(0)){\displaystyle st(0)\leftarrow \sin \left(k*st(0)\right)}FSIND9 FE
Floating-point cosine.[e]st(0)cos(kst(0)){\displaystyle st(0)\leftarrow \cos \left(k*st(0)\right)}FCOSD9 FF
x87 Instructions added inPentium ProCondition for
conditional moves
Floating-point conditional move to st(0) based onEFLAGSFCMOVB st(0),st(i)DA C0+ibelow (CF=1)
FCMOVE st(0),st(i)DA C8+iequal (ZF=1)
FCMOVBE st(0),st(i)DA D0+ibelow or equal
(CF=1 or ZF=1)
FCMOVU st(0),st(i)DA D8+iunordered (PF=1)
FCMOVNB st(0),st(i)DB C0+inot below (CF=0)
FCMOVNE st(0),st(i)DB C8+inot equal (ZF=0)
FCMOVNBE st(0),st(i)DB D0+inot below or equal
(CF=0 and ZF=0)
FCMOVNU st(0),st(i)DB D8+inot unordered (PF=0)
Floating-point compare and setEFLAGS.
Differs from the olderFCOM floating-point compare instruction in that it puts its result in the integerEFLAGS register rather than the x87 CC register.[g]
FCOMI st(0),st(i)DB F0+i
Floating-point compare and setEFLAGS, then popFCOMIP st(0),st(i)DF F0+i
Floating-point unordered compare and setEFLAGSFUCOMI st(0),st(i)DB E8+i
Floating-point unordered compare and setEFLAGS, then popFUCOMIP st(0),st(i)DF E8+i
x87 Non-Waiting Instructions added inPentium II,AMD K7 andSSE[h]64-bit mnemonic
(REX.W prefix)
Save x87, MMX and SSE state to a 464-byte data structure[i][j][k]FXSAVE m464byteNP 0F AE /0FXSAVE64 m464byte[l]
Restore x87, MMX and SSE state from 464-byte data structure[i][j]FXRSTOR m464byteNP 0F AE /1FXRSTOR64 m464byte[l]
x87 Instructions added as part ofSSE3
Floating-point store integer and pop, with round-to-zeroFISTTP m16DF /1
FISTTP m32DB /1
FISTTP m64DD /1
  1. ^The x87 FPU needs to know whether it is operating inReal Mode orProtected Mode because the floating-point environment accessed by theF(N)SAVE,FRSTOR,FLDENV andF(N)STENV instructions has different formats in Real Mode and Protected Mode. On 80287, theF(N)SETPM instruction is required to communicate the real-to-protected mode transition to the FPU. On 80387 and later x87 FPUs, real↔protected mode transitions are handled automatically between the CPU and the FPU without the need for any dedicated instructions – therefore, on these FPUs,FNSETPM executes as a NOP that does not modify any FPU state.
  2. ^Not includingdiscontinued instructions specific to particular 80387-compatible FPU models.
  3. ^abFor theFUCOM andFUCOMP instructions, x86 assemblers/disassemblers may recognize variants of the instructions with no arguments. Such variants are equivalent to variants using st(1) as their first argument.
  4. ^The 80387FPREM1 instruction differs from the olderFPREM (D9 F8) instruction in that the quotientQ is rounded to integer with round-to-nearest-even rounding rather than the round-to-zero rounding used byFPREM. LikeFPREM,FPREM1 always computes an exact result with no roundoff errors. LikeFPREM, it may also perform a partial computation if the quotient is too large, in which case it must be run again.
  5. ^abcDue to the x87 FPU performing argument reduction for sin/cos with only about 68 bits of precision, the value ofk used in the calculation ofFSIN,FCOS andFSINCOS is not precisely 1.0, but instead given by[137][138][136]k=266π266π1.0000000000000000000012874{\displaystyle k{=}{\frac {2^{66}*\pi }{\lfloor 2^{66}*\pi \rfloor }}\approx 1.0000000000000000000012874}This argument reduction inaccuracy also affects theFPTAN instruction.
  6. ^If st(0) is finite and its absolute value is263{\displaystyle 2^{63}} or greater, then the top-of-stack value st(0) is left unmodified and C2 is set, with no exception raised. This applies to theFSIN,FCOS andFSINCOS instructions, as well asFPTAN on 80387 and later.
    In this case, theFSINCOS andFPTAN instructions will also abstain from pushing a value onto the x87 register-stack.
  7. ^TheFCOMI,FCOMIP,FUCOMI andFUCOMIP instructions write their results to theZF,CF andPF bits of theEFLAGS register. On Intel but not AMD processors, theSF,AF andOF bits ofEFLAGS are also zeroed out by these instructions.
  8. ^TheFXSAVE andFXRSTOR instructions were added in the "Deschutes" revision of Pentium II, and are not present in earlier "Klamath" revision.
    They are also present in AMD K7.
    They are also considered an integral part of SSE and are therefore present in all processors with SSE.
  9. ^abTheFXSAVE andFXRSTOR instructions will save/restore SSE state only on processors that support SSE. Otherwise, they will only save/restore x87 and MMX state.
    The x87 section of the state saved/restored byFXSAVE(64)/FXRSTOR(64) has a completely different layout than the data structure of the olderF(N)SAVE/FRSTOR instructions, enabling faster save/restore by avoiding misaligned loads and stores.
    FXSAVE andFXRSTOR require their memory argument to be 16-byte aligned.
  10. ^abWhen floating-point emulation is enabled withCR0.EM=1,FXSAVE(64) andFXRSTOR(64) are considered to be x87 instructions and will accordingly produce an#NM (device-not-available) exception. Other thanWAIT, these are the only opcodes outside theD8..DF ESC opcode space that exhibit this behavior.
    Except on Netburst (Pentium 4 family) CPUs, all opcodes inD8..DF will produce#NM ifCR0.EM=1, even for undefined opcodes that would produce#UD otherwise.
  11. ^Unlike the olderF(N)SAVE instruction,FXSAVE will not initialize the FPU after saving its state to memory, but instead leave the x87 coprocessor state unmodified.
  12. ^abTheFXSAVE64/FXRSTOR64 instruction differ from theFXSAVE/FXRSTOR instructions in that:
    • FXSAVE/FXRSTOR will save/restore FIP and FDP as 32-bit items, and will also save/restore FCS and FDS as 16-bit items.
    • FXSAVE64/FXRSTOR64 will save/restore FIP and FDP as 64-bit items while not saving/restoring FCS and FDS.
    This difference also applies to the laterXSAVE/XRSTOR vsXSAVE64/XRSTOR64 instructions.
    As a result, saving both FCS/FDS and the top 32 bits of 64-bit FIP/FDP cannot be accomplished with 1 instruction, but instead requires running both(F)XSAVE and(F)XSAVE64. This has been known to cause problems, especially for 64-bit hypervisors running 16/32-bit guests.[139][140]

SIMD instructions

[edit]
Main article:x86 SIMD instruction listings

Cryptographic instructions

[edit]
Main article:List of x86 cryptographic instructions

Virtualization instructions

[edit]
Main article:List of x86 virtualization instructions

Other instructions

[edit]
See also:List of discontinued x86 instructions

x86 also includes discontinued instruction sets which are no longer supported by Intel and AMD, and undocumented instructions which execute but are not officially documented.

Undocumented x86 instructions

[edit]

The x86 CPUs containundocumented instructions which are implemented on the chips but not listed in some official documents. They can be found in various sources across the Internet, such asRalf Brown's Interrupt List and atsandpile.org

Some of these instructions are widely available across many/most x86 CPUs, while others are specific to a narrow range of CPUs.

Undocumented instructions that are widely available across many x86 CPUs include

[edit]
MnemonicsOpcodesDescriptionStatus
AAM imm8D4ibASCII-Adjust-after-Multiply. On the 8086, documented for imm8=0Ah only, which is used to convert a binary multiplication result to BCD.

The actual operation isAH ← AL/imm8; AL ← AL mod imm8 for any imm8 value (except zero, which produces a divide-by-zero exception).[141]

Available beginning with 8086, documented for imm8 values other than0Ah since Pentium (earlier documentation lists no arguments).
AAD imm8D5ibASCII-Adjust-Before-Division. On the 8086, documented for imm8=0Ah only, which is used to convert a BCD value to binary for a following division instruction.

The actual operation isAL ← (AL+(AH*imm8)) & 0FFh; AH ← 0 for any imm8 value.

SALC,
SETALC
D6Set AL depending on the value of the Carry Flag (a 1-byte alternative ofSBB AL, AL)Available beginning with 8086, but only documented since Pentium Pro.
ICEBP,
INT1
F1Single byte single-step exception / InvokeICEAvailable beginning with 80386, documented (asINT1) since Pentium Pro. Executes as undocumented instruction prefix on 8086 and 80286.[142]
TEST r/m8,imm8F6 /1ibUndocumented variants of theTEST instruction.[143] Performs the same operation as the documentedF6 /0 andF7 /0 variants, respectively.Available since the 8086.

Unavailable on some 80486 steppings.[144][145]

TEST r/m16,imm16,
TEST r/m32,imm32
F7 /1iw,
F7 /1id
SHL,SAL(D0..D3) /6,
(C0..C1) /6ib
Undocumented variants of theSHL instruction.[143] Performs the same operation as the documented(D0..D3) /4 and(C0..C1) /4ib variants, respectively.Available since the 80186 (performs different operation on the 8086)[146]
(multiple)82 /(0..7)ibAlias of opcode80h, which provides variants of 8-bit integer instructions (ADD,OR,ADC,SBB,AND,SUB,XOR,CMP) with an 8-bit immediate argument.[147]Available since the 8086.[147] Explicitly unavailable in 64-bit mode but kept and reserved for compatibility.[148]
OR/AND/XOR r/m16,imm883 /(1,4,6)ib16-bitOR/AND/XOR with a sign-extended 8-bit immediate.Available on 8086, but only documented from 80386 onwards.[149][150]
REPNZ MOVSF2 (A4..A5)The behavior of theF2 prefix (REPNZ,REPNE) when used with string instructions other thanCMPS/SCAS is officially undefined, but there exists commercial software (e.g. the version of FDISK distributed with MS-DOS versions 3.30 to 6.22[151]) that rely on it to behave in the same way as the documentedF3 (REP) prefix.Available since the 8086.
REPNZ STOSF2 (AA..AB)
REP RETF3 C3The use of theREP prefix with theRET instruction is not listed as supported in either the Intel SDM or the AMD APM. However, AMD's optimization guide for the AMD-K8 describes theF3 C3 encoding as a way to encode a two-byteRET instruction – this is the recommended workaround for an issue in the AMD-K8's branch predictor that can cause branch prediction to fail for some 1-byteRET instructions.[152] At least some versions of gcc are known to use this encoding.[153]Executes asRET on all known x86 CPUs.
NOP67 90NOP with address-size override prefix. The use of the67h prefix for instructions without memory operands is listed by the Intel SDM (vol 2, section 2.1.1) as "reserved", but it is used in Microsoft Windows 95 as a workaround for a bug in the B1 stepping of Intel 80386.[154][155]Executes asNOP on 80386 and later.
NOP r/m0F 1F /0Official long NOP.

Introduced in the Pentium Pro in 1995, but remained undocumented until March 2006.[61][156][157]

Available on Pentium Pro and AMD K7[158] and later.

Unavailable on AMD K6, AMD Geode LX, VIA Nehemiah.[159]

NOP r/m0F 0D /rReserved-NOP. Introduced in65 nm Pentium 4. Intel documentation lists this opcode asNOP in opcode tables but not instruction listings since June 2005.[160][161] From Broadwell onwards,0F 0D /1 has been documented asPREFETCHW, while0F 0D /0 and/2../7 have been reported to exhibit undocumented prefetch functionality.[111]

On AMD CPUs,0F 0D /r with a memory argument is documented asPREFETCH/PREFETCHW since K6-2 – originally as part of 3Dnow!, but has been kept in later AMD CPUs even after the rest of 3Dnow! was dropped.

Available on Intel CPUs since65 nmPentium 4.

UD10F B9 /rIntentionally undefined instructions, but unlikeUD2 (0F 0B) these instructions were left unpublished until December 2016.[162][71]

Microsoft Windows 95 Setup is known to depend on0F FF being invalid[163][164] – it is used as a self check to test that its #UD exception handler is working properly.

Other invalid opcodes that are being relied on by commercial software to produce #UD exceptions includeFF FF (DIF-2,[165] LaserLok[166]) andC4 C4 ("BOP"[167][168]), however as of January 2022 they are not published as intentionally invalid opcodes.

All of these opcodes produce #UD exceptions on 80186 and later (except on NEC V20/V30, which assign at least0F FF to the NEC-specificBRKEM instruction.)
UD00F FF

Undocumented instructions that appear only in a limited subset of x86 CPUs include

[edit]
MnemonicsOpcodesDescriptionStatus
REP MULF3 F6 /4,F3 F7 /4On 8086/8088, aREP orREPNZ prefix on aMUL orIMUL instruction causes the result to be negated. This is due to the microcode using the “REP prefix present” bit to store the sign of the result.8086/8088 only.[169]
REP IMULF3 F6 /5,F3 F7 /5
REP IDIVF3 F6 /7,F3 F7 /7On 8086/8088, aREP orREPNZ prefix on anIDIV (but notDIV) instruction causes the quotient to be negated. This is due to the microcode using the “REP prefix present” bit to store the sign of the quotient.8086/8088 only.[169]
SAVEALL,

STOREALL

(F1) 0F 04Exact purpose unknown, causes CPU hang (HCF). The only way out is CPU reset.[170]

In some implementations, emulated throughBIOS as ahalting sequence.[171]

Ina forum post at the Vintage Computing Federation, this instruction (withF1 prefix) is explained asSAVEALL. It interacts with ICE mode.

Only available on 80286.
LOADALL0F 05Loads All Registers from Memory Address 0x000800HOnly available on 80286.

Opcode reused forSYSCALL in AMD K6 and later CPUs.

LOADALLD0F 07Loads All Registers from Memory Address ES:EDIOnly available on 80386.

Opcode reused forSYSRET in AMD K6 and later CPUs.

CL1INVMB0F 0A[172]On the Intel SCC (Single-chip Cloud Computer), invalidate all message buffers. The mnemonic and operation of the instruction, but not its opcode, are described in Intel's SCC architecture specification.[173]Available on the SCC only.
PATCH20F 0EOn AMD K6 and later maps toFEMMS operation (fast clear of MMX state) but on Intel identified asuarch data read on Intel[174]Only available in Red unlock state (0F 0F too)
PATCH30F 0FWrite uarchCan change RAM part of microcode on Intel
UMOV r,r/m,
UMOV r/m,r
0F (10..13) /rMoves data to/from user memory when operating inICE HALT mode.[175] Acts as regularMOV otherwise.Available on some 386 and 486 processors only.

Opcodes reused for SSE instructions in later CPUs.

NXOP0F 55NexGen hypercode interface.[176]Available onNexGen Nx586 only.
(multiple)0F (E0..FB)[177]NexGen Nx586 "hyper mode" instructions.

The NexGen Nx586 CPU uses "hyper code"[178] (x86 code sequences unpacked at boot time and only accessible in a special "hyper mode" operation mode, similar to DEC Alpha'sPALcode and Intel's XuCode[179]) for many complicated operations that are implemented with microcode in most other x86 CPUs. The Nx586 provides a large number of undocumented instructions to assist hyper mode operation.

Available in Nx586 hyper mode only.
PSWAPW mm,mm/m640F 0F /r BBUndocumented AMD 3DNow! instruction on K6-2 and K6-3. Swaps 16-bit words within 64-bit MMX register.[180][181]

Instruction known to be recognized byMASM 6.13 and 6.14.

Available on K6-2 and K6-3 only.

Opcode reused for documentedPSWAPD instruction from AMD K7 onwards.

Un­known mnemonic64 D6Using the64 (FS: segment) prefix with the undocumentedD6 (SALC/SETALC) instruction will, on UMC CPUs only, cause EAX to be set to0xAB6B1B07.[182][183]Available on theUMC Green CPU only. Executes asSALC on non-UMC CPUs.
FS: Jcc64 (70..7F) rel8,

64 0F (80..8F) rel16/32

On IntelNetBurst (Pentium 4) CPUs, the 64h (FS: segment) instruction prefix will, when used with conditional branch instructions, act as a branch hint to indicate that the branch will be alternating between taken and not-taken.[184] Unlike other NetBurst branch hints (CS: and DS: segment prefixes), this hint is not documented.Available on NetBurst CPUs only.

Segment prefixes on conditional branches are accepted but ignored by non-NetBurst CPUs.

JMPAI0F 3FJump and execute instructions in the undocumentedAlternate Instruction Set.Only available on some x86 processors made byVIA Technologies.
(FMA4)VEX.66.0F38 (5C..5F,68..6F,78..7F) /r imm8On AMD Zen1, FMA4 instructions are present but undocumented (missing CPUID flag). The reason for leaving the feature undocumented may or may not have been due to a buggy implementation.[185]Removed from Zen2 onwards.
(unknown, multiple)0F 0F /r ??The whitepapers for SandSifter[186] and UISFuzz[187] report the detection of large numbers of undocumented instructions in the 3DNow! opcode range on several different AMD CPUs (at leastGeode NX andC-50). Their operation is not known.

On at least AMD K6-2, all of the unassigned 3DNow! opcodes (other than the undocumentedPF2IW,PI2FW andPSWAPW instructions) are reported to execute as equivalents ofPOR (MMX bitwise-OR instruction).[181]

Present on some AMD CPUs with 3DNow!.
MOVDB,

GP2MEM

Un­knownMicroprocessor Report's article "MediaGX Targets Low-Cost PCs" from 1997, covering the introduction of the CyrixMediaGX processor, lists several new instructions that are said to have been added to this processor in order to support its new "Virtual System Architecture" features, includingMOVDB andGP2MEM – and also mentions that Cyrix did not intend to publish specifications for these instructions.[188]Unknown. No specification known to have been published.
REP XSHA512F3 0F A6 E0PerformSHA-512 hashing.

Supported by OpenSSL[189] as part of itsVIA PadLock support, and listed in a Zhaoxin-supplied Linux kernel patch,[190] but not documented by theVIA PadLock Programming Guide.

Only available on some x86 processors made byVIA Technologies andZhaoxin.
REP XMODEXPF3 0F A6 F8Instructions to performmodular exponentiation andrandom number generation, respectively.

Listed in a VIA-supplied patch to add support for VIA Nano-specific PadLock instructions to OpenSSL,[191] but not documented by the VIA PadLock Programming Guide.

XRNG2F3 0F A7 F8
Un­known mnemonic0F A7 (C1..C7)Detected by CPU fuzzing tools such as SandSifter[186] and UISFuzz[187] as executing without causing #UD on several different VIA and Zhaoxin CPUs. Unknown operation, may be related to the documentedXSTORE (0F A7 C0) instruction.
Un­known mnemonicF2 0F A6 C0ZhaoxinSM2 instruction.CPUID flags listed in a Linux kernel patch for OpenEuler,[192] description and opcode (but no instruction mnemonic) provided in a Zhaoxin patent application[193] and a Zhaoxin-provided Linux kernel patch.[194]Present in Zhaoxin KX-6000G.[195]
ZXPAUSEF2 0F A6 D0Pause the processor until theTime Stamp Counter reaches or exceeds the value specified in EDX:EAX. Low-power processor C-state can be requested in ECX. Listed in OpenEuler kernel patch.[196]Present in Zhaoxin KX-7000.
MONTMUL2Un­knownZhaoxin RSA/"xmodx" instructions. Mnemonics and CPUID flags are listed in a Linux kernel patch for OpenEuler,[192] but opcodes and instruction descriptions are not available.Unknown. Some Zhaoxin CPUs[195] have the CPUID flags for these instructions set.

Undocumented x87 instructions

[edit]
MnemonicsOpcodesDescriptionStatus
FENI,

FENI8087_NOP

DB E0FPU Enable Interrupts (8087)Documented for the Intel 80287.[131]

Present on all Intel x87 FPUs from 80287 onwards. For FPUs other than the ones where they were introduced on (8087 forFENI/FDISI and 80287 forFSETPM), they act asNOPs.

These instructions and their operation on modern CPUs are commonly mentioned in later Intel documentation, but with opcodes omitted and opcode table entries left blank (e.g.Intel SDM 325462-077, April 2022 mentions them twice without opcodes).

The opcodes are, however, recognized by Intel XED.[197]

FDISI,

FDISI8087_NOP

DB E1FPU Disable Interrupts (8087)
FSETPM,

FSETPM287_NOP

DB E4FPU Set Protected Mode (80287)
(no mnemonic)D9 D7,  D9 E2,
D9 E7,  DD FC,
DE D8,  DE DA,
DE DC,  DE DD,
DE DE,  DF FC
"Reserved by Cyrix" opcodesThese opcodes are listed as reserved opcodes that will produce "unpredictable results" without generating exceptions on at least Cyrix 6x86,[198] 6x86MX, MII, MediaGX, and AMD Geode GX/LX.[199] (The documentation for these CPUs all list the same ten opcodes.)

Their actual operation is not known, nor is it known whether their operation is the same on all of these CPUs.

See also

[edit]

References

[edit]
  1. ^"Re: Intel Processor Identification and the CPUID Instruction". Retrieved2013-04-21.
  2. ^"Intel 80x86 Instruction Set Summary"(PDF).eecs.wsu.edu.
  3. ^Michal Necasek,SGDT/SIDT Fiction and Reality, 4 May 2017.Archived on 29 Nov 2023.
  4. ^abIntel,Undocumented iAPX 286 Test Instruction.Archived on 20 Dec 2023.
  5. ^WikiChip,UMIP – x86.Archived on 16 Mar 2023.
  6. ^Oracle Corp,Oracle® VM VirtualBox Administrator's Guide for Release 6.0, section 3.5: Details About Software Virtualization.Archived on 8 Dec 2023.
  7. ^MBC Project,Virtual Machine Detection (permanent link) orVirtual Machine Detection (non permanent link)
  8. ^Andrew Schulman, "Unauthorized Windows 95" (ISBN 1-56884-169-8), chapter 8, p.249,257.
  9. ^US Patent 4974159, "Method of transferring control in a multitasking computer system" mentions 63h/ARPL.
  10. ^Intel,Pentium® Processor Family Developer’s Manual, Volume 3, 1995, order no. 241430-004, section 12.7, p. 323
  11. ^Intel,How Microarchitectural Data Sampling works, see mitigations section.Archived on Apr 22,2022
  12. ^Linux kernel documentation,Microarchitectural Data Sampling (MDS) mitigationArchived 2020-10-21 at theWayback Machine
  13. ^Intel,Processor MMIO Stale Data Vulnerabilities, 14 Jun 2022 - see "VERW Buffer Overwriting Details" section.Archived on 3 Oct 2024.
  14. ^VCF Forums,I found the SAVEALL opcode, jun 21, 2019.Archived on 13 Apr 2023.
  15. ^rep lodsb,Intel 286 secrets: ICE mode and F1 0F 04, aug 12, 2022.Archived on 8 Dec 2023.
  16. ^LKML,(PATCH) x86-64, espfix: Don't leak bits 31:16 of %esp returning to 16-bit stack, Apr 29, 2014.Archived on Jan 4, 2018
  17. ^Raymond Chen,Getting MS-DOS games to run on Windows 95: Working around the iretd problem, Apr 4, 2016.Archived on Mar 15, 2019
  18. ^sandpile.org,x86 architecture rFLAGS register, see note #7.Archived on 3 Nov 2011.
  19. ^iPXE,Commit bc35b24: Fix use of writable code segment on 486 and earlier CPUs,Github, Feb 2, 2022 − indicates that when leaving protected mode on 386/486 by writing toCR0, it is specifically necessary to do a farJMP (opcodeEA) in order to restore proper real-mode access-rights for the CS segment, and that other far control transfers (e.g.RETF,IRET) will not do this.Archived on 4 Nov 2024.
  20. ^Can Bölük,Speculating the entire x86-64 Instruction Set In Seconds with This One Weird Trick, Mar 22, 2021.Archived on Mar 23, 2021.
  21. ^abRobert Collins,Undocumented OpCodes, 29 july 1995.Archived on 21 feb 2001
  22. ^Michal Necasek,ICEBP finally documented,OS/2 Museum, May 25, 2018.Archived on 6 June 2018
  23. ^Intel,AP-526: Optimization For Intel's 32-bit Processors, order no. 242816-001, october 1995 – listsSALC on page 83,INT1 on page 86 andFFREEP on page 114. Archived from theoriginal on 22 Dec 1996.
  24. ^AMD,AMD 64-bit Technology, vol 2: System Programming, order no. 24593, rev 3.06, aug 2002, page 248
  25. ^"Intel 80386 CPU Information | PCjs Machines".www.pcjs.org.
  26. ^Geoff Chappell,CPU Identification before CPUID, 27 Jan 2020.Archived on 7 Apr 2023.
  27. ^Jeff Parsons,Obsolete 80386 Instructions: IBTS and XBTS,PCjs Machines.Archived on Sep 19, 2020.
  28. ^Robert Collins,The LOADALL Instruction. Archived from theoriginal on Jun 5, 1997.
  29. ^Toth, Ervin (1998-03-16)."BSWAP with 16-bit registers". Archived fromthe original on 1999-11-03.The instruction brings down the upper word of the doubleword register without affecting its upper 16 bits.
  30. ^Coldwin, Gynvael (2009-12-29)."BSWAP + 66h prefix". Retrieved2018-10-03.internal (zero-)extending the value of a smaller (16-bit) register … applying the bswap to a 32-bit value "00 00 AH AL", … truncated to lower 16-bits, which are "00 00". … Bochs … bswap reg16 acts just like the bswap reg32 … QEMU … ignores the 66h prefix
  31. ^Intel"i486 Microprocessor" (April 1989, order no. 240440-001) p.142 listsCMPXCHG with0F A6/A7 encodings.
  32. ^Intel"i486 Microprocessor" (November 1989, order no. 240440-002) p.135 listsCMPXCHG with0F B0/B1 encodings.
  33. ^"Intel 486 & 486 POD CPUID, S-spec, & Steppings".
  34. ^Intel,Software Guard Extensions Programming Reference, order no. 329298-002, oct 2014, sections 3.5 and 3.6.5.
  35. ^Frank van Gilluwe, "The Undocumented PC, second edition", 1997,ISBN 0-201-47950-8, page 55
  36. ^AMD,Revision Guide for AMD Athlon 64 and AMD Opteron Processors pub.no. 25759, rev 3.79, July 2009, page 34.Archived on 20 Dec 2023.
  37. ^Intel,Software Developer’s Manual, vol 3A, order no. 253668-078, Dec 2022, section 9.3, page 299.
  38. ^Intel,CPUID Enumeration and Architectural MSRs, 8 Aug 2023.Archived on 23 May 2024.
  39. ^AMD,PPR for AMD Family 19h Model 61h, Revision B1 processors, document no. 56713, rev 3.05, mar 8 2023, page 116.Archived on Apr 25, 2023.
  40. ^LKML,(PATCH 5.4 55/65) x86/apic: Add extra serialization for non-serializing MSRs, 8 Feb 2021
  41. ^Linux kernel,git commit: x86/barrier: Do not serialize MSR accesses on AMD, 13 Nov 2023
  42. ^"RSM—Resume from System Management Mode". Archived fromthe original on 2012-03-12.
  43. ^Microprocessor Report,System Management Mode Explained (vol 6, no. 8, june 17, 1992).Archived on Jun 29, 2022.
  44. ^Ellis, Simson C., "The 386 SL Microprocessor in Notebook PCs", Intel Corporation, Microcomputer Solutions, March/April 1991, page 20
  45. ^Cyrix 486SLC/e Data Sheet (1992), section 2.6.4
  46. ^Linux 6.3 kernel sources,/arch/x86/include/asm/cpuid.h, line 69
  47. ^gcc-patches mailing list,CPUID Patch for IDT Winchip, May 21, 2019.Archived on Apr 27, 2023.
  48. ^Intel,Intel® Virtualization Technology FlexMigration Application Note order no. 323850-004, oct 2012, section 2.3.2 on page 12.Archived on Oct 13, 2014.
  49. ^Intel,Atom Processor C3000 Product Family Datasheet order no. 337018-002, Feb 2018, pages 133, 3808 and 3814.Archived on Feb 9, 2022.
  50. ^AMD,AMD64 Architecture Programmer’s Manual Volume 3 pub.no. 24594, rev 3.34, oct 2022, p. 165 (entry onCPUID instruction)
  51. ^Robert Collins,CPUID Algorithm Wars, nov 1996. Archived from theoriginal on dec 18, 2000.
  52. ^Geoff Chappell,CMPXCHG8B Support in the 32-Bit Windows Kernel, 23 jan 2008.Archived on 5 Nov 2023.
  53. ^abIntel,Software Developer's Manual, order no. 325426-077, Nov 2022 – the entry on theRDTSC instruction on p.1739 describes the instruction sequences required to order theRDTSC instruction with respect to earlier and later instructions.
  54. ^Linux kernel 5.4.12,/arch/x86/kernel/cpu/centaur.c
  55. ^Stack Overflow,Can constant non-invariant tsc change frequency across cpu states? Accessed 24 Jan 2023.Archived on 24 Jan 2023.
  56. ^CPU-World,CPUID for Zhaoxin KaiXian KX-5000 KX-5650 (by timw4mail), 24 Apr 2024.Archived on 26 Apr 2024.
  57. ^Michal Necasek,"Undocumented RDTSC", 27 Apr 2018.Archived on 16 Dec 2023.
  58. ^Willy Tarreau,Re: i686 quirk for AMD Geode,Linux Kernel Mailing List, 10 Nov 2009.
  59. ^Intel,Intel 64 and IA-32 Architectures Optimization Reference Manual: Volume 1, order no. 248966-050US, April 2024, section 3.5.1.9, page 119.Archived on 9 May 2024.
  60. ^JookWiki,"nopl", sep 24, 2022 – provides a lengthy account of the history of the long NOP and the issues around it.Archived on oct 28, 2022.
  61. ^abIntel Community:Multibyte NOP Made Official.Archived on 7 Apr 2022.
  62. ^IntelSoftware Developers Manual, vol 3B (order no 253669-076us, December 2021), section 22.15 "Reserved NOP"
  63. ^AMD,AMD 64-bit Technology – AMD x86-64 Architecture Programmer’s Manual Volume 3, publication no. 24594, rev 3.02, aug 2002, page 379.
  64. ^Debian bug report logs,-686 build uses long noops, that are unsupported by Transmeta Crusoe, immediate crash on boot, see messages 148 and 158 for NOPL on VIA C7.Archived on 1 Aug 2019
  65. ^Intel,Intel Architecture Software Developer’s Manual, Volume 2, 1997, order no. 243191-001, pages 3-9 and A-7.
  66. ^John Hassey,Pentium Pro changes,GAS2 mailing list, 28 dec 1995 – patch that added theUD2A andUD2B instruction mnemomics to GNU Binutils.Archived on 25 Jul 2023.
  67. ^Jan Beulich,x86: correct UDn,binutils-gdb mailing list, 23 nov 2017 – Binutils patch that added ModR/M byte toUD1/UD2B and addedUD0.Archived on 25 Jul 2023.
  68. ^Intel,Intel Pentium 4 and Intel Xeon Processor Optimization Reference Manual, order no. 248966-007, see "Assembly/Compiler Coding Rule 13" on page 74. Archived from theoriginal on 16 Mar 2003.
  69. ^Intel,Pentium® Processor Family Developer's Manual Volume 3, 1995. order no. 241430-004, appendix A, page 943 – reserves the opcodes0F 0B and0F B9.
  70. ^abAMD,AMD64 Architecture Programmer’s Manual Volume 3, publication no. 24594, rev 3.17, dec 2011 – see page 416 forUD0 and page 415 and 419 forUD1.
  71. ^abcIntel,Software Developer's Manual, vol 2B, order no. 253667-061, dec 2016 – listsUD1 (withModR/M byte) andUD0 (without ModR/M byte) on page 4-687.
  72. ^Stecklina, Julian (2019-02-08)."Fingerprinting x86 CPUs using Illegal Opcodes".x86.lol.Archived from the original on 15 Dec 2023. Retrieved2023-12-15.
  73. ^"ud0 length fix · intelxed/xed@7561f54".GitHub.Archived from the original on 1 Jun 2023. Retrieved2023-12-15.
  74. ^AMD,AMD64 Architecture Programmer’s Manual Volume 3, publication no. 24594, rev 3.36, march 2024 – see description ofUD1 instruction on page 356.Archived on 29 Dec 2024.
  75. ^abCyrix,6x86 processor data book, 1996, order no. 94175-01, table 6-20, page 209 – uses the mnemonicOIO ("Official invalid opcode") for the0F FF opcode.
  76. ^Intel,Software Developer's Manual, vol 2B, order no. 253667-064, oct 2017 – listsUD0 (with ModR/M byte) on page 4-683.
  77. ^AMD,AMD-K5 Processor Technical Reference Manual, Nov 1996, order no. 18524C/0, section 3.3.7, page 90 – reserves the0F FF opcode without assigning it a mnemonic.
  78. ^AMD,AMD-K6 Processor Data Sheet, order no. 20695H/0, March 1998, section 24.2, page 283.
  79. ^George Dunlap,The Intel SYSRET Privilege Escalation,The Xen Project., 13 june 2012.Archived on Mar 15, 2019.
  80. ^Intel,AP-485: Intel® Processor Identification and the CPUID Instruction, order no. 241618-039, may 2012, section 5.1.2.5, page 32
  81. ^Michal Necasek,"SYSENTER, Where Are You?", 20 Jul 2017.Archived on 29 Nov 2023.
  82. ^AMD,Athlon Processor x86 Code Optimization Guide, publication no. 22007, rev K, feb 2002, appendix F, page 284.Archived on 13 Apr 2017.
  83. ^Transmeta,Processor Recognition, May 7, 2002.
  84. ^VIA,VIA C3 Nehemiah Processor Datasheet, rev 1.13, sep 29, 2004, page 17
  85. ^CPU-World,CPUID for Intel Xeon 3.40 GHz – Nocona stepping D CPUID without CMPXCHG16B
  86. ^CPU-World,CPUID for Intel Xeon 3.60 GHz – Nocona stepping E CPUID with CMPXCHG16B
  87. ^SuperUser StackExchange,How prevalent are old x64 processors lacking the cmpxchg16b instruction?
  88. ^IntelSDM order no. 325462-077, apr 2022, vol 2B, p.4-130 "MOVSX/MOVSXD-Move with Sign-Extension" lists MOVSXD without REX.W as "discouraged"
  89. ^Anandtech,AMD Zen 3 Ryzen Deep Dive Review, nov 5, 2020, page 6
  90. ^@instlatx64 (October 31, 2020)."Saving Private Ryzen: PEXT/PDEP 32/64b replacement functions for #AMD CPUs (BR/#Zen/Zen+/#Zen2) based on @zwegner's zp7" (Tweet). Retrieved2023-01-20 – viaTwitter.
  91. ^Wegner, Zach (4 November 2020)."zwegner/zp7".GitHub.
  92. ^Intel,Control-flow Enforcement Technology Specification (v3.0, order no. 334525-003, March 2019)
  93. ^Intel SDM, rev 076, December 2021, volume 1, section 18.3.1
  94. ^Binutils mailing list:x86: CET v2.0: Update NOTRACK prefix
  95. ^AMD,Extensions to the 3DNow! and MMX Instruction Sets, ref no. 22466D/0, March 2000, p.11
  96. ^Hadi Brais,The Significance of the x86 SFENCE instruction, 26 Feb 2019.
  97. ^Intel,Software Developer's Manual, order no. 325426-077, Nov 2022, Volume 1, section 11.4.4.3, page 276.
  98. ^Hadi Brais,The Significance of the LFENCE instruction, 14 May 2018
  99. ^AMD,Software techniques for managing speculation on AMD processor, rev 3.8.22, 8 March 2022, page 4.Archived on 13 March 2022.
  100. ^Intel,Software Developer's Manual, order no. 325426-084, June 2024, vol 3A, section 11.12.3, page 3411 - covers the use of theMFENCE;LFENCE sequence to enforce ordering between a memory store and a later x2apic MSR write.Archived on 4 Jul 2024
  101. ^Intel,Prescott New Instructions Software Developer’s Guide, order no. 252490-003, june 2003, pages 3-26 and 3-38 listMONITOR andMWAIT with explicit operands.Archived on 9 May 2005.
  102. ^Flat Assembler messageboard,"BLENDVPS/BLENDVPD/PBLENDVB syntax", also coversMONITOR/MWAIT mnemonics.Archived on 6 Nov 2022.
  103. ^Intel,Intel® Xeon Phi™ Product Family x200 (KNL) User mode (ring 3) MONITOR and MWAIT (archived 5 mar 2017)
  104. ^AMD,BIOS and Kernel Developer’s Guide (BKDG) For AMD Family 10h Processors, order no. 31116, rev 3.62, page 419.Archived on Apr 8, 2024.
  105. ^R. Zhang et al,(M)WAIT for It: Bridging the Gap between Microarchitectural and Architectural Side Channels, 3 Jan 2023, page 5.Archived from the original on 5 Jan 2023.
  106. ^Intel,Architecture Instruction Set Extensions Programming Reference, order no. 319433-052, March 2024, chapter 17.Archived on Apr 7, 2024.
  107. ^Guru3D,VIA Zhaoxin x86 4 and 8-core SoC processors launch, Jan 22, 2018
  108. ^Intel,Desktop 4th Generation Specification Update, order no. 328899-039, apr 2020, see erratum HSD145 on page 56. Archived from theoriginal on 6 Apr 2024.
  109. ^Vulners,x86: DoS from attempting to use INVPCID with a non-canonical addresses, 20 nov 2018
  110. ^Intel,Intel® 64 and IA-32 Architectures Software Developer’s Manual volume 3, order no. 325384-078, december 2022, chapter 23.15
  111. ^abCatherine Easdon,Undocumented CPU Behaviour on x86 and RISC-V Microarchitectures: A Security Perspective, 10 May 2019, page 39
  112. ^Instlatx64,Zhaoxin Kaixian KX-6000G CPUID dump, May 15, 2023
  113. ^Intel,Willamette Processor Software Developer’s Guide, order no. 245355-001, feb 2000, section 3.5.3, page 294 - listsHWNT/HST mnemonics for the branch hint prefixes. Archived from theoriginal on 5 Feb 2005.
  114. ^Intel,Software Developer's Manual, order no. 325462-083, March 2024 - volume 1, chapter 11.4.5, page 281 and volume 2A, chapter 2.1.1, page 525.
  115. ^Intel XED source code,src/dec/xed-disas.c, line 325, 11 Nov 2024.Archived on 24 Nov 2024.
  116. ^Intel,Intel 64 and IA-32 Architectures Optimization Reference Manual: Volume 1, order no. 248966-050US, April 2024, chapter 2.1.1.1, page 46.
  117. ^abcIntel,Intel® Software Guard Extensions (Intel® SGX) Architecture for Oversubscription of Secure Memory in a Virtualized Environment, 25 Jun 2017.
  118. ^Intel,Runtime Microcode Updates with Intel® Software Guard Extensions, sep 2021, order no. 648682 rev 1.0.Archived from the original on 31 mar 2023.
  119. ^Intel,11th Generation Intel® Core™ Processor Desktop Datasheet, Volume 1, may 2022, order no. 634648-004, section 3.5, page 65
  120. ^Intel,Which Platforms Support Intel® Software Guard Extensions (Intel® SGX) SGX2?Archived on 5 May 2022.
  121. ^Intel,Trust Domain CPU Architectural Extensions, order no. 343754-002, may 2021.
  122. ^@InstLatX64 (May 3, 2022)."The CLDEMOTE Story" (Tweet). Retrieved2023-01-23 – viaTwitter.
  123. ^@Instlatx64 (Apr 17, 2023)."20-Core Intel Xeon w7-2475X (SapphireRapids-64L) 806F8 CPUID dump" (Tweet). Retrieved2023-04-20 – viaTwitter.
  124. ^Intel,Intel Data Streaming Accelerator Architecture Specification, order no. 341204-004, Sep 2022, pages 13 and 23.Archived on 20 Jul 2023.
  125. ^Wikichip,CLZERO – x86
  126. ^Intel,Application note AP-578: Software and Hardware Considerations for FPU Exception Handlers for Intel Architecture Processors, order no. 243291-002, February 1997
  127. ^Intel,Application Note AP-113: Getting Started With The Numeric Data Processor, feb 1981, pages 24-25
  128. ^Intel,8087 Math Coprocessor, oct 1989, order no. 285385-007, page 3-100, fig 9
  129. ^Intel,80287 80-bit HMOS Numeric Processor Extension, feb 1983, order no. 201920-001, page 14
  130. ^Intel,iAPX86, 88 User's Manual, 1981 (order no. 210201-001), p. 797
  131. ^abIntel80286 and 80287 Programmers Reference Manual, 1987 (order no. 210498-005), p. 485
  132. ^IntelSoftware Developer's Manual volume 3B, revision 064, section 22.18.9
  133. ^"GCC Bugzilla – 37179 – GCC emits bad opcode 'ffreep'".
  134. ^Michael Steil,FFREEP – the assembly instruction that never existed
  135. ^Dusko Koncaliev,Pentium FDIV Bug
  136. ^abIntel,80387 Programmer's Reference Manual, order no. 231917-001, see section 4.4.12 on page 89 and section C.5 on page 190 for information onFXTRACT special-cases and section 4.4.9 on page 87 for information about theFPTAN (and by extensionFSIN/FCOS/FSINCOS) argument reduction inaccuracy.
  137. ^Bruce Dawson,Intel Underestimates Error Bounds by 1.3 quintillion
  138. ^Intel SDM, rev 053 and later, describes the exact argument reduction procedure used forFSIN,FCOS,FSINCOS andFPTAN in volume 1, section 8.3.8
  139. ^Michal Necasek,Failing to fail, 16 Jun 2023,OS/2 Museum, see addendum.Archived on 1 Oct 2024.
  140. ^VirtualBox issue tracker,ticket 12646: XP Guest GPF in WIN87EM.DLL at 0001:02C9 or 0001:02C6.Archived on 13 Mar 2016.
  141. ^Robert Collins,Undocumented OpCodes: AAM.Archived on 21 Feb 2001
  142. ^Retrocomputing StackExchange,0F1h opcode-prefix on i80286.Archived on 13 Apr 2023.
  143. ^abFrank van Gilluwe, "The Undocumented PC – Second Edition", p. 93-95
  144. ^Michal Necasek,Intel 486 Errata?, 6 Dec 2015.Archived on 29 Nov 2023.
  145. ^Robert Hummel, "PC Magazine Programmer's Technical Reference" (ISBN 1-56276-016-5) p.728
  146. ^Raúl Gutiérrez Sanz,Undocumented 8086 Opcodes, Part I, 27 Dec 2017.Archived on 29 Nov 2023.
  147. ^ab"Asm, opcode 82h". 24 Dec 1998.Archived from the original on 14 Apr 2023.
  148. ^Intel Corporation 2022, p. 3698.
  149. ^Intel,The 8086 Family User's Manual, October 1979, opcodes omitted on pages 4-25 and 4-31
  150. ^Retrocomputing StackExchange,Undocumented instructions in x86 CPU prior to 80386?, 4 Jun 2021.Archived on 18 Jul 2023.
  151. ^Daniel B. Sedory,An Examination of the Standard MBR, 2000.Archived on 6 Oct 2023.
  152. ^AMD,Software Optimization Guide for AMD64 Processors (publication 25112, revision 3.06, sep 2005), section 6.2, p.128
  153. ^GCC bugzilla,Bug 48227 – "rep ret" generated for -march=core2.Archived on 9 Apr 2023.
  154. ^Raymond Chen,My, what strange NOPs you have!, 12 Jan 2011.Archived on 20 May 2023.
  155. ^Jeff Parsons,Intel 80386 CPU information (B1 errata section, item #7).Archived on 13 Nov 2023.
  156. ^IntelSoftware Developers Manual, volume 2B (Jan 2006, order no 235667-018, does not have long NOP)
  157. ^IntelSoftware Developers Manual, volume 2B (March 2006, order no 235667-019, has long NOP)
  158. ^Agner Fog,Instruction Tables, AMD K7 section.
  159. ^"579838 – glibc not compatible with AMD Geode LX". Archived fromthe original on 30 Jul 2023.
  160. ^IntelSoftware Developers Manual, volume 2B (April 2005, order no 235667-015, does not list 0F0D-nop)
  161. ^IntelSoftware Developers Manual, volume 2B (June 2005, order no 235667-016, lists 0F0D-nop in opcode table but not underNOP instruction description.)
  162. ^IntelSoftware Developers Manual, volume 2B (order no. 253667-060, September 2016) does not listUD0 andUD1.
  163. ^"PCJS : pcjs/x86op0F.js (two-byte x86 opcode handlers), lines 1647–1651".GitHub. 17 April 2022. Archived fromthe original on 13 Apr 2023.
  164. ^"80486 paging protection faults? \ VOGONS".Archived from the original on 9 April 2022.
  165. ^"Invalid opcode handling \ VOGONS".Archived from the original on 9 April 2022.
  166. ^"Invalid instructions cause exit even if Int 6 is hooked \ VOGONS".Archived from the original on 9 April 2022.
  167. ^"Tutorial – Calling Win32 from DOS".Ragestorm. 17 Sep 2005.Archived from the original on 9 April 2022.
  168. ^"Accessing Windows device drivers from DOS programs". Archived fromthe original on 8 Nov 2011.
  169. ^ab"8086 microcode disassembled".Reenigne blog. 2020-09-03.Archived from the original on 8 Dec 2023. Retrieved2022-07-26.Using the REP or REPNE prefix with a MUL or IMUL instruction negates the product. Using the REP or REPNE prefix with an IDIV instruction negates the quotient.
  170. ^"Re: Undocumented opcodes (HINT_NOP)". Archived fromthe original on 2004-11-06. Retrieved2010-11-07.
  171. ^"Re: Also some undocumented 0Fh opcodes". Archived fromthe original on 2003-06-26. Retrieved2010-11-07.
  172. ^Intel'sRCCE library for the SCC used opcode0F 0A for SCC's message invalidation instruction.
  173. ^Intel Labs,SCC External Architecture Specification (EAS), Revision 0.94, p.29.Archived on May 22, 2022.
  174. ^"Undocumented x86 instructions to control the CPU at the microarchitecture level in modern Intel processors"(PDF). 9 July 2021.
  175. ^Robert R. Collins,Undocumented OpCodes: UMOV.Archived on Feb 21, 2001.
  176. ^Herbert Oppmann,NXOP (Opcode 0Fh 55h)
  177. ^Herbert Oppmann,NexGen Nx586 Hypercode Source, see COMMON.INC.Archived on 9 Apr 2023.
  178. ^Herbert Oppmann,Inside the NexGen Nx586 System BIOS.Archived on 29 Dec 2023.
  179. ^Intel,XuCode: An Innovative Technology for Implementing Complex Instruction Flows, May 6, 2021.Archived on Jul 19, 2022.
  180. ^Grzegorz Mazur,AMD 3DNow! undocumented instructions
  181. ^ab"Undocumented 3DNow! Instructions".grafi.ii.pw.edu.pl. Archived fromthe original on 30 January 2003. Retrieved22 February 2022.
  182. ^Potemkin's Hacker Group's OPCODE.LST, v4.51, 15 Oct 1999.Archived on 21 May 2001.
  183. ^"[UCA CPU Analysis] Prototype UMC Green CPU U5S-SUPER33". 25 May 2020.Archived from the original on 9 Jun 2023.
  184. ^Agner Fog,The Microarchitecture of Intel, AMD and VIA CPUs, section 3.4 "Branch Prediction in P4 and P4E".Archived on 7 Jan 2024.
  185. ^Reddit /r/Amd discussion thread:Ryzen has undocumented support for FMA4
  186. ^abChristopher Domas,Breaking the x86 ISA, 27 July 2017.Archived on 27 Dec 2023.
  187. ^abXixing Li et al,UISFuzz: An Efficient Fuzzing Method for CPU Undocumented Instruction Searching, 9 Oct 2019.Archived on 27 Dec 2023.
  188. ^Microprocessor Report,MediaGX Targets Low-Cost PCs (vol 11, no. 3, mar 10, 1997).Archived on 6 Jun 2022.
  189. ^"Welcome to the OpenSSL Project".GitHub. 21 April 2022.Archived from the original on 4 Jan 2022.
  190. ^LKML,(PATCH) crypto: Zhaoxin: Hardware Engine Driver for SHA1/256/384/512, 2 Aug 2023.Archived on 17 Jan 2024.
  191. ^Kary Jin,PATCH: Update PadLock engine for VIA C7 and Nano CPUs,openssl-dev mailing list, 10 Jun 2011.Archived on 11 Feb 2022.
  192. ^abOpenEuler mailing list,PATCH kernel-4.19 v2 5/6 : x86/cpufeatures: Add Zhaoxin feature bits.Archived on 9 Apr 2022.
  193. ^USPTO/Zhaoxin,Patent application US2023/006718: Processor with a hash cryptographic algorithm and data processing thereof, pages 13 and 45, Mar 2, 2023.Archived on Sep 12, 2023.
  194. ^LKML,(PATCH) crypto: x86/sm2 -add Zhaoxin SM2 algorithm implementation, 11 Nov 2023.Archived on 17 Jan 2024.
  195. ^abInstLatx64,CPUID dump for Zhaoxin KaiXian KX-6000G – has the SM2 and xmodx feature bits set (CPUID leaf C0000001:EDX:bits 0 and 29).Archived on Jul 25, 2023.
  196. ^OpenEuler kernelpull request 2602: x86/delay: add support for Zhaoxin ZXPAUSE instruction.Gitee. 26 Oct 2023.Archived on 22 Jan 2024.
  197. ^ISA datafile for Intel XED (April 17, 2022), lines 916-944
  198. ^Cyrix 6x86 processor data book, page 6-34
  199. ^AMD Geode LX Processors Data Book, publication 33234H, p.670

External links

[edit]
The Wikibookx86 Assembly has a page on the topic of:X86 Instructions
x86 assembly topics
Topics
Assemblers
Programming
issues
Retrieved from "https://en.wikipedia.org/w/index.php?title=X86_instruction_listings&oldid=1281431968"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp