�Instruction Set of 8086
Why study instruction set?
What are we going to study?
Instruction Set
Types of Instructions in 8086
1: Data Copy/Transfer instructions
MOV Destination, Source
MOV AX,BX
| |
AH AL
AX
FF 33
BX
BH AL
| |
10 AB
Eg:
10 AB
1: Data Copy/Transfer instructions
PUSH Source
PUSH BX
SP
BX
BH BL
| |
10 AB
Eg:
10 AB
|
|
|
|
|
|
FF
33
5000
5001
5002
5003
| |
50
10
AB
02
01
00
1: Data Copy/Transfer instructions
POP Destination
POP DS
SP
DS
| |
22
Eg:
|
|
|
|
|
|
FF
33
5000
5001
5002
5003
| |
50
02
01
00
10
AB
33
1: Data Copy/Transfer instructions
XCHG Destination, Source
XCHG BX,AX
Eg:
AX
BX
| |
| |
FF 33
10 AB
1: Data Copy/Transfer instructions
IN AL/AX, 8-bit/16-bit port address�
IN AL, 80H
Eg:
AH AL
AX
| |
12
IN AX, DX
| |
80
PORT
AH AL
AX
| |
PORT
Eg:
| |
DX
80 00
12 34
| |
80 00
1: Data Copy/Transfer instructions
XLAT�
MOV AX, TABLE SEGMENT ADDRESS
MOV DS, AX
MOV AL, DISPLAY CODE
MOV BX, OFFSET TABLE
XLAT
Eg:
AH AL
AX
| |
12
| |
50 00
BX
|
|
|
|
|
|
3000:5000
3000:5001
3000:5002
3000:5003
7E
30
6D
79
12
| |
30 00
DS
6D
30 00
X 02
X
2: Arithmetic Instructions
2: Arithmetic Instructions
ADD Destination, Source�
ADD AX,BX
Eg:
AH AL
AX
| |
12
| |
50 00
BX
BH BL
+
AH AL
AX
| |
20 00
70 00
XX XX
2: Arithmetic Instructions
ADC Destination, Source
ADC AX,BX
Eg:
AH AL
AX
| |
12
| |
50 00
BX
BH BL
+
AH AL
AX
| |
20 00
70 01
XX XX
+
|
1
CY
2: Arithmetic Instructions
INC source�
INC AX
Eg:
AH AL
AX
| |
+
AH AL
AX
| |
70 00
70 01
70 00
|
1
2: Arithmetic Instructions
MUL operand�
MUL BH
Eg:
AH AL
AX
| |
X
AH AL
AX
| |
XX 04
00 08
XX XX
12
| |
02 XX
BX
BH BL
2: Arithmetic Instructions
DIV Operand
DIV BL
Eg:
AH AL
AX
| |
/
AH AL
AX
| |
88 88
04 04
88 88
12
| |
XX 22
BX
BH BL
3: Bit Manipulation Instructions (LOGICAL Instructions)
3: Bit Manipulation Instructions (LOGICAL Instructions)
AND
AND BL, 0FH
Eg:
BH BL
BX
| |
X
AH AL
AX
| |
XX 88
XX 08
XX 88
12
| |
XX 0F
xxxx xxxx AND 0000 1111 = 0000 xxxx
Reflection Spot
You just studied about the AND operator is used to clear certain bits. Which operator would be used to set certain bits without effecting the other bits
Pause and write your answer in your course journal
Reflection Spot (Answer)
OR
MOV AX, 2000h
OR AX, 0008h
Eg:
xxxx xxxx OR 0000 1111 = xxxx 1111
AH AL
AX
| |
or
AH AL
AX
| |
20 00
20 08
20 00
12
| |
00 08
This sets bit 4 in the AX register
0010 0000 OR 0000 1000 = 0010 1000
4: Instructions to perform shift operations
SHL
MOV BL,5d
SHL BL,1
Eg:
BH BL
Before
| |
BH BL
After
| |
XX 05
XX 0A
XX 05
0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |
5: Branch instructions�
5: Branch instructions�
Instructions to transfer the instruction during an execution with some conditions
JMP address
JC address
JC
What we have learnt
Summery
References
- By K Bhurchandi, A. K. Ray
DATA TRANSFER/COPY INSTRUCTION
LOGICAL INSTRUCTION:
ROTATE & SHIFT INSTRUCTION
ARITHEMATIC INSTRUCTION
ADJUSTMENT AFTER AIRTHEMATIC OPERATIONS
TRANSFER INSTRUCTION
Conditional Jump
LOOP CONTROL
SUBROUTINE & INTERRUPT INSTRUCTION
STRING INSRUCTION
REPEAT INSTRUCTION (placed in front of other String Instruction)
PROCESSOR CONTROL INSTRUCTION:�FLAG MANIPULATION�
CO-PROCESSOR MULTIPROCESSOR INTERFACE
INACTIVE STATUS
This presentation is licensed to the public Text is available under the Creative Commons Attribution-ShareAlike License