x86-instruction-listings.pdf

(156 KB) Pobierz
x86 instruction listings
1
x86 instruction listings
The x86 instruction set has been extended several times, introducing wider registers and datatypes and/or new
functionality.
x86 integer instructions
This is the full 8086/8088 instruction set, but most, if not all of these instructions are available in 32-bit mode, they
just operate on 32-bit registers (eax, ebx, etc) and values instead of their 16-bit (ax, bx, etc) counterparts. See also
x86 assembly language for a quick tutorial for this processor family. The updated instruction set is also grouped
according to architecture (i386, i486, i686) and more generally is referred to as x86_32 and x86_64 (also known as
AMD64).
Original 8086/8088 instructions
Instruction
AAA
AAD
Meaning
ASCII adjust
AL after
addition
ASCII adjust
AX before
division
used with unpacked binary coded decimal
8086/8088 datasheet documents only base 10 version of the AAD instruction (opcode 0xD5
0x0A), 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 incompatibilities
Notes
AAM
AAS
ADC
ADD
AND
CALL
CBW
CLC
CLD
CLI
CMC
CMP
CMPSB
CMPSW
CWD
DAA
DAS
DEC
DIV
ESC
HLT
IDIV
ASCII adjust
AX after
multiplication
Only base 10 version is documented, see notes for AAD
ASCII adjust
AL after
subtraction
Add
with
carry
Add
Logical AND
Call procedure
Convert byte
to
word
Clear carry
flag
Clear direction
flag
Clear interrupt
flag
Complement carry
flag
Compare
operands
Compare
bytes in memory
Compare
words
Convert word
to
doubleword
Decimal adjust
AL after
addition
Decimal adjust
AL after
subtraction
Decrement
by 1
Unsigned
divide
Used with floating-point unit
Enter
halt
state
Signed
divide
(used with packed binary coded decimal)
destination := destination + source + carry_flag
x86 instruction listings
2
IMUL
IN
INC
INT
INTO
IRET
Jxx
Signed
multiply
Input
from port
Increment
by 1
Call to
interrupt
Call to
interrupt
if
overflow
Return
from
interrupt
Jump
if condition
(JA,
JAE, JB, JBE, JC, JCXZ, 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)
JMP
LAHF
LDS
LEA
LES
LOCK
LODSB
LODSW
Jump
Load flags
into
AH
register
Load
pointer using
DS
Load Effective Address
Load ES
with pointer
Assert BUS
LOCK#
signal
Load signed byte
Load signed word
(LOOPE,
LOOPNE, LOOPNZ, LOOPZ)
(for multiprocessing)
LOOP/LOOPx
Loop
control
MOV
MOVSB
MOVSW
MUL
NEG
NOP
NOT
OR
OUT
POP
Move
Move byte
from
string
to string
Move
word from
string
to
string
Unsigned
multiply
Two's complement
negation
No operation
Negate the operand, logical
NOT
Logical
OR
Output
to port
Pop
data from stack
opcode (0x90) equivalent to XCHG EAX, EAX
POP CS (opcode 0x0F) works only on 8086/8088. Later CPUs use 0x0F as a prefix for
newer instructions.
POPF
PUSH
PUSHF
RCL
RCR
REPxx
Pop
data into
flags
register
Push
data onto stack
Push flags
onto stack
Rotate left
(with
carry)
Rotate right
(with
carry)
Repeat
MOVS/STOS/CMPS/LODS/SCAS
Return
from procedure
Return
from
near
procedure
Return
from
far
procedure
Rotate left
Rotate right
(REP,
REPE, REPNE, REPNZ, REPZ)
RET
RETN
RETF
ROL
ROR
x86 instruction listings
3
SAHF
SAL
Store AH
into
flags
Shift Arithmetically left
(signed shift
left)
Shift Arithmetically right
(signed
shift right)
SAR
SBB
SCASB
SCASW
SHL
SHR
STC
STD
STI
STOSB
STOSW
SUB
TEST
WAIT
XCHG
XLAT
XOR
Subtraction
with
borrow
Compare byte string
Compare word string
Shift left
(unsigned shift left)
Shift right
(unsigned shift right)
Set carry
flag
Set direction
flag
Set interrupt
flag
Store byte
in
string
Store word
in
string
Subtraction
Logical compare (AND)
Wait
until not busy
Exchange data
Table look-up translation
Exclusive
OR
Waits until BUSY# pin is inactive (used with floating-point unit)
Added in specific processors
Added with 80186/80188
Instruction
BOUND
ENTER
Meaning
Check array index against
bounds
Enter
stack frame
Notes
raises software interrupt 5 if test fails
equivalent to
PUSH BP
MOV BP, SP
SUB SP, n
INS
Input
from port to
string
equivalent to
IN (E)AX, DX
MOV ES:[(E)DI], (E)AX
; adjust (E)DI according to operand size and DF
LEAVE
Leave
stack frame
equivalent to
MOV SP, BP
POP BP
OUTS
Output string
to port
equivalent to
MOV (E)AX, DS:[(E)SI]
OUT DX, (E)AX
; adjust (E)SI according to operand size and DF
x86 instruction listings
4
equivalent to
POP DI, SI, BP, SP, BX, DX, CX, AX
POPA
Pop all
general purpose registers from stack
PUSHA
Push all
general purpose registers onto stack equivalent to
PUSH AX, CX, DX, BX, SP, BP, SI, DI
Added with 80286
Instruction
ARPL
CLTS
LAR
LGDT
LIDT
LLDT
LMSW
LOADALL
LSL
LTR
SGDT
SIDT
SLDT
SMSW
STR
VERR
VERW
Meaning
Adjust RPL
field of selector
Clear task-switched
flag in register CR0
Load access rights
byte
Load global descriptor table
Load interrupt descriptor table
Load local descriptor table
Load machine status word
Load all
CPU registers, including internal ones such as GDT Undocumented, (80)286 and 386 only
Load segment limit
Load task register
Store global descriptor table
Store interrupt descriptor table
Store local descriptor table
Store machine status word
Store task register
Verify
a segment for
reading
Verify
a segment for
writing
Notes
Added with 80386
Instruction
BSF
BSR
BT
BTC
BTR
BTS
CDQ
Meaning
Bit scan forward
Bit scan reverse
Bit test
Bit test
and
complement
Bit test
and
reset
Bit test
and
set
Convert double-word
to
quad-word
Sign-extends EAX into EDX, forming the
quad-word EDX:EAX. Since (I)DIV uses
EDX:EAX as its input, CDQ must be called after
setting EAX if EDX is not manually initialized (as
in 64/32 division) before (I)DIV.
CMPSD
Compare string double-word
Compares ES:[(E)DI] with DS:[SI]
Notes
x86 instruction listings
5
Convert word
to
double-word
Unlike CWD, CWDE sign-extends AX to EAX
instead of AX to DX:AX
same as INS
CWDE
INSB, INSW, INSD
Input
from port to
string
with
explicit size
IRETx
Interrupt return;
D suffix means Use IRETD rather than IRET in 32-bit situations
32-bit return, F suffix means do
not generate epilogue code (i.e.
LEAVE instruction)
JCXZ, JECXZ
LFS, LGS
LSS
LODSD
LOOPW, LOOPD
LOOPEW, LOOPED
LOOPZW, LOOPZD
LOOPNEW, LOOPNED
LOOPNZW, LOOPNZD
MOVSW, MOVSD
MOVSX
MOVZX
POPAD
Jump
if register
(E)CX
is
zero
Load far pointer
Load stack segment
Load string
Loop
Loop
while
equal
Loop
while
zero
Loop
while
not equal
Loop
while
not zero
Move
data from
string
to string
Move
with
sign-extend
Move
with
zero-extend
Pop all double-word
(32-bit)
registers from stack
Pop
data into EFLAGS register
Push all double-word
(32-bit)
registers onto stack
Push
EFLAGS register onto
stack
Scan string
data
double-word
Set
byte to one on condition
Does not pop register ESP off of stack
can be prefixed with REP
Loop; counter register is (E)CX
POPFD
PUSHAD
PUSHFD
SCASD
SETA, SETAE, SETB, SETBE, SETC, SETE, SETG,
SETGE, SETL, SETLE, SETNA, SETNAE, SETNB,
SETNBE, SETNC, SETNE, SETNG, SETNGE, SETNL,
SETNLE, SETNO, SETNP, SETNS, SETNZ, SETO,
SETP, SETPE, SETPO, SETS, SETZ
SHLD
SHRD
STOSx
Shift left double-word
Shift right double-word
Store string
Added with 80486
Zgłoś jeśli naruszono regulamin