chapter 3 programming and instruction set L1_2025 (3)
chapter 3 programming and instruction set L1_2025 (3)
LECTURE 1
CONTENTS
Introduction
Addressing modes
Instruction formats
Instruction set
Assembler directives
2
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
4
Introduction cont..
– For e.g.
• MOV to indicate data transfer
5
Introduction cont..
• Note:
– Assembly language is specific to a given processor,
architecture dependent
– For e.g. assembly language of 8086 is different
than that of Motorola 6800 microprocessor
6
Introduction cont..
Assembly Machine
Assembler
Language Language
Program
Program Code
7
ADDRESSING MODES
8086 Microprocessor
Addressing Modes
1. Register Addressing
Group I : Addressing modes for
2. Immediate Addressing register and immediate data
3. Direct Addressing
5. Based Addressing
Group II : Addressing modes for
6. Indexed Addressing memory data
7. Based Index Addressing
8. String Addressing
1. Register Addressing The instruction will specify the name of the register which
holds the data to be operated by the instruction.
2. Immediate Addressing
Example:
3. Direct Addressing
MOV CL, DH
4. Register Indirect Addressing
8. String Addressing
10
8086 Microprocessor Group I : Addressing modes for
Addressing Modes register and immediate data
1. Register Addressing
In immediate addressing mode, an 8-bit or 16-bit data
2. Immediate Addressing is specified as part of the instruction
3. Direct Addressing
Example:
4. Register Indirect Addressing
MOV DL, 08H
5. Based Addressing
The 8-bit data (08H) given in the instruction is moved
6. Indexed Addressing to DL
8. String Addressing
MOV AX, 0A9FH
9. Direct I/O port Addressing
The 16-bit data (0A9FH) given in the instruction is
10. Indirect I/O port Addressing
moved to AX register
11. Relative Addressing
(AX) 0A9FH
12. Implied Addressing
11
8086 Microprocessor
Addressing Modes : Memory Access
Adder
13
8086 Microprocessor
Addressing Modes : Memory Access
BX SI
+ disp
BP DI 14
8086 Microprocessor Group II : Addressing modes for
Addressing Modes memory data
1. Register Addressing
2. Immediate Addressing
Here, the effective address of the memory location at
3. Direct Addressing
which the data operand is stored is given in the
4. Register Indirect Addressing instruction.
12. Implied Addressing This addressing mode is called direct because the
displacement of the operand from the segment base is
specified directly in the instruction.
15
8086 Microprocessor Group II : Addressing modes for
Addressing Modes memory data
(CL) (MA)
(CH) (MA +1)
16
8086 Microprocessor Group II : Addressing modes for
Addressing Modes memory data
5. Based Addressing When BX holds the base value of EA, 20-bit physical
address is calculated from BX and DS.
6. Indexed Addressing
When BP holds the base value of EA, BP and SS is used.
7. Based Index Addressing
(AL) (MA)
(AH) (MA + 1)
17
8086 Microprocessor Group II : Addressing modes for
Addressing Modes memory data
(CL) (MA)
(CH) (MA + 1)
18
8086 Microprocessor Group II : Addressing modes for
Addressing Modes memory data
19
8086 Microprocessor Group II : Addressing modes for
Addressing Modes memory data
6. Indexed Addressing
Example: MOVS BYTE
7. Based Index Addressing
Operations:
8. String Addressing
Calculation of source memory location:
9. Direct I/O port Addressing EA = (SI) BA = (DS) x 1610 MA = BA + EA
20
8086 Microprocessor Group III : Addressing modes
Addressing Modes for I/O ports
1. Register Addressing These addressing modes are used to access data from
standard I/O mapped devices or ports.
2. Immediate Addressing
In direct port addressing mode, an 8-bit port address is
3. Direct Addressing directly specified in the instruction.
1. Register Addressing
2. Immediate Addressing
22
8086 Microprocessor Group IV : Implied
Addressing Modes Addressing mode
1. Register Addressing
6. Indexed Addressing
8. String Addressing
23