8086 Microprocessor: Instruction Sets
8086 Microprocessor: Instruction Sets
8086 Microprocessor: Instruction Sets
INSTRUCTION SETS
[CHAPTER 4]
1. Transfer instructions
Move
2. Arithmetic instructions
Add / Subtract
Multiplication / Division, etc.
3. Logical instructions
AND
OR, NOT etc.
Shadab A. ECE Department 3
1. Transfer instruction
MOV instruction
5
Shadab A. ECE Department
Move limitation
8
Shadab A. ECE Department
MOV : 16 / 8 Bit register
To move value
between
registers, their
size must be
the same.
Add / Subtract
Multiplication / Division
14
2. Subtract (SUB)/
Subtract with Borrow (SBB)
SUB AX, BX ;
SBB AL, BL ;
15
Ex. SUB/SBB
16
3. Increment (INC)/
Decrement (DEC)
INC / DEC :
INC register ;
DEC register ;
Example:
INC AX ; AX+1=> AX
17
4. Multiplication (MUL)
MUL reg ;
18
8 bit Multiplication
AL is multiplicand
Always accumulator (AX) keeps the result
19
16 bit Multiplication
AX is multiplicand
DX:AX keeps the result
MUL CX ; AX*CX = DX:AX
20
5. Division (DIV)
DIV reg ;
DIV mem ;
21
8 bit Division
AL is dividend
AL keeps the result
AH keeps the remainder
Example:
MOV AX, 0017h ; REMINDER RESULT
22
16 bit Division
DX:AX dividend.
AX keep the result, DX keep the remainder.
Example:
MOV AX, 4022h ; AX=4022h
MOV DX, 0000h ; DX=0000h
MOV CX, 1000h ; CX=1000h
REMINDER RESULT
DIV CX ; AX = 0004
; DX = 0022 0022 0004
DX AX
23
6. Conversion
24
Example Conversion
MOV AL,22h
CBW ; AX=0022h
25
3. Logical Instructions
AND
OR
NOT
Example:
AND BL, AL ; suppose BL=1000 0110 and AL = 1100 1010
then after the operation BL would be BL= 1000 0010
27
Shadab A. ECE Department
OR instruction
OR Destination, Source ;
OR CX, AX ; CX <= CX OR AX
Example:
OR BL, AL ; suppose BL=1000 0110 and AL = 1100 1010
then after the operation BL would be BL= 1100 1110
NOT Register ;
Example:
NOT AX ;