Intel Code Table
Intel Code Table
Intel Code Table
CodeTable 1/2
TRANSFER
Name Comment
MOV
Move (copy)
XCHG
Exchange
Code
MOV Dest,Source
XCHG Op1,Op2
Operation
Dest:=Source
Op1:=Op2 , Op2:=Op1
STC
CLC
CMC
STD
CLD
STI
CLI
Set Carry
Clear Carry
Complement Carry
Set Direction
Clear Direction
Set Interrupt
Clear Interrupt
STC
CLC
CMC
STD
CLD
STI
CLI
CF:=1
CF:=0
CF:= CF
DF:=1 (string op's downwards)
DF:=0 (string op's upwards)
IF:=1
IF:=0
PUSH
PUSHF
PUSHA
POP
POPF
POPA
PUSH Source
PUSHF
PUSHA
POP Dest
POPF
POPA
CBW
CWD
CWDE
CBW
CWD
CWDE
AX:=AL (signed)
DX:AX:=AX (signed)
EAX:=AX (signed)
O D
Flags
T S Z A P C
1
0
1
0
1
0
IN
i Input
IN Dest, Port
AL/AX/EAX := byte/word/double of specified port
OUT i Output
OUT Port, Source Byte/word/double of specified port := AL/AX/EAX
i for more information see instruction specifications
Flags: =affected by this instruction ?=undefined after this instruction
ARITHMETIC
Flags
Name Comment
Code
Operation
O D I T S Z
ADD
Add
ADD Dest,Source Dest:=Dest+Source
ADC
Add with Carry
ADC Dest,Source Dest:=Dest+Source+CF
SUB
Subtract
SUB Dest,Source Dest:=Dest-Source
SBB
Subtract with borrow
SBB Dest,Source
Dest:=Dest-(Source+CF)
DIV
Divide (unsigned)
DIV Op
Op=byte: AL:=AX / Op
AH:=Rest ?
? ?
DIV
Divide (unsigned)
DIV Op
Op=word: AX:=DX:AX / Op
DX:=Rest ?
? ?
DIV 386 Divide (unsigned)
DIV Op
Op=doublew.: EAX:=EDX:EAX / Op
EDX:=Rest ?
? ?
IDIV
Signed Integer Divide
IDIV Op
Op=byte: AL:=AX / Op
AH:=Rest ?
? ?
IDIV
Signed Integer Divide
IDIV Op
Op=word: AX:=DX:AX / Op
DX:=Rest ?
? ?
IDIV 386 Signed Integer Divide
IDIV Op
Op=doublew.: EAX:=EDX:EAX / Op
EDX:=Rest ?
? ?
MUL
Multiply (unsigned)
MUL Op
Op=byte: AX:=AL*Op
if AH=0
? ?
MUL
Multiply (unsigned)
MUL Op
Op=word: DX:AX:=AX*Op
if DX=0
? ?
MUL 386 Multiply (unsigned)
MUL Op
Op=double: EDX:EAX:=EAX*Op
if EDX=0
? ?
IMUL i Signed Integer Multiply
IMUL Op
Op=byte: AX:=AL*Op
if AL sufficient
? ?
IMUL
Signed Integer Multiply
IMUL Op
Op=word: DX:AX:=AX*Op
if AX sufficient
? ?
IMUL 386 Signed Integer Multiply
IMUL Op
Op=double: EDX:EAX:=EAX*Op if EAX sufficient
? ?
INC
Increment
INC Op
Op:=Op+1 (Carry not affected !)
DEC
Decrement
DEC Op
Op:=Op-1 (Carry not affected !)
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
CMP
Compare
386
CMP Op1,Op2
SAL
Shift arithmetic left ( SHL) SAL Op,Quantity
SAR
Shift arithmetic right
SAR Op,Quantity
RCL
Rotate left through Carry
RCL Op,Quantity
RCR
Rotate right through Carry
RCR Op,Quantity
ROL
Rotate left
ROL Op,Quantity
ROR
Rotate right
ROR Op,Quantity
i for more information see instruction specifications
LOGIC
Name Comment
Code
NEG
Negate (two-complement)
NEG Op
NOT
Invert each bit
NOT Op
AND
Logical and
AND Dest,Source
OR
Logical or
OR Dest,Source
XOR
Logical exclusive or
XOR Dest,Source
SHL
SHR
( SAL)
SHL Op,Quantity
SHR Op,Quantity
Op1-Op2
i
i
i
i
i
i
?
?
Operation
Op:=0-Op
if Op=0 then CF:=0 else CF:=1
Op:= Op (invert each bit)
Dest:=Dest Source
Dest:=DestSource
Dest:=Dest (exor) Source
O D
Flags
T S Z A P C
0
0
0
?
?
?
0
0
0
i
i
?
?
Download latest version free of charge from www.jegerlehner.ch/intel This page may be freely distributed without cost provided it is not changed. All rights reserved
CodeTable 2/2
Comment
No operation
Code
NOP
Operation
No operation
LEA
LEA Dest,Source
INT
Interrupt
INT Nr
Code
CALL Proc
JMP
Jump
JMP Dest
JE
JZ
JCXZ
JP
JPE
Jump if Equal
Jump if Zero
Jump if CX Zero
Jump if Parity (Parity Even)
Jump if Parity Even
Operation
JE Dest
JZ Dest
JCXZ Dest
JP Dest
JPE Dest
( JZ)
( JE)
JNE
JNZ
JECXZ
JNP
JPO
JNE Dest
JNZ Dest
JECXZ Dest
JNP Dest
JPO Dest
( JNZ)
( JNE)
JA Dest
JAE Dest
JB Dest
JBE Dest
JNA Dest
JNAE Dest
JNB Dest
JNBE Dest
JC Dest
JNC Dest
( JNBE)
( JNB JNC)
( JNAE JC)
( JNA)
( JBE)
( JB JC)
( JAE JNC)
( JA)
JG Dest
JGE Dest
JL Dest
JLE Dest
JNG Dest
JNGE Dest
JNL Dest
JNLE Dest
JO Dest
JNO Dest
JS Dest
JNS Dest
( JNLE)
( JNL)
( JNGE)
( JNG)
( JLE)
( JL)
( JGE)
( JG)
( JPE)
( JP)
AL
87
EDX 386
DX
DH
DL
Data mul, div, IO
31
24 23
16 15
87
ECX 386
CX
CH
CL
Count loop, shift
31
24 23
16 15
87
EBX 386
BX
BH
BL
BaseX data ptr
31
Flags:
24 23
16 15
87
- - - - OD I T S
Code
RET
Accumulator
16 15
Comment
Return from subroutine
AX
24 23
Flags
T S Z A P C
Name
RET
EAX 386
31
Operation
General Registers:
AH
O D
-A- P-C
386
( JPO)
( JNP)
; Demo program
; Const
; define Byte, any value
; define Word, binary
; define Word, decimal
; define Doubleword, hex
; define String
; resolved by linker
; init datasegment reg
; init VarB
; set VarD
; addr of "H" of "Hello !"
; get value into accumulator
; add VarW2 to AX
; store AX in VarW2
; back to system
Download latest version free of charge from www.jegerlehner.ch/intel This page may be freely distributed without cost provided it is not changed. All rights reserved