&
Instruction set
8086
Microprocessor
Introduction
Program
A set of instructions written to solve
a problem.
Instruction
Directions which a microprocessor
follows to execute a task or part of a
task.
Computer language
High Level
Low Level
Machine Language
Binary bits
Assembly Language
English Alphabets
Mnemonics
Assembler
Mnemonics Machine
2
Language
ADDRESSING MODES
8086
Microprocessor
Addressing Modes
3. Direct Addressing
4. Register Indirect Addressing
5. Based Addressing
6. Indexed Addressing
8086
Microprocessor
Addressing Modes
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
Example:
4.
5.
Based Addressing
6.
Indexed Addressing
7.
(CL) (DH)
8.
String Addressing
9.
MOV CL, DH
8086
Microprocessor
Addressing Modes
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
4.
5.
Based Addressing
6.
Indexed Addressing
7.
(DL) 08H
8.
String Addressing
9.
(AX) 0A9FH
8086
Microprocessor
16 bytes of
contiguous memory
8086
Microprocessor
Addressing Modes
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
4.
5.
Based Addressing
6.
Indexed Addressing
7.
8.
String Addressing
9.
BX, [1354H]
BL, [0400H]
11
8086
Microprocessor
Addressing Modes
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
4.
5.
Based Addressing
6.
Indexed Addressing
7.
8.
String Addressing
9.
or,
(CL) (MA)
(CH) (MA +1)
12
8086
Microprocessor
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
4.
5.
Based Addressing
6.
Indexed Addressing
7.
8.
String Addressing
9.
Addressing Modes
or,
(AL) (MA)
(AH) (MA + 1)
13
8086
Microprocessor
Addressing Modes
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
4.
5.
Based Addressing
6.
Indexed Addressing
7.
8.
String Addressing
9.
or,
(CL) (MA)
(CH) (MA + 1)
14
8086
Microprocessor
Addressing Modes
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
4.
5.
Based Addressing
6.
Indexed Addressing
7.
8.
String Addressing
9.
15
8086
Microprocessor
Addressing Modes
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
4.
5.
Based Addressing
6.
Indexed Addressing
7.
8.
String Addressing
9.
8086
Microprocessor
Addressing Modes
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
4.
5.
Based Addressing
6.
Indexed Addressing
7.
8.
String Addressing
9.
17
8086
Microprocessor
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
4.
5.
Based Addressing
6.
Indexed Addressing
7.
8.
String Addressing
000AH 0AH
9.
If ZF = 1, then
Group IV : Relative
Addressing mode
Addressing Modes
EA = (IP) + 000AH
BA = (CS) x 1610
MA = BA + EA
If ZF = 1, then the program control jumps to
new address calculated above.
If ZF = 0, then next instruction of the
program is executed.
18
8086
Microprocessor
Addressing Modes
1.
Register Addressing
2.
Immediate Addressing
3.
Direct Addressing
4.
5.
Based Addressing
6.
Indexed Addressing
7.
8.
String Addressing
9.
Group IV : Implied
Addressing mode
19
INSTRUCTION SET
8086
Microprocessor
Instruction Set
21
8086
Microprocessor
Instruction Set
1. Data Transfer Instructions
22
8086
Microprocessor
Instruction Set
1. Data Transfer Instructions
Mnemonics:
(reg2) (reg1)
(mem) (reg1)
(reg2) (mem)
(reg) data
(mem) data
(reg2) (reg1)
(mem) (reg1)
23
8086
Microprocessor
Instruction Set
1. Data Transfer Instructions
Mnemonics:
(SP) (SP) 2
MA S = (SS) x 1610 + SP
(MA S ; MA S + 1) (reg16)
PUSH mem
(SP) (SP) 2
MA S = (SS) x 1610 + SP
(MA S ; MA S + 1) (mem)
MA S = (SS) x 1610 + SP
(reg16) (MA S ; MA S + 1)
(SP) (SP) + 2
POP mem
MA S = (SS) x 1610 + SP
(mem) (MA S ; MA S + 1)
(SP) (SP) + 2
24
8086
Microprocessor
Instruction Set
1. Data Transfer Instructions
Mnemonics:
IN A, [DX]
IN AL, [DX]
PORTaddr = (DX)
(AL) (PORT)
OUT [DX], AL
PORTaddr = (DX)
(PORT) (AL)
IN AX, [DX]
PORTaddr = (DX)
(AX) (PORT)
OUT [DX], AX
PORTaddr = (DX)
(PORT) (AX)
IN A, addr8
OUT addr8, A
IN AL, addr8
(AL) (addr8)
OUT addr8, AL
(addr8) (AL)
IN AX, addr8
(AX) (addr8)
OUT addr8, AX
(addr8) (AX)
25
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
ADD A, data
ADD AL, data8
ADD AX, data16
26
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
ADDC A, data
ADD AL, data8
ADD AX, data16
27
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
SUB A, data
SUB AL, data8
SUB AX, data16
28
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
SBB A, data
SBB AL, data8
SBB AX, data16
29
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
(reg8) (reg8) + 1
INC reg16
(reg16) (reg16) + 1
INC mem
(mem) (mem) + 1
(reg8) (reg8) - 1
DEC reg16
(reg16) (reg16) - 1
DEC mem
(mem) (mem) - 1
30
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
MUL mem
IMUL mem
31
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
DIV mem
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
IDIV mem
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
35
8086
Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics:
CMP A, data
CMP AL, data8
36
8086
Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics:
37
8086
Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics:
38
8086
Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics:
39
8086
Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics:
40
8086
Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics:
41
8086
Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics:
42
8086
Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics:
43
8086
Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics:
44
8086
Microprocessor
Instruction Set
4. String Manipulation Instructions
45
8086
Microprocessor
Instruction Set
4. String Manipulation Instructions
Mnemonics:
REP
REPZ/ REPE
(Repeat CMPS or SCAS until
ZF = 0)
REPNZ/ REPNE
(Repeat CMPS or SCAS until
ZF = 1)
46
8086
Microprocessor
Instruction Set
4. String Manipulation Instructions
Mnemonics:
MOVS
MOVSB
MOVSW
MA = (DS) x 1610 + (SI)
MAE = (ES) x 1610 + (DI)
(MAE ; MAE + 1) (MA; MA + 1)
If DF = 0, then (DI) (DI) + 2; (SI) (SI) +
47
2
8086
Microprocessor
Instruction Set
4. String Manipulation Instructions
Mnemonics:
CMPSW
8086
Microprocessor
Instruction Set
4. String Manipulation Instructions
Mnemonics:
SCASW
49
8086
Microprocessor
Instruction Set
4. String Manipulation Instructions
Mnemonics:
LODSW
50
8086
Microprocessor
Instruction Set
4. String Manipulation Instructions
Mnemonics:
STOSW
51
8086
Microprocessor
Instruction Set
5. Processor Control Instructions
Mnemonics
Explanation
STC
Set CF 1
CLC
Clear CF 0
CMC
STD
CLD
STI
CLI
NOP
No operation
HLT
WAIT
LOCK
52
8086
Microprocessor
Instruction Set
6. Control Transfer Instructions
Explanation
Call subroutine
RET
Unconditional jump
53
8086
Microprocessor
Instruction Set
6. Control Transfer Instructions
Checks flags
If conditions are true, the program control is
transferred to the new memory location in the same
segment by modifying the content of IP
54
8086
Microprocessor
Instruction Set
6. Control Transfer Instructions
Name
Alternate name
Name
Alternate name
JE disp8
Jump if equal
JZ disp8
Jump if result is 0
JE disp8
Jump if equal
JZ disp8
Jump if result is 0
JNE disp8
Jump if not equal
JNZ disp8
Jump if not zero
JNE disp8
Jump if not equal
JNZ disp8
Jump if not zero
JG disp8
Jump if greater
JNLE disp8
Jump if not less or
equal
JA disp8
Jump if above
JNBE disp8
Jump if not below
or equal
JGE disp8
Jump if greater
than or equal
JNL disp8
Jump if not less
JAE disp8
Jump if above or
equal
JNB disp8
Jump if not below
JL disp8
Jump if less than
JNGE disp8
Jump if not
greater than or
equal
JB disp8
Jump if below
JNAE disp8
Jump if not above
or equal
JLE disp8
Jump if less than
or equal
JNG disp8
Jump if not
greater
JBE disp8
Jump if below or
equal
JNA disp8
Jump if not above
55
8086
Microprocessor
Instruction Set
6. Control Transfer Instructions
Explanation
JC disp8
Jump if CF = 1
JNC disp8
Jump if CF = 0
JP disp8
Jump if PF = 1
JNP disp8
Jump if PF = 0
JO disp8
Jump if OF = 1
JNO disp8
Jump if OF = 0
JS disp8
Jump if SF = 1
JNS disp8
Jump if SF = 0
JZ disp8
JNZ disp8