Documente Academic
Documente Profesional
Documente Cultură
Bit Test with Compliment (386+) Bit Test with Reset (386+) Bit Test and Set Procedure Call Convert Byte to Word Convert Double to Quad (386+) Clear Carry Clear Direction Flag Clear Interrupt Flag (disable) Clear Task Switched Flag (286+ privileged) Complement Carry Flag Compare Compare String (Byte, Word or Doubleword) Compare and Exchange Convert Word to Doubleword Convert Word to Extended Doubleword (386+) (386+)
11/07/2011
Page 2 sur 72
DAA DAS DEC DIV ENTER ESC HLT IDIV IMUL IN INC INS INT INTO INVD INVLPG IRET_IRETD Jxx JCXZ_JECXZ JMP LAHF LAR LDS LEA LEAVE LES LFS LGDT LIDT LGS LLDT LMSW LOCK LODS LOOP
Decimal Adjust for Addition Decimal Adjust for Subtraction Decrement Divide Make Stack Frame Escape Halt CPU Signed Integer Division Signed Multiply Input Byte or Word From Port Increment Input String from Port Interrupt Interrupt on Overflow Invalidate Cache (486+) Invalidate Translation Look-Aside Buffer Entry (486+) Interrupt Return Jump Instructions Table Jump if Register (E)CX is Zero Unconditional Jump Load Register AH From Flags Load Access Rights (286+ protected) Load Pointer Using DS Load Effective Address Restore Stack for Procedure Exit (80188+) Load Pointer Using E Load Pointer Using FS (386+) Load Global Descriptor Table (286+ privileged) Load Interrupt Descriptor Table (286+ privileged) Load Pointer Using GS (386+) Load Local Descriptor Table (286+ privileged) Load Machine Status Word (286+ privileged) Lock Bus Load String (Byte, Word or Double) Decrement CX and Loop if CX Not Zero Loop While Equal / Loop While Zero (80188+) (80188+)
LOOPE_LOOPZ LOOPNZ_LOOPNE Loop While Not Zero / Loop While Not Equal Load Segment Limit (286+ protected) LSL
11/07/2011
Page 3 sur 72
LSS LTR MOV MOVS MOVSX MOVZX MUL NEG NOP NOT OR OUT OUTS POP POPA_POPAD POPF_POPFD PUSH PUSHA_PUSHAD PUSHF_PUSHFD RCL RCR REP REPE_REPZ REPNE_REPNZ RET_RETF ROL ROR SAHF SAL_SHL SAR SBB SCAS SETAE_SETNB SETB_SETNAE SETBE_SETNA SETE_SETZ SETNE_SETNZ SETL_SETNGE SETGE_SETNL SETLE_SETNG
Load Pointer Using SS (386+) Load Task Register (286+ privileged) Move Byte, Word or Dword Move String (Byte or Word) Move with Sign Extend (386+) Move with Zero Extend (386+) Unsigned Multiply Two's Complement Negation No Operation (90h) One's Compliment Negation (Logical NOT) Inclusive Logical OR Output Data to Port Output String to Port Pop Word off Stack Pop All Registers onto Stack Pop Flags off Stack Push Word onto Stack Push All Registers onto Stack Push Flags onto Stack Rotate Through Carry Left Rotate Through Carry Right Repeat String Operation Repeat Equal / Repeat Zero Repeat Not Equal / Repeat Not Zero Return From Procedure Rotate Left Rotate Right Store AH Register into FLAGS Shift Arithmetic Left / Shift Logical Left Shift Arithmetic Right Subtract with Borrow/Carry Scan String (Byte, Word or Doubleword) Set if Above or Equal / Set if Not Below (386+) Set if Below / Set if Not Above or Equal (386+) Set if Below or Equal / Set if Not Above (386+) Set if Equal / Set if Zero (386+) Set if Not Equal / Set if Not Zero (386+) Set if Less / Set if Not Greater or Equal (386+) Set if Greater or Equal / Set if Not Less (386+) Set if Less or Equal / Set if Not greater or (80188+) (80188+) (80188+)
11/07/2011
Page 4 sur 72
Equal (386+) SETG_SETNLE SETS SETNS SETC SETNC SETO SETNO SETP_SETPE SETNP_SETPO SGDT SIDT SHL SHR SHLD_SHRD SLDT SMSW STC STD STI STOS STR SUB TEST VERR VERW WAIT_FWAIT WBINVD XCHG XLAT_XLATB XOR Bare Opcodes List Set if Greater / Set if Not Less or Equal (386+) Set if Signed (386+) Set if Not Signed (386+) Set if Carry (386+) Set if Not Carry (386+) Set if Overflow (386+) Set if Not Overflow (386+) Set if Parity / Set if Parity Even (386+) Set if No Parity / Set if Parity Odd (386+) Store Global Descriptor Table (286+ privileged) Store Interrupt Descriptor Table (286+ privileged) Shift Logical Left Shift Logical Right Double Precision Shift (386+) Store Local Descriptor Table (286+ privileged) Store Machine Status Word (286+ privileged) Set Carry Set Direction Flag Set Interrupt Flag (Enable Interrupts) Store String (Byte, Word or Doubleword) Store Task Register (286+ privileged) Subtract Test For Bit Pattern Verify Read (286+ protected) Verify Write (286+ protected) Event Wait Write-Back and Invalidate Cache (486+) Exchange Translate Exclusive OR Hex Opcodes And Mnemonics
11/07/2011
Page 5 sur 72
Operands none
808x 8
486 3
Size Bytes 1
Used before dividing unpacked decimal numbers. Multiplies AH by 10 and the adds result into AL. Sets AH to zero. This instruction is also known to have an undocumented behavior. AL := 10*AH+AL AH := 0 Clocks 286 386 14 19 Size Bytes 2
Operands none
808x 60
486 14
D5 0A AAD ASCII adjust AX before division D5 ib (No mnemonic) Adjust AX before division to number base imm8
Operands none
808x 83
486 15
D4 0A AAM ASCII adjust AX after multiply D4 ib (No mnemonic) Adjust AX after multiply to number base imm8
11/07/2011
Page 6 sur 72
Corrects result of a previous unpacked decimal subtraction in AL. High order nibble is zeroed. Clocks 286 386 3 4 Size Bytes 1
Operands none
808x 8
486 3
Operands reg,reg mem,reg 4 (W88=24+EA) reg,mem 4 (W88=13+EA) reg,immed mem,immed 6 (W88=23+EA) accum,immed
486 1 3 2 1 3 1
14 ib ADC AL, imm8 Add with carry imm8 to AL 15 iw ADC AX, imm16 Add with carry imm16 to AX 15 id ADC EAX, imm32 Add with carry imm32 to EAX 80 /2 ib ADC r/m8, imm8 Add with carry imm8 to r/m8 81 /2 iw ADC r/m16,imm16 Add with carry imm16 to r/m16 81 /2 id ADC r/m32,imm32 Add with CF imm32 to r/m32 83 /2 ib ADC r/m16,imm8 Add with CF signextended imm8 to r/m16 83 /2 ib ADC r/m32,imm8 Add with CF signextended imm8 into r/m32 10 / r ADC r/m8,r8 Add with carry byte register to r/m8 11 / r ADC r/m16,r16 Add with carry r16 to r/m16 11 / r ADC r/m32,r32 Add with CF r32 to r/m32 12 / r ADC r8,r/m8 Add with carry r/m8 to byte register 13 / r ADC r16,r/m16 Add with carry r/m16 to r16 13 / r ADC r32,r/m32 Add with CF r/m32 to r32
11/07/2011
Page 7 sur 72
Adds "src" to "dest" and replacing the original contents of "dest". Both operands are binary. Clocks 286 386 2 2 7 7 7 3 7 3 6 2 7 2 Size Bytes 2 223-4 32-3
Operands reg,reg mem,reg 4 (W88=24+EA) reg,mem 4 (W88=13+EA) reg,immed mem,immed 6 (W88=23+EA) accum,immed 04 05 05 80 81 81 83 83 00 01 01 02 03 03
486 1 3 2 1 3 1
ib ADD AL, imm8 Add imm8 to AL iw ADD AX, imm16 Add imm16 to AX id ADD EAX, imm32 Add imm32 to EAX /0 ib ADD r/m8,imm8 Add imm8 to r/m8 /0 iw ADD r/m16,imm16 Add imm16 to r/m16 /0 id ADD r/m32,imm32 Add imm32 to r/m32 /0 ib ADD r/m16,imm8 Add sign-extended imm8 to r/m16 /0 ib ADD r/m32,imm8 Add sign-extended imm8 to r/m32 / r ADD r/m8,r8 Add r8 to r/m8 / r ADD r/m16,r16 Add r16 to r/m16 / r ADD r/m32,r32 Add r32 to r/m32 / r ADD r8,r/m8 Add r/m8 to r8 / r ADD r16,r/m16 Add r/m16 to r16 / r ADD r32,r/m32 Add r/m32 to r32
Performs a logical AND of the two operands replacing the destinatio with the result. Clocks 286 386 2 2 7 7 7 3 7 3 6 2 7 2 Size Bytes 2 223-4 32-3
Operands reg,reg mem,reg 4 (W88=24+EA) reg,mem 4 (W88=13+EA) reg,immed mem,immed 6 (W88=23+EA) accum,immed
486 1 3 1 1 3 1
11/07/2011
Page 8 sur 72
24 25 25 80 81 81 83 83 20 21 21 22 23 23
ib AND AL, imm8 AL AND imm8 iw AND AX, imm16 AX AND i mm16 id AND EAX, imm32 EAX AND imm32 /4 ib AND r/m8,imm8 r/m8 AND imm8 /4 iw AND r/m16,imm16 r/m16 AND imm16 /4 id AND r/m32,imm32 r/m32 AND imm32 /4 ib AND r/m16,imm8 r/m16 AND imm8 (sign-extended) /4 ib AND r/m32,imm8 r/m32 AND imm8 (sign-extended) /r AND r/m8,r8 r/m8 AND r8 / r AND r/m16,r16 r/m16 AND r16 / r AND r/m32,r32 r/m32 AND r32 / r AND r8,r/m8 r8 AND r/m8 / r AND r16,r/m16 r16 AND r/m16 / r AND r32,r/m32 r32 AND r/m32
808x -
486 9 9
Array index in source register is checked against upper and lower bounds in memory source. The first word located at "limit" is the lower boundary and the word at "limit+2" is the upper array bou Interrupt 5 occurs if the source value is less than or higher than the source.
11/07/2011
Page 9 sur 72
Clocks 808x 286 386 486 nj=13 nj=10 7 nj=13 nj=10 7 nj = no jump taken
Size Bytes 2 2
Scans source operand for first bit set. Sets ZF if a bit is found set and loads the destination with an index to first set bit. Clea ZF is no bits are found set. BSF scans forward across bit pattern (0-n) while BSR scans in reverse (n-0). Clocks 286 386 10+3n 10+3n 10+3n 10+3n Size Bytes 3 3-7 3-7 3-7
808x -
0F BC BSF r16,r/m16 Bit scan forward on r/m16 0F BC BSF r32,r/m32 Bit scan forward on r/m32
Scans source operand for first bit set. Sets ZF if a bit is found set and loads the destination with an index to first set bit. Clea ZF is no bits are found set. BSF scans forward across bit pattern (0-n) while BSR scans in reverse (n-0). Clocks 286 386 10+3n 10+3n 10+3n 10+3n Size Bytes 3 3-7 3-7 3-7
808x -
11/07/2011
Page 10 sur 72
Operands reg32
808x -
486 1
808x -
486 3 6 3 12
r/m16,r16 Store selected bit in r/m32,r32 Store selected bit in ib BT r/m16,imm8 Store selected ib BT r/m32,imm8 Store selected
11/07/2011
Page 11 sur 72
808x -
486 6 8 6 13
BTC r/m16,r16 Store selected bit in BTC r/m32,r32 Store selected bit in /7 ib BTC r/m16,imm8 Store selected /7 ib BTC r/m32,imm8 Store selected
CF flag and complement CF flag and complement bit in CF flag and comple bit in CF flag and comple
808x -
486 6 8 6 13
BTR r/m16,r16 Store selected bit in BTR r/m32,r32 Store selected bit in /6 ib BTR r/m16,imm8 Store selected /6 ib BTR r/m32,imm8 Store selected
808x -
486 6 8 6 13
11/07/2011
Page 12 sur 72
0F 0F 0F 0F
AB AB BA BA
BTS r/m16,r16 Store selected bit in BTS r/m32,r32 Store selected bit in /5 ib BTS r/m16,imm8 Store selected /5 ib BTS r/m32,imm8 Store selected
CF flag and set CF flag and set bit in CF flag and set bit in CF flag and set
Operands 808x rel16 (near, IP relative) 19 rel32 (near, IP relative) 7+m 3 reg16 (near, register indirect) 16 reg32 (near, register indirect) 7+m 5 mem16 (near, memory indirect) 21+EA 11 10+m 5 mem32 (near, memory indirect) 10+m 5 ptr16:16 (far, full ptr supplied) 28 ptr16:32 (far, full ptr supplied) 17+m 18 ptr16:16 (far, ptr supplied, prot. mode) 26 34+m 20 ptr16:32 (far, ptr supplied, prot. mode) 34+m 20 m16:16 (far, indirect) 37+EA m16:32 (far, indirect) 22+m 17 m16:16 (far, indirect, prot. mode) 29 38+m 20 m16:32 (far, indirect, prot. mode) 38+m 20 ptr16:16 (task, via TSS or task gate) 177 TS 37+TS m16:16 (task, via TSS or task gate) 180/185 5+TS 37+TS m16:32 (task) TS 37+TS m16:32 (task) 5+TS 37+TS ptr16:16 (gate, same privilege) 41 52+m 35 ptr16:32 (gate, same privilege) -
486 3
13 17+m 18
16 22+m 17
11/07/2011
Page 13 sur 72
52+m 35 m16:16 (gate, same privilege) 44 56+m 35 m16:32 (gate, same privilege) 56+m 35 ptr16:16 (gate, more priv, no parm) 82 86+m 69 ptr16:32 (gate, more priv, no parm) 86+m 69 m16:16 (gate, more priv, no parm) 83 90+m 69 m16:32 (gate, more priv, no parm) 90+m 69 ptr16:16 (gate, more priv, x parms) 86+4x 94+4x+m 77+4x ptr16:32 (gate, more priv, x parms) 94+4x+m 77+4x m16:16 (gate, more priv, x parms) 90+4x 98+4x+m 77+4x m16:32 (gate, more priv, x parms) 98+4x+m 77+4x E8 E8 FF FF 9A 9A FF FF cw cd /2 /2 cd cp /3 /3 CALL CALL CALL CALL CALL CALL CALL CALL
rel16 Call near, relative, displacement relative to next rel32 Call near, relative, displacement relative to next r/m16 Call near, absolute indirect, address given in r/m r/m32 Call near, absolute indirect, address given in r/m ptr16:16 Call far, absolute, address given in operand ptr16:32 Call far, absolute, address given in operand m16:16 Call far, absolute indirect, address given in m16 m16:32 Call far, absolute indirect, address given in m16
808x 2
486 3
sign-extend of AL
Page 14 sur 72
Usage:
CDQ
Modifies flags: None Converts signed DWORD in EAX to a signed quad word in EDX:EAX by extending the high order bit of EAX throughout EDX Clocks 286 386 2 Size Bytes 1
808x -
486 3
Operands none
808x 2
486 2
Operands none
808x 2
486 2
11/07/2011
Page 15 sur 72
flag.
NMI's and software interrupts are not inhibited. Clocks 286 386 2 3 Size Bytes 1
Operands none
808x 2
486 5
Clears the Task Switched Flag in the Machine Status Register. This is a privileged operation and is generally used only by operating system code. Clocks 286 386 2 5 Size Bytes 2
Operands none
808x -
486 7
Operands none
808x 2
486 2
CMP - Compare
Usage: CMP dest,src Modifies flags: AF CF OF PF SF ZF
Subtracts source from destination and updates the flags but does not save result. Flags can subsequently be checked for conditions.
11/07/2011
Page 16 sur 72
Operands reg,reg mem,reg 4 (W88=13+EA) reg,mem 4 (W88=13+EA) reg,immed mem,immed 6 (W88=14+EA) accum,immed 3C 3D 3D 80 81 81 83 83 38 39 39 3A 3B 3B
486 1 2 2 1 2 1
ib CMP AL, imm8 Compare imm8 with AL iw CMP AX, imm16 Compare imm16 with AX id CMP EAX, imm32 Compare imm32 with EAX /7 ib CMP r/m8, imm8 Compare imm8 with r/m8 /7 iw CMP r/m16, imm16 Compare imm16 with r/m16 /7 id CMP r/m32,imm32 Compare imm32 with r/m32 /7 ib CMP r/m16,imm8 Compare imm8 with r/m16 /7 ib CMP r/m32,imm8 Compare imm8 with r/m32 / r CMP r/m8,r8 Compare r8 with r/m8 / r CMP r/m16,r16 Compare r16 with r/m16 / r CMP r/m32,r32 Compare r32 with r/m32 / r CMP r8,r/m8 Compare r/m8 with r8 / r CMP r16,r/m16 Compare r/m16 with r16 / r CMP r32,r/m32 Compare r/m32 with r32
Modifies flags: AF CF OF PF SF ZF Subtracts destination value from source without saving results. Updates flags based on the subtraction and the index registers (E)SI and (E) DI are incremented or decremented depending on the state of the Direction Flag. CMPSB inc/decrements the index registers by 1, CMPSW inc/decrements by 2, while CMPSD increments or decrements by 4. The REP prefixes can be used to process entire data items. Clocks 286 386 8 10 Size Bytes 1 (W88=30)
808x 22
486 8
11/07/2011
Page 17 sur 72
A7 A7 A6 A7 A7
808x 5
486 3
11/07/2011
Page 18 sur 72
Converts a signed word in AX to a signed doubleword in EAX by extending the sign bit of AX throughout EAX. Clocks 286 386 3 Size Bytes 1
808x -
486 3
sign-extend of AX
Operands none
808x 4
486 2
Operands none
808x 4
486 2
DEC - Decrement
Usage: DEC dest Modifies flags: AF OF PF SF ZF Unsigned binary subtraction of one from the destination.
11/07/2011
Page 19 sur 72
Operands reg8 mem reg16/32 FE /1 FF /1 FF /1 48+rw 48+rd DEC DEC DEC DEC DEC
808x 3 15+EA 3
486 1 3 1
r/m8 Decrement r/m8 by 1 r/m16 Decrement r/m16 by 1 r/m32 Decrement r/m32 by 1 r16 Decrement r16 by 1 r32 Decrement r32 by 1
DIV - Divide
Usage: DIV src Modifies flags: (AF,CF,OF,PF,SF,ZF undefined)
Unsigned binary division of accumulator by source. If the source divisor is a byte value then AX is divided by "src" and the quotien is placed in AL and the remainder in AH. If source operand is a wo value, then DX:AX is divided by "src" and the quotient is stored in and the remainder in DX. Clocks Operands 808x 286 386 reg8 80-90 14 14 reg16 144-162 22 22 reg32 38 mem8 (86-96)+EA 17 17 mem16 (150-168)+EA 25 25 4 (W88=158-176+EA) mem32 41 Size Bytes 2 2 2 2-4 22-4
486 16 24 40 16 24 40
F6 /6 DIV r/m8 Unsigned divide AX by r/m8 F7 /6 DIV r/m16 Unsigned divide DX:AX by r/m16; AX F7 /6 DIV r/m32 Unsigned divide EDX:EAX by r/m32 doubleword
Operand "locals" specifies the amount of storage to be allocated on the stack. "Level" specifies the nesting level of the routine. Paired with the LEAVE instruction, this is an efficient method of entry and exit to procedures.
11/07/2011
Page 20 sur 72
486 14 17 17+3n
Size Bytes 4 4 4
C8 iw 00 ENTER imm16,0 Create a stack frame for a procedure C8 iw 01 ENTER imm16,1 Create a nested stack frame for a procedure C8 iw ib ENTER imm16,imm8 Create a nested stack frame for a procedu
ESC - Escape
Usage: ESC immed,src Modifies flags: None Provides access to the data bus for other resident processors. The CPU treats it as a NOP but places memory operand on bus. Clocks 808x 286 386 2 9-20 ? 2 9-20 ? 0 1 2 3 4 5 6 7 Size Bytes 2 2-4
Operands immed,reg immed,mem D8h D9h DAh DBh DCh DDh DEh DFh xxh xxh xxh xxh xxh xxh xxh xxh ESC ESC ESC ESC ESC ESC ESC ESC
486
808x 2
486 4
Page 21 sur 72
Usage:
IDIV
src
Modifies flags: (AF,CF,OF,PF,SF,ZF undefined) Signed binary division of accumulator by source. If source is a byte value, AX is divided by "src" and the quotient is stored in AL and the remainder in AH. If source is a word value, DX:AX is divided by "src", and the quotient is stored in AL and the remainder in DX. Clocks 286 386 17 19 25 27 43 20 22 38 30 46 Size Bytes 2 2 2 2-4 22-4
Operands 808x reg8 101-112 reg16 165-184 reg32 mem8 (107-118)+EA mem16 (171-190)+EA 4 (W88=175-194) mem32 -
486 19 27 43 20 28 44
F6 /7 IDIV r/m8 Signed divide F7 /7 IDIV r/m16 Signed divide F7 /7 IDIV r/m32 Signed divide
Modifies flags: CF OF (AF,PF,SF,ZF undefined) Signed multiplication of accumulator by "src" with result placed in the accumulator. If the source operand is a byte value, it is multiplied by AL and the result stored in AX. If the source operand is a word value it is multiplied by AX and the result is stored in DX:AX. Other variations of this instruction allow specification of source and destination registers as well as a third immediate factor. Clocks 808x 286 386 80-98 13 9-14 128-154 21 9-22 9-38 86-104 16 12-17 134-160 24 12-25 12-41 9-22 9-38 12-25 Size Bytes 2 2 2 2-4 2-4 2-4 3-5 3-5 3-5
Operands reg8 reg16 reg32 mem8 mem16 mem32 reg16,reg16 reg32,reg32 reg16,mem16
486 13-18 13-26 12-42 13-18 13-26 13-42 13-26 13-42 13-26
11/07/2011
Page 22 sur 72
21 21 2 21 24 24
/5 IMUL r/m8 AX AL * r/m byte /5 IMUL r/m16 DX:AX AX * r/m word /5 IMUL r/m32 EDX:EAX EAX * r/m doubleword AF / r IMUL r16,r/m16 word register AF / r IMUL r32,r/m32 doubleword register / r ib IMUL r16,r/m16,imm8 word register / r ib IMUL r32,r/m32,imm8 doubleword register byte / r ib IMUL r16,imm8 word register / r ib IMUL r32,imm8 doubleword register / r iw IMUL r16,r/ m16,imm16 / r id IMUL r32,r/ m32,imm32 / r iw IMUL r16,imm16 word register r/m16 * immediate word / r id IMUL r32,imm32 doubleword register r/m32 * immediate do
Clocks Size Operands 808x 286 386 486 Bytes accum,immed8 10/14 5 12 14 2 accum,immed8 (PM) 6/26 8/28/27 2 accum,DX 8/12 5 13 14 1 accum,DX (PM) 7/27 8/28/27 1 - 386+ protected mode timings depend on privilege levels. first number is the timing if: CPL IOPL second number is the timing if: CPL > IOPL or in VM 86 mode (38 CPL IOPL (486) third number is the timing when: virtual mode on 486 processor - 486 virtual mode always requires 27 cycles E4 ib IN AL, imm8 Input byte from imm8 I/O port address into AL E5 ib IN AX, imm8 Input byte from imm8 I/O port address into AX
11/07/2011
Page 23 sur 72
E5 EC ED ED
ib IN IN IN
IN EAX, imm8 Input byte from imm8 I/O port address into EAX AL,DX Input byte from I/O port in DX into AL AX,DX Input word from I/O port in DX into AX EAX,DX Input doubleword from I/O port in DX into EAX
INC - Increment
Usage: INC dest Modifies flags: AF OF PF SF ZF Adds one to destination unsigned binary operand. Clocks 286 386 2 2 2 2 2 2 7 6 Size Bytes 2 1 1 2-
486 1 1 1 3
FE /0 INC r/m8 Increment r/m byte by 1 FF /0 INC r/m16 Increment r/m word by 1 FF /0 INC r/m32 Increment r/m doubleword by 1 40+ rw INC r16 Increment word register by 1 40+ rd INC r32 Increment doubleword register by 1
Modifies flags: None Loads data from port to the destination ES:(E) DI (even if a destination operand is supplied). (E) DI is adjusted by the size of the operand and increased if the Direction Flag is cleared and decreased if the Direction Flag is set. For INSB, INSW, INSD no operands are allowed and the size is determined by the mnemonic. Clocks Size Operands 808x 286 386 486 Bytes dest,port 5 15 17 1 dest,port (PM) 5 9/29 10/32/30 1 none 5 15 17 1 none (PM) 5 9/29 10/32/30 1 - 386+ protected mode timings depend on privilege levels. first number is the timing if: CPL IOPL
11/07/2011
Page 24 sur 72
second number is the timing if: CPL > IOPL third number is the timing if: virtual mode on 486 processor 6C INS m8, DX 6D INS m16, DX 6D INS m32, DX
INT - Interrupt
Usage: INT num Modifies flags: TF IF
Initiates a software interrupt by pushing the flags, clearing the Trap and Interrupt Flags, pushing CS followed by IP and loading CS:IP with the value found in the interrupt vector table. Executio then begins at the location addressed by the new CS:IP Clocks Size 286 386 486 Bytes 52/72 23+m 33 26 51/71 23+m 37 30 -
Operands 808x 3 (constant) 3 (prot. mode, same priv.) 40+m 59 44 2 3 (prot. mode, more priv.) 78+m 99 71 2 3 (from VM86 to PL 0) 119 82 2 3 (prot. mode via task gate) 167+m TS 37+TS 2 immed8 immed8 (prot. mode, same priv.) 40+m 59 44 1 immed8 (prot. mode, more priv.) 78+m 99 71 1 immed8 (from VM86 to PL 0) 119 86 1 immed8 (prot. mode, via task gate) 167+m TS 37+TS 1
CC INT 3 Interrupt 3 trap to debugger CD ib INT imm8 Interrupt vector number specified by immediate byte
11/07/2011
Page 25 sur 72
Operands 808x none: jump 53/73 no jump 4 (prot. mode, same priv.) (prot. mode, more priv.) (from VM86 to PL 0) (prot. mode, via task gate)
286 24+m 3 -
Bytes 1 1 1 1 1
Operands none
808x -
486 4
Size Bytes 2
Clocks Operands 808x 286 386 486 none 12 - timing is for TLB entry hit only. 0F 01/7 INVLPG
Size Bytes 2
11/07/2011
Page 26 sur 72
11/07/2011
Page 27 sur 72
JMP JNA JNAE JNB JNBE JNC JNE JNG = OF JNGE JNL JNLE JNO JNP JNS JNZ JO JP JPE JPO JS JZ
Unconditional Jump Jump if Not Above Jump if Not Above or Equal Jump if Not Below Jump if Not Below or Equal Jump if Not Carry Jump if Not Equal Jump if Not Greater (signed) Jump Jump Jump Jump Jump Jump Jump Jump Jump Jump Jump Jump Jump if if if if if if if if if if if if if Not Greater or Equal (signed) Not Less (signed) Not Less or Equal (signed) Not Overflow (signed) No Parity Not Signed (signed) Not Zero Overflow (signed) Parity Parity Even Parity Odd Signed (signed) Zero
unconditional CF=1 or ZF=1 CF=1 CF=0 CF=0 and ZF=0 CF=0 ZF=0 ZF=1 or SF ! SF != OF SF=OF ZF=0 and SF=OF OF=0 PF=0 SF=0 ZF=0 OF=1 PF=1 PF=1 PF=0 SF=1 ZF=1
Clocks Size Operands 808x 286 386 486 Bytes Jx: jump 16 7+m 7+m 3 2 no jump 4 3 3 1 Jx near-label 7+m 3 4 no jump 3 1 - It's a good programming practice to organize code so the expected case is executed without a jump since the actual jump takes longer to execute than falling through the test. - see JCXZ and JMP for their respective timings 77 73 72 76 72 E3 E3 74 7F 7D 7C 7E 76 72 73 77 73 75 7E cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb cb JA rel8 Jump short if above (CF=0 and ZF=0) JAE rel8 Jump short if above or equal (CF=0) JB rel8 Jump short if below (CF=1) JBE rel8 Jump short if below or equal (CF=1 or ZF=1) JC rel8 Jump short if carry (CF=1) JCXZ rel8 Jump short if CX register is 0 JECXZ rel8 Jump short if ECX register is 0 JE rel8 Jump short if equal (ZF=1) JG rel8 Jump short if greater (ZF=0 and SF=OF) JGE rel8 Jump short if greater or equal (SF=OF) JL rel8 Jump short if less (SF<>OF) JLE rel8 Jump short if less or equal (ZF=1 or SF<>OF) JNA rel8 Jump short if not above (CF=1 or ZF=1) JNAE rel8 Jump short if not above or equal (CF=1) JNB rel8 Jump short if not below (CF=0) JNBE rel8 Jump short if not below or equal (CF=0 and ZF=0) JNC rel8 Jump short if not carry (CF=0) JNE rel8 Jump short if not equal (ZF=0) JNG rel8 Jump short if not greater (ZF=1 or SF<>OF)
11/07/2011
Page 28 sur 72
7C 7D 7F 71 7B 79 75 70 7A 7A 7B 78 74 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F
cb cb cb cb cb cb cb cb cb cb cb cb cb 87 83 82 86 82 84 84 8F 8D 8C 8E 86 82 83 87 83 85 8E 8C 8D 8F 81 8B 89 85 80 8A 8A 8B 88 84
JNGE rel8 Jump short if not greater or equal (SF<>OF) JNL rel8 Jump short if not less (SF=OF) JNLE rel8 Jump short if not less or equal (ZF=0 and SF=OF) JNO rel8 Jump short if not overflow (OF=0) JNP rel8 Jump short if not parity (PF=0) JNS rel8 Jump short if not sign (SF=0) JNZ rel8 Jump short if not zero (ZF=0) JO rel8 Jump short if overflow (OF=1) JP rel8 Jump short if parity (PF=1) JPE rel8 Jump short if parity even (PF=1) JPO rel8 Jump short if parity odd (PF=0) JS rel8 Jump short if sign (SF=1) JZ rel8 Jump short if zero (ZF = 1) cw/cd JA rel16/32 Jump near if above (CF=0 and ZF=0) cw/cd JAE rel16/32 Jump near if above or equal (CF=0) cw/cd JB rel16/32 Jump near if below (CF=1) cw/cd JBE rel16/32 Jump near if below or equal (CF=1 or ZF=1) cw/cd JC rel16/32 Jump near if carry (CF=1) cw/cd JE rel16/32 Jump near if equal (ZF=1) cw/cd JZ rel16/32 Jump near if 0 (ZF=1) cw/cd JG rel16/32 Jump near if greater (ZF=0 and SF=OF) cw/cd JGE rel16/32 Jump near if greater or equal (SF=OF) cw/cd JL rel16/32 Jump near if less (SF<>OF) cw/cd JLE rel16/32 Jump near if less or equal (ZF=1 or SF<>OF cw/cd JNA rel16/32 Jump near if not above (CF=1 or ZF=1) cw/cd JNAE rel16/32 Jump near if not above or equal (CF=1) cw/cd JNB rel16/32 Jump near if not below (CF=0) cw/cd JNBE rel16/32 Jump near if not below or equal (CF=0 and cw/cd JNC rel16/32 Jump near if not carry (CF=0) cw/cd JNE rel16/32 Jump near if not equal (ZF=0) cw/cd JNG rel16/32 Jump near if not greater (ZF=1 or SF<>OF) cw/cd JNGE rel16/32 Jump near if not greater or equal (SF<>OF cw/cd JNL rel16/32 Jump near if not less (SF=OF) cw/cd JNLE rel16/32 Jump near if not less or equal (ZF=0 and cw/cd JNO rel16/32 Jump near if not overflow (OF=0) cw/cd JNP rel16/32 Jump near if not parity (PF=0) cw/cd JNS rel16/32 Jump near if not sign (SF=0) cw/cd JNZ rel16/32 Jump near if not zero (ZF=0) cw/cd JO rel16/32 Jump near if overflow (OF=1) cw/cd JP rel16/32 Jump near if parity (PF=1) cw/cd JPE rel16/32 Jump near if parity even (PF=1) cw/cd JPO rel16/32 Jump near if parity odd (PF=0) cw/cd JS rel16/32 Jump near if sign (SF=1) cw/cd JZ rel16/32 Jump near if 0 (ZF=1)
11/07/2011
Page 29 sur 72
Causes execution to branch to "label" if register CX is zero. unsigned comparision. Clocks 286 386 8+m 9+m 4 5 Size Bytes 2
Uses
808x 18 6
486 8 5
E3 cb JCXZ rel8 Jump short if CX register is 0 E3 cb JECXZ rel8 Jump short if ECX register is 0
Unconditionally transfers control to "label". Jumps by default are within 32768 to 32767 bytes from the instruction following the jump. NEAR and SHORT jumps cause the IP to be updated while FA jumps cause CS and IP to be updated. Clocks 286 386 7+m 7+m 7+m 7+m 7+m 11+m 15+m 7+m
Operands rel8 (relative) rel16 (relative) rel32 (relative) 7+m 3 reg16 (near, register indirect) reg32 (near, register indirect) 7+m 5 mem16 (near, mem indirect) mem32 (near, mem indirect) ptr16:16 (far, dword immed) 12+m 17 ptr16:16 (far, PM dword immed) 27+m 19 ptr16:16 (call gate, same priv.) 38+m 45+m 32 ptr16:16 (via TSS) 175+m TS 42+TS ptr16:16 (via task gate) 180+m TS 43+TS mem16:16 (far, indirect) 43+m 13 mem16:16 (far, PM indirect) 31+m 18 mem16:16 (call gate, same priv.) 41+m 49+m 31
486 3 3
10+m 10+m
5 5
11/07/2011
Page 30 sur 72
mem16:16 (via TSS) 178+m 5+TS 41+TS mem16:16 (via task gate) 183+m 5+TS 42+TS ptr16:32 (far, 6 byte immed) 12+m 13 ptr16:32 (far, PM 6 byte immed) 27+m 18 ptr16:32 (call gate, same priv.) 45+m 31 ptr16:32 (via TSS) TS 42+TS ptr16:32 (via task state) TS 43+TS m16:32 (far, address at dword) 43+m 13 m16:32 (far, address at dword) 31+m 18 m16:32 (call gate, same priv.) 49+m 31 m16:32 (via TSS) 5+TS 41+TS m16:32 (via task state) 5+TS 42+TS EB E9 E9 FF FF EA EA FF FF cb cw cd /4 /4 cd cp /5 /5 JMP JMP JMP JMP JMP JMP JMP JMP JMP
rel8 Jump short, relative, displacement relative to next rel16 Jump near, relative, displacement relative to next rel32 Jump near, relative, displacement relative to next r/m16 Jump near, absolute indirect, address given in r/m1 r/m32 Jump near, absolute indirect, address given in r/m3 ptr16:16 Jump far, absolute, address given in operand ptr16:32 Jump far, absolute, address given in operand m16:16 Jump far, absolute indirect, address given in m16: m16:32 Jump far, absolute indirect, address given in m16:
Operands none
808x 4
486 3
11/07/2011
Page 31 sur 72
The high byte of the of the destination register is overwritten by the value of the access rights byte and the low order byte is zeroe depending on the selection in the source operand. The Zero Flag is set if the load operation is successful. Clocks 286 386 14 15 15 16 16 16 Size Bytes 3 3 3-7 3-7
808x -
486 11 11 11 11
0F 02 / r LAR r16,r/m16 r16 r/m16 masked by FF00H 0F 02 / r LAR r32,r/m32 r32 r/m32 masked by 00FxFF00H
Loads 32bit pointer from memory source to destination register and DS. The offset is placed in the destination register and the segment is placed in DS. To use this instruction the word at the lower memory address must contain the offset and the word at the higher address must contain the segment. This simplifies the loadi of far pointers from the stack and the interrupt vector table. Clocks 286 386 7 7 22 Size Bytes 2-4 5-7
808x 16+EA -
486 6 12
C5 / r LDS r16,m16:16 Load DS: r16 with far pointer from memory C5 / r LDS r32,m16:32 Load DS: r32 with far pointer from memory
11/07/2011
Page 32 sur 72
Clocks Size Operands 808x 286 386 486 Bytes reg,mem 2+EA 3 2 1 2-4 the MOV instruction can often save clock cycles when used in place of LEA on 8088 processors 8D / r LEA r16,m Store effective address for m in register r16 8D / r LEA r32,m Store effective address for m in register r32
Operands none
808x -
486 5
C9 LEAVE Set SP to BP, then pop BP C9 LEAVE Set ESP to EBP, then pop EBP
Loads 32bit pointer from memory source to destination register and ES. The offset is placed in the destination register and the segment is placed in ES. To use this instruction the word at the lower memory address must contain the offset and the word at the higher address must contain the segment. This simplifies the loadi of far pointers from the stack and the interrupt vector table. Clocks 286 386 7 7 22 Size Bytes 25-7
808x 16+EA -
486 6 12
C4 / r LES r16,m16:16 Load ES: r16 with far pointer from memory
11/07/2011
Page 33 sur 72
C4 / r LES r32,m16:32 Load ES: r32 with far pointer from memory
Loads 32bit pointer from memory source to destination register and FS. The offset is placed in the destination register and the segment is placed in FS. To use this instruction the word at the lower memory address must contain the offset and the word at the higher address must contain the segment. This simplifies the loadi of far pointers from the stack and the interrupt vector table. Clocks 286 386 7 22 Size Bytes 5-7 5-7
808x -
486 6 12
0F B4 / r LFS r16,m16:16 Load FS: r16 with far pointer from memory 0F B4 / r LFS r32,m16:32 Load FS: r32 with far pointer from memory
Operands mem64
808x -
486 11
11/07/2011
Page 34 sur 72
Loads a value from an operand into the Interrupt Descriptor Table (IDT) register. Clocks 286 386 12 11 Size Bytes 5
Operands mem64
808x -
486 11
Loads 32bit pointer from memory source to destination register and GS. The offset is placed in the destination register and the segment is placed in GS. To use this instruction the word at the lower memory address must contain the offset and the word at the higher address must contain the segment. This simplifies the loadi of far pointers from the stack and the interrupt vector table. Clocks 286 386 7 22 Size Bytes 5-7 5-7
808x -
486 6 12
0F B5 / r LGS r16,m16:16 Load GS: r16 with far pointer from memory 0F B5 / r LGS r32,m16:32 Load GS: r32 with far pointer from memory
808x -
486 11 11
11/07/2011
Page 35 sur 72
808x -
486 13 13
Operands none
808x 2
486 1
Transfers string element addressed by DS:SI (even if an operand is supplied) to the accumulator. SI is incremented based on the size
11/07/2011
Page 36 sur 72
of the operand or based on the instruction used. If the Direction Flag is set SI is decremented, if the Direction Flag is clear SI is incremented. Use with REP prefixes. Clocks 286 386 5 5 Size Bytes 1
Operands src AC AD AD AC AD AD
808x 12/16
486 5
LODS m8 Load byte at address DS:(E)SI into AL LODS m16 Load word at address DS:(E)SI into AX LODS m32 Load doubleword at address DS:(E)SI into EAX LODSB Load byte at address DS:(E)SI into AL LODSW Load word at address DS:(E)SI into AX LODSD Load doubleword at address DS:(E)SI into EAX
808x 18 5
486 6 2
11/07/2011
Page 37 sur 72
808x 18 5
486 9 6
Size Bytes 2
808x 19 5
486 9 6
Loads the segment limit of a selector into the destination register if the selector is valid and visible at the current privilege level If loading is successful the Zero Flag is set, otherwise it is cleared. Clocks Size 808x 286 386 486 Bytes 14 20/25 10 3 20/25 10 3 16 21/26 10 5 21/26 10 5 are listed "byte granular" / "page granular"
11/07/2011
Page 38 sur 72
0F 03 / r LSL r16,r/m16 Load: r16 segment limit, selector r/m16 0F 03 / r LSL r32,r/m32 Load: r32 segment limit, selector r/m32)
Loads 32bit pointer from memory source to destination register and SS. The offset is placed in the destination register and the segment is placed in SS. To use this instruction the word at the lower memory address must contain the offset and the word at the higher address must contain the segment. This simplifies the loadi of far pointers from the stack and the interrupt vector table. Clocks 286 386 7 22 Size Bytes 5-7 5-7
808x -
486 6 12
0F B2 / r LSS r16,m16:16 Load SS: r16 with far pointer from memory 0F B2 / r LSS r32,m16:32 Load SS: r32 with far pointer from memory
808x -
486 20 20
11/07/2011
Page 39 sur 72
Clocks Size Operands 808x 286 386 486 Bytes reg,reg 2 2 2 1 2 mem,reg 9+EA 3 2 1 24 (W88=13+EA) reg,mem 8+EA 5 4 1 24 (W88=12+EA) mem,immed 10+EA 3 2 1 36 (W88=14+EA) reg,immed 4 2 2 1 2-3 mem,accum 10 3 2 1 3 (W88=14) accum,mem 10 5 4 1 3 (W88=14) segreg,reg16 2 2 2 3 2 segreg,mem16 8+EA 5 5 9 24 (W88=12+EA) reg16,segreg 2 2 2 3 2 mem16,segreg 9+EA 3 2 3 24 (W88=13+EA) reg32,CR0/CR2/CR3 6 4 CR0,reg32 10 16 CR2,reg32 4 4 3 CR3,reg32 5 4 3 reg32,DR0/DR1/DR2/DR3 22 10 3 reg32,DR6/DR7 22 10 3 DR0/DR1/DR2/DR3,reg32 22 11 3 DR6/DR7,reg32 16 11 3 reg32,TR6/TR7 12 4 3 TR6/TR7,reg32 12 4 3 reg32,TR3 3 TR3,reg32 6 when the 386 special registers are used all operands are 32 bits 88 / r 89 / r 89 / r 8A / r 8B / r 8B / r 8C / r 8E / r A0 MOV A1 MOV A1 MOV A2 MOV A3 MOV A3 MOV B0+ rb B8+ rw B8+ rd C6 / 0 C7 / 0 MOV r/m8,r8 Move r8 to r/m8 MOV r/m16,r16 Move r16 to r/m16 MOV r/m32,r32 Move r32 to r/m32 MOV r8,r/m8 Move r/m8 to r8 MOV r16,r/m16 Move r/m16 to r16 MOV r32,r/m32 Move r/m32 to r32 MOV r/m16,Sreg** Move segment register to r/m16 MOV Sreg,r/m16** Move r/m16 to segment register AL, moffs8* Move byte at ( seg:offset) to AL AX, moffs16* Move word at ( seg:offset) to AX EAX, moffs32* Move doubleword at ( seg:offset) to EAX moffs8*,AL Move AL to ( seg:offset) moffs16*,AX Move AX to ( seg:offset) moffs32*,EAX Move EAX to ( seg:offset) MOV r8,imm8 Move imm8 to r8 MOV r16,imm16 Move imm16 to r16 MOV r32,imm32 Move imm32 to r32 MOV r/m8,imm8 Move imm8 to r/m8 MOV r/m16,imm16 Move imm16 to r/m16
11/07/2011
Page 40 sur 72
C7 0F 0F 0F 0F 0F 0F 0F 0F 0F 0F
/ 0 MOV r/m32,imm32 Move imm32 to r/m32 22 / r MOV CR0, r32 Move r32 to CR0 22 / r MOV CR2, r32 Move r32 to CR2 22 / r MOV CR3, r32 Move r32 to CR3 22 / r MOV CR4, r32 Move r32 to CR4 20 / r MOV r32,CR0 Move CR0 to r32 20 / r MOV r32,CR2 Move CR2 to r32 20 / r MOV r32,CR3 Move CR3 to r32 20 / r MOV r32,CR4 Move CR4 to r32 21/ r MOV r32, DR0-DR7 Move debug register to r32 23 / r MOV DR0-DR7, r32 Move r32 to debug register
Copies data from addressed by DS:SI (even if operands are given) to the location ES:DI destination and updates SI and DI based on the size of the operand or instruction used. SI and DI are incremented when the Direction Flag is cleared and decremented when the Directi Flag is Set. Use with REP prefixes. Clocks 286 386 5 7 Size Bytes 1 (W88=26)
Operands dest,src
808x 18
486 7
A4 MOVS m8, m8 Move byte at address DS:(E)SI to address ES: (E)DI A5 MOVS m16, m16 Move word at address DS:(E) SI to address ES:(E)DI A5 MOVS m32, m32 Move doubleword at address DS:(E) SI to address ES:(E)DI A4 MOVSB Move byte at address DS:(E)SI to address ES:(E)DI A5 MOVSW Move word at address DS:(E)SI to address ES:(E)DI A5 MOVSD Move doubleword at address DS:(E)SI to address ES: (E)DI
11/07/2011
Page 41 sur 72
808x -
486 3 3
0F BE / r MOVSX r16,r/m8 Move byte to word with signextension 0F BE / r MOVSX r32,r/m8 Move byte to doubleword, signextension 0F BF / r MOVSX r32,r/m16 Move word to doubleword, signextension
808x -
486 3 3
0F B6 / r MOVZX r16,r/m8 Move byte to word with zeroextension 0F B6 / r MOVZX r32,r/m8 Move byte to doubleword, zeroextension 0F B7 / r MOVZX r32,r/m16 Move word to doubleword, zeroextension
Operands
808x
486
11/07/2011
Page 42 sur 72
13 21 16 24 -
F6 /4 MUL r/m8 Unsigned multiply (AX AL * r/m8) F7 /4 MUL r/m16 Unsigned multiply (DX:AX AX * r/m16) F7 /4 MUL r/m32 Unsigned multiply (EDX:EAX EAX * r/m32)
486 1 3
F6 /3 NEG r/m8 Two's complement negate r/m8 F7 /3 NEG r/m16 Two's complement negate r/m16 F7 /3 NEG r/m32 Two's complement negate r/m32
This is a do nothing instruction. It results in occupation of both space and time and is most useful for patching code segments. (This is the original XCHG AL,AL instruction) Clocks 286 386 3 3 Size Bytes 1
Operands none
808x 3
486 1
90 NOP No operation
Page 43 sur 72
Usage:
NOT
dest
Modifies flags: None Inverts the bits of the "dest" operand forming the 1s complement. Clocks 286 386 2 2 7 6 Size Bytes 2 2-
486 1 3
F6 /2 NOT r/m8 Reverse each bit of r/m8 F7 /2 NOT r/m16 Reverse each bit of r/m16 F7 /2 NOT r/m32 Reverse each bit of r/m32
OR - Inclusive Logical OR
Usage: OR dest,src Modifies flags: CF OF PF SF ZF (AF undefined) Logical inclusive OR of the two operands returning the result in the destination. Any bit set in either operand will be set in the destination. Clocks 286 386 2 2 7 7 7 3 7 7 3 6 2 7 7 2 Size Bytes 2 223-4 3-6 3-6 2-3
Operands reg,reg mem,reg 4 (W88=24+EA) reg,mem 4 (W88=13+EA) reg,immed mem8,immed8 mem16,immed16 accum,immed 0C 0D 0D 80 81 81 83 83 08 09 09 0A 0B 0B
486 1 3 2 1 3 3 1
ib OR AL, imm8 AL OR imm8 iw OR AX, imm16 AX OR imm16 id OR EAX, imm32 EAX OR imm32 /1 ib OR r/m8,imm8 r/m8 OR imm8 /1 iw OR r/m16,imm16 r/m16 OR imm16 /1 id OR r/m32,imm32 r/m32 OR imm32 /1 ib OR r/m16,imm8 r/m16 OR imm8 (sign-extended) /1 ib OR r/m32,imm8 r/m32 OR imm8 (sign-extended) / r OR r/m8,r8 r/m8 OR r8 / r OR r/m16,r16 r/m16 OR r16 / r OR r/m32,r32 r/m32 OR r32 / r OR r8,r/m8 r8 OR r/m8 / r OR r16,r/m16 r16 OR r/m16 / r OR r32,r/m32 r32 OR r/m32
11/07/2011
Page 44 sur 72
ib OUT imm8, AL Output byte in AL to I/O port address imm8 ib OUT imm8, AX Output word in AX to I/O port address imm8 ib OUT imm8, EAX Output doubleword in EAX to I/O port address im OUT DX, AL Output byte in AL to I/O port address in DX OUT DX, AX Output word in AX to I/O port address in DX OUT DX, EAX Output doubleword in EAX to I/O port address in DX
Transfers a byte, word or doubleword from "src" to the hardware port specified in DX. For instructions with no operands the "src" is located at DS:SI and SI is incremented or decremented by the size of the operand or the size dictated by the instruction format. When the Direction Flag is set SI is decremented, when clear, SI is incremented. If the port number is in the range of 0255 it can be specified as an immediate. If greater than 255 then the port number must be specified in DX. Since the PC only decodes 10 bits
11/07/2011
Page 45 sur 72
of the port address, values over 1023 can only be decoded by third party vendor equipment and also map to the port range 01023. Clocks Size Operands 808x 286 386 486 Bytes port,src 5 14 17 1 port,src (PM) 8/28 10/32/30 1 - 386+ protected mode timings depend on privilege levels. first number is the timing when: CPL IOPL second number is the timing when: CPL > IOPL third number is the timing when: virtual mode on 486 processor 6E 6F 6F 6E 6F 6F OUTS DX, m8 OUTS DX, m16 OUTS DX, m32 OUTSB OUTSW OUTSD
Transfers word at the current stack top (SS:SP) to the destination then increments SP by two to point to the new stack top. CS is not a valid destination. Clocks 286 386 5 4 5 7 5 5 Size Bytes 1 1 1 2-4 2-4
808x 8 4 8 17+EA 5
486 4 4 3 6 6
8F /0 POP m16 Pop top of stack into m16; increment stack pointer 8F /0 POP m32 Pop top of stack into m32; increment stack pointer 58+ rw POP r16 Pop top of stack into r16; increment stack pointer 58+ rd POP r32 Pop top of stack into r32; increment stack pointer 1F POP DS Pop top of stack into DS; increment stack pointer 07 POP ES Pop top of stack into ES; increment stack pointer 17 POP SS Pop top of stack into SS; increment stack pointer 0F A1 POP FS Pop top of stack into FS; increment stack pointer 0F A9 POP GS Pop top of stack into GS; increment stack pointer
Page 46 sur 72
Usage:
POPA POPAD
(386+)
Pops the top 8 words off the stack into the 8 general purpose 16/32 bit registers. Registers are popped in the following order: (E) DI, (E)SI, (E)BP, (E)SP, (E)DX, (E)CX and (E)AX. The (E) SP value popped from the stack is actually discarded. Clocks 286 386 19 24 Size Bytes 1
Operands none
808x -
486 9
61 POPA Pop DI, SI, BP, BX, DX, CX, and AX 61 POPAD Pop EDI, ESI, EBP, EBX, EDX, ECX, and EAX
808x 8/12 -
486 9 6
9D POPF Pop top of stack into lower 16 bits of EFLAGS 9D POPFD Pop top of stack into EFLAGS
Operands reg16
808x 11/15
486 1
11/07/2011
Page 47 sur 72
16+EA 10/14 -
5 3 3
2 5 5 2 2
1 4 4 3 1
1 22-4 1 2-3
FF /6 PUSH r/m16 Push r/m16 FF /6 PUSH r/m32 Push r/m32 50+ rw PUSH r16 Push r16 50+ rd PUSH r32 Push r32 6A PUSH imm8 Push imm8 68 PUSH imm16 Push imm16 68 PUSH imm32 Push imm32 0E PUSH CS Push CS 16 PUSH SS Push SS 1E PUSH DS Push DS 06 PUSH ES Push ES 0F A0 PUSH FS Push FS 0F A8 PUSH GS Push GS
Pushes all general purpose registers onto the stack in the followin order: (E)AX, (E)CX, (E)DX, (E)BX, (E)SP, (E)BP, (E)SI, (E) DI. The value of SP is the value before the actual push of SP. Clocks 286 386 19 24 Size Bytes 1
Operands none
808x -
486 11
60 PUSHA Push AX, CX, DX, BX, original SP, BP, SI, and DI 60 PUSHAD Push EAX, ECX, EDX, EBX, original ESP, EBP, ESI, and EDI
11/07/2011
Page 48 sur 72
808x 10/14 -
486 4 3
Size Bytes 1 1
Operands 808x reg,1 2 mem,1 15+EA 4 (W88=23+EA) reg,CL 8+4n mem,CL 20+EA+4n 4 (W88=28+EA+4n) reg,immed8 mem,immed8 D0 D2 C0 D1 D3 C1 D1 D3 C1 /2 /2 /2 /2 /2 /2 /2 /2 /2
RCL r/m8,1 Rotate 9 bits (CF, r/m8) left once RCL r/m8,CL Rotate 9 bits (CF, r/m8) left CL times ib RCL r/m8,imm8 Rotate 9 bits (CF, r/m8) left imm8 times RCL r/m16,1 Rotate 17 bits (CF, r/m16) left once RCL r/m16,CL Rotate 17 bits (CF, r/m16) left CL times ib RCL r/m16,imm8 Rotate 17 bits (CF, r/m16) left imm8 times RCL r/m32,1 Rotate 33 bits (CF, r/m32) left once RCL r/m32,CL Rotate 33 bits (CF, r/m32) left CL times ib RCL r/m32,imm8 Rotate 33 bits (CF, r/m32) left imm8 times
11/07/2011
Page 49 sur 72
.->|7 ----------> 0|---->|C|--. | '---------------' '-' | '-----------------------------' Rotates the bits in the destination to the right "count" times with all data pushed out the right side reentering on the left. The Carry Flag holds the last bit rotated out. Clocks 286 386 2 9 7 10 5+n 8+n 5+n 8+n 9 10 9 10 Size Bytes 2 22 23 3-5
Operands 808x reg,1 2 mem,1 15+EA 4 (W88=23+EA) reg,CL 8+4n mem,CL 20+EA+4n 4 (W88=28+EA+4n) reg,immed8 mem,immed8 D0 D2 C0 D1 D3 C1 D1 D3 C1 /3 /3 /3 /3 /3 /3 /3 /3 /3
RCR r/m8,1 Rotate 9 bits (CF, r/m8) right once RCR r/m8,CL Rotate 9 bits (CF, r/m8) right CL times ib RCR r/m8,imm8 Rotate 9 bits (CF, r/m8) right imm8 times RCR r/m16,1 Rotate 17 bits (CF, r/m16) right once RCR r/m16,CL Rotate 17 bits (CF, r/m16) right CL times ib RCR r/m16,imm8 Rotate 17 bits (CF, r/m16) right imm8 times RCR r/m32,1 Rotate 33 bits (CF, r/m32) right once RCR r/m32,CL Rotate 33 bits (CF, r/m32) right CL times ib RCR r/m32,imm8 Rotate 33 bits (CF, r/m32) right imm8 times
Repeats execution of string instructions while CX ! = 0. After each string operation, CX is decremented and the Zero Flag is tested. The combination of a repeat prefix and a segment override on CPU's before the 386 may result in errors if an interrupt occurs before CX=0. The following code shows code that is susceptible to this and how to avoid it: again: rep movs byte ptr ES:[DI],ES: [SI] ; vulnerable instr. jcxz next ; continue if REP successful loop again ; interrupt goofed count next: Clocks 286 386 2 2 Size Bytes
Operands none
808x 2
486 1
11/07/2011
Page 50 sur 72
F3 6C REP INS r/m8, DX Input (E) CX bytes from port DX into ES:[(E)DI] F3 6D REP INS r/m16,DX Input (E) CX words from port DX into ES:[(E)DI] F3 6D REP INS r/m32,DX Input (E) CX doublewords from port DX into ES:[(E)DI] F3 A4 REP MOVS m8,m8 Move (E)CX bytes from DS:[(E) SI] to ES:[(E)DI] F3 A5 REP MOVS m16,m16 Move (E)CX words from DS:[(E) SI] to ES:[(E)DI] F3 A5 REP MOVS m32,m32 Move (E)CX doublewords from DS:[(E) SI] to ES:[(E)DI] F3 6E REP OUTS DX, r/m8 Output (E)CX bytes from DS:[(E) SI] to port DX F3 6F REP OUTS DX, r/m16 Output (E)CX words from DS:[(E) SI] to port DX F3 6F REP OUTS DX, r/m32 Output (E)CX doublewords from DS: [(E)SI] to port DX F3 AC REP LODS AL Load (E)CX bytes from DS:[(E)SI] to AL F3 AD REP LODS AX Load (E)CX words from DS:[(E)SI] to AX F3 AD REP LODS EAX Load (E)CX doublewords from DS:[(E) SI] to EAX F3 AA REP STOS m8 Fill (E)CX bytes at ES:[(E)DI] with AL F3 AB REP STOS m16 Fill (E)CX words at ES:[(E)DI] with AX F3 AB REP STOS m32 Fill (E)CX doublewords at ES:[(E) DI] with EAX
Operands none
808x 2
486 1
F3 A6 REPE CMPS m8,m8 Find nonmatching bytes in ES:[(E) DI] and DS:[(E)SI] F3 A7 REPE CMPS m16,m16 Find nonmatching words in ES:[(E) DI] and DS:[(E)SI] F3 A7 REPE CMPS m32,m32 Find nonmatching doublewords in ES: [(E)DI] and DS:[(E)SI] F3 AE REPE SCAS m8 Find non-AL byte starting at ES:[(E)DI] F3 AF REPE SCAS m16 Find non-AX word starting at ES:[(E)DI]
11/07/2011
Page 51 sur 72
Operands none
808x 2
486 1
F2 A6 REPNE CMPS m8,m8 Find matching bytes in ES:[(E) DI] and DS:[(E)SI] F2 A7 REPNE CMPS m16,m16 Find matching words in ES:[(E) DI] and DS:[(E)SI] F2 A7 REPNE CMPS m32,m32 Find matching doublewords in ES: [(E)DI] and DS:[(E)SI] F2 AE REPNE SCAS m8 Find AL, starting at ES:[(E)DI] F2 AF REPNE SCAS m16 Find AX, starting at ES:[(E)DI] F2 AF REPNE SCAS m32 Find EAX, starting at ES:[(E)DI]
Modifies flags: None Transfers control from a procedure back to the instruction address saved on the stack. "n bytes" is an optional number of bytes to release. Far returns pop the IP followed by the CS, while near returns pop only the IP register. Clocks 286 386 11+m 10+m 11+m 10+m Size Bytes 1 3
486 5 5
11/07/2011
Page 52 sur 72
26/34 15+m 18+m (PM, same priv.) 32+m (PM, lesser priv.) 68 immed 25/33 15+m 18+m immed (PM, same priv.) 32+m immed (PM, lesser priv.) 68
13 18 33 14 17 33
1 1 1 3 1 1
RET Near return to calling procedure RET Far return to calling procedure iw RET imm16 Near return to calling procedure and pop imm16 byte iw RET imm16 Far return to calling procedure and pop imm16 bytes
Operands 808x reg,1 2 mem,1 15+EA 4 (W88=23+EA) reg,CL 8+4n mem,CL 20+EA+4n 4 (W88=28+EA+4n) reg,immed8 mem,immed8 D0 D2 C0 D1 D3 C1 D1 D3 C1 /0 /0 /0 /0 /0 /0 /0 /0 /0
486 3 4 3 4 2 4
ROL r/m8,1 Rotate 8 bits r/m8 left once ROL r/m8,CL Rotate 8 bits r/m8 left CL times ib ROL r/m8,imm8 Rotate 8 bits r/m8 left imm8 times ROL r/m16,1 Rotate 16 bits r/m16 left once ROL r/m16,CL Rotate 16 bits r/m16 left CL times ib ROL r/m16,imm8 Rotate 16 bits r/m16 left imm8 times ROL r/m32,1 Rotate 32 bits r/m32 left once ROL r/m32,CL Rotate 32 bits r/m32 left CL times ib ROL r/m32,imm8 Rotate 32 bits r/m32 left imm8 times
11/07/2011
Page 53 sur 72
Modifies flags: CF OF
.---------------. .-. .->|7 ----------> 0|--.->|C| | '---------------' | '-' '---------------------' Rotates the bits in the destination to the right "count" times with all data pushed out the right side reentering on the left. The Carry Flag will contain the value of the last bit rotated out. Clocks 286 386 2 3 7 7 5+n 8+n 5+n 8+n 3 7 3 7 Size Bytes 2 22 23 3-5
Operands 808x reg,1 2 mem,1 15+EA 4 (W88=23+EA) reg,CL 8+4n mem,CL 20+EA+4n 4 (W88=28+EA+4n) reg,immed8 mem,immed8 D0 D2 C0 D1 D3 C1 D1 D3 C1 /1 /1 /1 /1 /1 /1 /1 /1 /1
486 3 4 3 4 2 4
ROR r/m8,1 Rotate 8 bits r/m8 right once ROR r/m8,CL Rotate 8 bits r/m8 right CL times ib ROR r/m8,imm8 Rotate 8 bits r/m16 right imm8 times ROR r/m16,1 Rotate 16 bits r/m16 right once ROR r/m16,CL Rotate 16 bits r/m16 right CL times ib ROR r/m16,imm8 Rotate 16 bits r/m16 right imm8 times ROR r/m32,1 Rotate 32 bits r/m32 right once ROR r/m32,CL Rotate 32 bits r/m32 right CL times ib ROR r/m32,imm8 Rotate 32 bits r/m32 right imm8 times
This includes
Operands none
808x 4
486 2
Size Bytes 1
9E SAHF 2 Loads SF, ZF, AF, PF, and CF from AH into EFLAGS register
Page 54 sur 72
Usage:
SAL SHL
dest,count dest,count
Modifies flags: CF OF PF SF ZF (AF undefined) .-. .---------------. .-. |C|<----|7 <---------- 0|<----|0| '-' '---------------' '-' Shifts the destination left by "count" bits with zeroes shifted in on right. The Carry Flag contains the last bit shifted out. Clocks 286 386 2 3 7 7 5+n 8+n 5+n 8+n 3 7 3 7 Size Bytes 2 22 23 3-5
Operands 808x reg,1 2 mem,1 15+EA 4 (W88=23+EA) reg,CL 8+4n mem,CL 20+EA+4n 4 (W88=28+EA+4n) reg,immed8 mem,immed8 D0 D2 C0 D1 D3 C1 D1 D3 C1 /4 /4 /4 /4 /4 /4 /4 /4 /4
486 3 4 3 4 2 4
SAL r/m8,1 Multiply r/m8 by 2, once SAL r/m8,CL Multiply r/m8 by 2, CL times ib SAL r/m8,imm8 Multiply r/m8 by 2, imm8 times SAL r/m16,1 Multiply r/m16 by 2, once SAL r/m16,CL Multiply r/m16 by 2, CL times ib SAL r/m16,imm8 Multiply r/m16 by 2, imm8 times SAL r/m32,1 Multiply r/m32 by 2, once SAL r/m32,CL Multiply r/m32 by 2, CL times ib SAL r/m32,imm8 Multiply r/m32 by 2, imm8 times
486 3 4 3
11/07/2011
Page 55 sur 72
7 3 7
4 2 4
23 3-5
SAR r/m8,1 Signed divide* r/m8 by 2, once SAR r/m8,CL Signed divide* r/m8 by 2, CL times ib SAR r/m8,imm8 Signed divide* r/m8 by 2, imm8 times SAR r/m16,1 Signed divide* r/m16 by 2, once SAR r/m16,CL Signed divide* r/m16 by 2, CL times ib SAR r/m16,imm8 Signed divide* r/m16 by 2, imm8 times SAR r/m32,1 Signed divide* r/m32 by 2, once SAR r/m32,CL Signed divide* r/m32 by 2, CL times ib SAR r/m32,imm8 Signed divide* r/m32 by 2, imm8 times
Subtracts the source from the destination, and subtracts 1 extra if the Carry Flag is set. Results are returned in "dest". Clocks 286 386 2 2 7 6 7 3 7 3 7 2 7 2 Size Bytes 2 223-4 32-3
Operands reg,reg mem,reg 4 (W88=24+EA) reg,mem 4 (W88=13+EA) reg,immed mem,immed 6 (W88=25+EA) accum,immed
486 1 3 2 1 3 1
1C ib SBB AL, imm8 Subtract with borrow imm8 from AL 1D iw SBB AX, imm16 Subtract with borrow imm16 from AX 1D id SBB EAX, imm32 Subtract with borrow imm32 from EAX 80 /3 ib SBB r/m8,imm8 Subtract with borrow imm8 from r/m8 81 /3 iw SBB r/m16,imm16 Subtract with borrow imm16 from r/m16 81 /3 id SBB r/m32,imm32 Subtract with borrow imm32 from r/m32 83 /3 ib SBB r/m16,imm8 Subtract with borrow signextended imm8 from r/m16 83 /3 ib SBB r/m32,imm8 Subtract with borrow signextended imm8 from r/m32 18 / r SBB r/m8,r8 Subtract with borrow r8 from r/m8 19 / r SBB r/m16,r16 Subtract with borrow r16 from r/m16 19 / r SBB r/m32,r32 Subtract with borrow r32 from r/m32 1A / r SBB r8,r/m8 Subtract with borrow r/m8 from r8 1B / r SBB r16,r/m16 Subtract with borrow r/m16 from r16 1B / r SBB r32,r/m32 Subtract with borrow r/m32 from r32
11/07/2011
Page 56 sur 72
Modifies flags: AF CF OF PF SF ZF
Compares value at ES:DI (even if operand is specified) from the accumulator and sets the flags similar to a subtraction. DI is incremented/decremented based on the instruction format (or operand and the state of the Direction Flag. Use with REP prefixes. Clocks 286 386 7 7 Size Bytes 1 (W88=19)
Operands string AE DI AF DI AF DI AE DI AF DI AF DI
808x 15
486 6
SCAS m8 Compare AL with byte at ES:(E) and set status flags SCAS m16 Compare AX with word at ES:(E) and set status flags SCAS m32 Compare EAX with doubleword at ES(E) and set status flags SCASB Compare AL with byte at ES:(E) and set status flags SCASW Compare AX with word at ES:(E) and set status flags SCASD Compare EAX with doubleword at ES:(E) and set status flags
808x -
486 3 4
11/07/2011
Page 57 sur 72
0F 97 SETA r/m8 Set byte if above (CF=0 and ZF=0) 0F 93 SETAE r/m8 Set byte if above or equal (CF=0)
808x -
486 3 4
0F 92 SETB r/m8 Set byte if below (CF=1) 0F 92 SETNAE r/m8 Set byte if not above or equal (CF=1)
808x -
486 3 4
0F 96 SETBE r/m8 Set byte if below or equal (CF=1 or ZF=1) 0F 96 SETNA r/m8 Set byte if not above (CF=1 or ZF=1)
Page 58 sur 72
Usage:
SETE SETZ
dest dest
Modifies flags: none Sets the byte in the operand to 1 if the Zero Flag is set, otherwise sets the operand to 0. Clocks 286 386 4 5 Size Bytes 3 3
808x -
486 3 4
0F 94 SETE r/m8 Set byte if equal (ZF=1) 0F 94 SETZ r/m8 Set byte if zero (ZF=1)
808x -
486 3 4
0F 95 SETNE r/m8 Set byte if not equal (ZF=0) 0F 95 SETNZ r/m8 Set byte if not zero (ZF=0)
Modifies flags: none Sets the byte in the operand to 1 if the Sign Flag is not equal to the Overflow Flag, otherwise sets the operand to 0. Clocks Size
11/07/2011
Page 59 sur 72
808x -
286 -
386 4 5
486 3 4
Bytes 3 3
0F 9C SETL r/m8 Set byte if less (SF<>OF) 0F 9C SETNGE r/m8 Set if not greater or equal (SF<>OF)
Modifies flags: none Sets the byte in the operand to 1 if the Sign Flag equals the Overflow Flag, otherwise sets the operand to 0. Clocks 286 386 4 5 Size Bytes 3 3
808x -
486 3 4
0F 9D SETGE r/m8 Set byte if greater or equal (SF=OF) 0F 9D SETNL r/m8 Set byte if not less (SF=OF)
Modifies flags: none Sets the byte in the operand to 1 if the Zero Flag is set or the Sign Flag is not equal to the Overflow Flag, otherwise sets the operand to 0. Clocks 286 386 4 5 Size Bytes 3 3
808x -
486 3 4
0F 9E SETLE r/m8 Set byte if less or equal (ZF=1 or SF<>OF) 0F 9E SETNG r/m8 Set byte if not greater (ZF=1 or SF<>OF)
11/07/2011
Page 60 sur 72
Modifies flags: none Sets the byte in the operand to 1 if the Zero Flag is clear or the Sign Flag equals to the Overflow Flag, otherwise sets the operand to 0. Clocks 286 386 4 5 Size Bytes 3 3
808x -
486 3 4
0F 9F SETG r/m8 Set byte if greater (ZF=0 and SF=OF) 0F 9F SETNLE r/m8 Set byte if not less or equal (ZF=0 and SF=OF)
Sets the byte in the operand to 1 if the Sign Flag is set, otherwis sets the operand to 0. Clocks 286 386 4 5 Size Bytes 3 3
808x -
486 3 4
Operands reg8
808x -
486 3
11/07/2011
Page 61 sur 72
mem8
808x -
486 3 4
808x -
486 3 4
808x -
486 3 4
11/07/2011
Page 62 sur 72
808x -
486 3 4
808x -
486 3 4
0F 9A SETP r/m8 Set byte if parity (PF=1) 0F 9A SETPE r/m8 Set byte if parity even (PF=1)
11/07/2011
Page 63 sur 72
808x -
486 3 4
Size Bytes 3 3
0F 9B SETNP r/m8 Set byte if not parity (PF=0) 0F 9B SETPO r/m8 Set byte if parity odd (PF=0)
Operands mem64
808x -
486 10
Operands mem64
808x -
486 10
11/07/2011
Page 64 sur 72
.-. .---------------. .-. |C|<----|7 <---------- 0|<----|0| '-' '---------------' '-' Shifts the destination left by "count" bits with zeroes shifted in on right. The Carry Flag contains the last bit shifted out. Clocks 286 386 2 3 7 7 5+n 8+n 5+n 8+n 3 7 3 7 Size Bytes 2 22 23 3-5
Operands 808x reg,1 2 mem,1 15+EA 4 (W88=23+EA) reg,CL 8+4n mem,CL 20+EA+4n 4 (W88=28+EA+4n) reg,immed8 mem,immed8 D0 D2 C0 D1 D3 C1 D1 D3 C1 /4 /4 /4 /4 /4 /4 /4 /4 /4
486 3 4 3 4 2 4
SHL r/m8,1 Multiply r/m8 by 2, once SHL r/m8,CL Multiply r/m8 by 2, CL times ib SHL r/m8,imm8 Multiply r/m8 by 2, imm8 times SHL r/m16,1 Multiply r/m16 by 2, once SHL r/m16,CL Multiply r/m16 by 2, CL times ib SHL r/m16,imm8 Multiply r/m16 by 2, imm8 times SHL r/m32,1 Multiply r/m32 by 2, once SHL r/m32,CL Multiply r/m32 by 2, CL times ib SHL r/m32,imm8 Multiply r/m32 by 2, imm8 times
Operands 808x reg,1 2 mem,1 15+EA 4 (W88=23+EA) reg,CL 8+4n mem,CL 20+EA+4n 4 (W88=28+EA+4n) reg,immed8 mem,immed8 -
486
D0 /5 SHR r/m8,1 Unsigned divide r/m8 by 2, once D2 /5 SHR r/m8,CL Unsigned divide r/m8 by 2, CL times
11/07/2011
Page 65 sur 72
C0 D1 D3 C1 D1 D3 C1
/5 /5 /5 /5 /5 /5 /5
ib SHR r/m8,imm8 Unsigned divide r/m8 by 2, imm8 times SHR r/m16,1 Unsigned divide r/m16 by 2, once SHR r/m16,CL Unsigned divide r/m16 by 2, CL times ib SHR r/m16,imm8 Unsigned divide r/m16 by 2, imm8 times SHR r/m32,1 Unsigned divide r/m32 by 2, once SHR r/m32,CL Unsigned divide r/m32 by 2, CL times ib SHR r/m32,imm8 Unsigned divide r/m32 by 2, imm8 times
Operands reg16,reg16,immed8 reg32,reg32,immed8 mem16,reg16,immed8 mem32,reg32,immed8 reg16,reg16,CL reg32,reg32,CL mem16,reg16,CL mem32,reg32,CL 0F 0F 0F 0F 0F 0F 0F 0F A4 A5 A4 A5 AC AD AC AD SHLD SHLD SHLD SHLD SHRD SHRD SHRD SHRD
808x -
486 2 2 3 3 3 3 4 4
11/07/2011
Page 66 sur 72
Stores the Local Descriptor Table (LDT) Register into the specified operand. Clocks 286 386 2 2 2 2 Size Bytes 3 5
808x -
486 2 3
0F 00 /0 SLDT r/m16 Stores segment selector from LDTR in r/m16 0F 00 /0 SLDT r/m32 Store segment selector from LDTR in loworder 16 bits of
808x -
486 2 3
0F 01 /4 SMSW r/m16 Store machine status word to r/m16 0F 01 /4 SMSW r32/m16 Store machine status word in loworder 16 bits of r32/m16;
Operands none
808x 2
486 2
Page 67 sur 72
Usage:
STD
Modifies flags: DF Sets the Direction Flag to 1 causing string instructions to auto-decrement SI and DI instead of auto-increment. Clocks 286 386 2 2 Size Bytes 1
Operands none
808x 2
486 2
Operands none
808x 2
486 5
Modifies flags: None Stores value in accumulator to location at ES:(E) DI (even if operand is given). (E) DI is incremented/decremented based on the size of the operand (or instruction format) and the state of the Direction Flag. Use with REP prefixes. Clocks 286 386 3 4 Size Bytes 1 (W88=15)
Operands dest
808x 11
486 5
11/07/2011
Page 68 sur 72
AA AB AB AA AB AB
STOS m8 Store AL at address ES:(E)DI STOS m16 Store AX at address ES:(E)DI STOS m32 Store EAX at address ES:(E)DI STOSB Store AL at address ES:(E)DI STOSW Store AX at address ES:(E)DI STOSD Store EAX at address ES:(E)DI
808x -
486 2 3
SUB - Subtract
Usage: SUB dest,src Modifies flags: AF CF OF PF SF ZF The source is subtracted from the destination and the result is stored in the destination. Clocks 286 386 2 2 7 6 7 3 7 3 7 2 7 2 Size Bytes 2 223-4 32-3
Operands reg,reg mem,reg 4 (W88=24+EA) reg,mem 4 (W88=13+EA) reg,immed mem,immed 6 (W88=25+EA) accum,immed 2C 2D 2D 80 81 81 ib iw id /5 /5 /5
486 1 3 2 1 3 1
SUB AL, imm8 Subtract imm8 from AL SUB AX, imm16 Subtract imm16 from AX SUB EAX, imm32 Subtract imm32 from EAX ib SUB r/m8,imm8 Subtract imm8 from r/m8 iw SUB r/m16,imm16 Subtract imm16 from r/m16 id SUB r/m32,imm32 Subtract imm32 from r/m32
11/07/2011
Page 69 sur 72
83 /5 ib SUB r/m16,imm8 Subtract signextended imm8 from r/m16 83 /5 ib SUB r/m32,imm8 Subtract signextended imm8 from r/m32 28 / r SUB r/m8,r8 Subtract r8 from r/m8 29 / r SUB r/m16,r16 Subtract r16 from r/m16 29 / r SUB r/m32,r32 Subtract r32 from r/m32 2A / r SUB r8,r/m8 Subtract r/m8 from r8 2B / r SUB r16,r/m16 Subtract r/m16 from r16 2B / r SUB r32,r/m32 Subtract r/m32 from r32
486 1 1 2 1 2 1
ib TEST AL, imm8 AND imm8 with AL; set SF, ZF, PF according to r iw TEST AX, imm16 AND imm16 with AX; set SF, ZF, PF according to id TEST EAX, imm32 AND imm32 with EAX; set SF, ZF, PF according /0 ib TEST r/m8,imm8 AND imm8 with r/m8; set SF, ZF, PF accordin /0 iw TEST r/m16,imm16 AND imm16 with r/m16; set SF, ZF, PF acco /0 id TEST r/m32,imm32 AND imm32 with r/m32; set SF, ZF, PF acco / r TEST r/m8,r8 AND r8 with r/m8; set SF, ZF, PF according to r / r TEST r/m16,r16 AND r16 with r/m16; set SF, ZF, PF according / r TEST r/m32,r32 AND r32 with r/m32; set SF, ZF, PF according
11/07/2011
Page 70 sur 72
808x -
486 11 11
Size Bytes 3 5
808x -
486 11 11
CPU enters wait state until the coprocessor signals it has finished its operation. This instruction is used to prevent the CPU from accessing memory that may be temporarily in use by the coprocessor. WAIT and FWAIT are identical. Clocks 286 386 3 6+ Size Bytes 1
Operands none
808x 4
486 1-3
9B WAIT Check pending unmasked floating-point exceptions. 9B FWAIT Check pending unmasked floating-point exceptions.
11/07/2011
Page 71 sur 72
Flushes internal cache, then signals the external cache to write back current data followed by a signal to flush the external cache. Clocks 286 386 Size Bytes 2
Operands none
808x -
486 5
0F 09 WBINVD Write back and flush Internal caches; initiate writing -back
XCHG - Exchange
Usage: XCHG dest,src Modifies flags: None Exchanges contents of source and destination. Clocks 286 386 3 3 5 5 5 3 3 5 3 3 Size Bytes 2 221 1
Operands reg,reg mem,reg 4 (W88=25+EA) reg,mem 4 (W88=25+EA) accum,reg reg,accum 90+ rw 90+ rw 90+ rd 90+ rd 86 / r 86 / r 87 / r 87 / r 87 / r 87 / r XCHG XCHG XCHG XCHG XCHG XCHG XCHG XCHG XCHG XCHG
486 3 5 3 3 3
AX, r16 Exchange r16 with AX r16,AX Exchange AX with r16 EAX, r32 Exchange r32 with EAX r32,EAX Exchange EAX with r32 r/m8,r8 Exchange r8 (byte register) with byte from r/m8 r8,r/m8 Exchange byte from r/m8 with r8 (byte register) r/m16,r16 Exchange r16 with word from r/m16 r16,r/m16 Exchange word from r/m16 with r16 r/m32,r32 Exchange r32 with doubleword from r/m32 r32,r/m32 Exchange doubleword from r/m32 with r32
XLAT/XLATB - Translate
Usage: XLAT XLATB translation-table (masm 5.x) Modifies flags: None
Replaces the byte in AL with byte from a user table addressed by BX. The original value of AL is the index into the translate table The best way to discripe this is MOV AL,[BX+AL] Clocks Size
11/07/2011
Page 72 sur 72
808x 11
286 5
386 5
486 4
Bytes 1
D7 XLAT m8 Set AL to memory byte DS:[(E)BX + unsigned AL] D7 XLATB Set AL to memory byte DS:[(E)BX + unsigned AL]
XOR - Exclusive OR
Usage: XOR dest,src Modifies flags: CF OF PF SF ZF (AF undefined) Performs a bitwise exclusive OR of the operands and returns the result in the destination. Clocks 286 386 2 2 7 6 7 3 7 3 7 2 7 2 Size Bytes 2 223-4 32-3
Operands reg,reg mem,reg 4 (W88=24+EA) reg,mem 4 (W88=13+EA) reg,immed mem,immed 6 (W88=25+EA) accum,immed 34 35 35 80 81 81 83 83 30 31 31 32 33 33
486 1 3 2 1 3 1
ib XOR AL, imm8 AL XOR imm8 iw XOR AX, imm16 AX XOR imm16 id XOR EAX, imm32 EAX XOR imm32 /6 ib XOR r/m8,imm8 r/m8 XOR imm8 /6 iw XOR r/m16,imm16 r/m16 XOR imm16 /6 id XOR r/m32,imm32 r/m32 XOR imm32 /6 ib XOR r/m16,imm8 r/m16 XOR imm8 (sign-extended) /6 ib XOR r/m32,imm8 r/m32 XOR imm8 (sign-extended) / r XOR r/m8,r8 r/m8 XOR r8 / r XOR r/m16,r16 r/m16 XOR r16 / r XOR r/m32,r32 r/m32 XOR r32 / r XOR r8,r/m8 r8 XOR r/m8 / r XOR r16,r/m16 r8 XOR r/m8 / r XOR r32,r/m32 r8 XOR r/m8
11/07/2011