Addressing Modes of 8086
The instruction set of a microprocessor is a list of all the software instructions that the processor can execute. When an instruction expressed in machine code, it is encoding using 0’s and 1’s(in hexadecimal format), A single machine instruction can take anywhere from 1 to 6 byte
The Sequence of Instructions
Each command in a Program is called an Instruction
A Program written in machine language is referred to as
In 8086 we Write Program in
Instruction : format :-�Ex. �START: MOV AX, BX ; copy BX into AX
LABEL: | INSTRUCTION | ;COMMENT |
START: | MOV AX, BX | ; copy BX into AX |
Address identifier | | Semicolon marks the beginning of the Comment, Does not generate any machine code |
Why study addressing modes?
Addressing modes help us to understand the types of operands and the way they are accessed while executing an instruction.
What are we going to study?
Addressing modes
Types of addressing mode in 8086
1: Immediate addressing mode
MOV AX,10ABH
AX
| |
10 ABH
2: Direct addressing mode
MOV AX,[5000H]
| |
AX
Memory
5000
5001
5002
|
|
|
|
|
|
22
33
22
33
3: Register addressing mode
MOV AL,BL
MOV AX,BX
| |
AH AL
AX
FF 33
BX
| |
10 AB
BH BL
10 AB
4: Register Indirect addressing mode
MOV AX,[BX]
| |
Memory
5000
5001
5002
|
|
|
|
|
|
22
50 | 00 |
AX
BX
33
22
33
Reflection Spot
Q) Which addressing does instruction above belong, and why?
MOV [7000H],CX
Reflection Spot
Q) Which addressing does instruction above belonging and why?
MOV [7000H],CX
| |
Memory
7000
7001
7002
|
|
|
|
|
|
22
CX
33
Ans) Direct addressing mode
43
56
43
56
5: Indexed addressing mode
MOV AX,[SI]
| |
Memory
5000
5001
5002
|
|
|
|
|
|
22
50 | 00 |
AX
SI
33
22
33
6: Register relative addressing mode
MOV AX, 50H[BX]
| |
Memory
5051
5052
5053
|
|
|
|
|
|
44
50 | 00 |
AX
BX
33
Offset
+ 50H = 5050H
Final
Index
Address
44
33
7: Base plus index addressing mode
MOV AX, [BX] [SI]
| |
3000
3001
3002
|
|
|
|
|
|
10 | 00 |
AX
BX
= 3000H
Final
Index
Address
20 | 00 |
SI
+
12
34
12
34
8: Base relative plus index addressing mode
MOV AX,50H[BX][SI]
| |
3050
3051
3052
|
|
|
|
|
|
10 | 00 |
AX
BX
= 3050H
Final
Index
Address
20 | 00 |
SI
12
50H +
34
12
34
What we have learnt
Summery
References
- By K Bhurchandi, A. K. Ray
This presentation is licensed to the public Text is available under the Creative Commons Attribution-ShareAlike License