Assembler Directives
Assembler Directives
Pipelining Technique:
More than one instruction can be at different
stages of execution at a single interval of time, so
speed increases.
Memory Segmentation
• 1 MB of memory is divided into 16 logical segments
of each 64KB.
• Base Address: It indicates the starting location of a
particular segment. It is present in Segment
registers.
• Offset Address : It is the distance of required
memory location from the beginning of the
segment. It is present in offset or index registers.
• Physical/Effective Address: It is the distance of
required memory location from the beginning of
memory.
• Physical address calculation:
1. Shift the Base/Segment address by 4 bit
locations left or 1 hexadecimal digit.
Shifting is equalent to multiplying CS by 10H.
2.Add the offset address to the shifted segment
value.
Ex: CS 9000H & IP 0FFF H
90000 H
+ 0FFF H
90FFF H
Effective Adrs Base Adrs 1MB
00000H 0000H 0000h
64KB
0FFFFH FFFFh
1000H
10000H 0000h
64KB
FFFFh
2000H
0000h
64KB
FFFFh
F000H
0000h
64KB
FFFFFH
FFFFh
Registers to point Segment and offset addresses
1. Code Segment: To store program or code
Base Address : CS
Offset Address: IP
2. Data Segment: To store Data
Base Address : DS
Offset Address: BP/BX
3. Stack Segment: To store temporary data
Base Address : SS
Offset Address :SP
4. Extra Segment: Alternate Data segment
Base Address : ES
Offset Address: SI/DI
Range of segment address- 0000H to F000H
Range of offset address 0000H to FFFFH
Addressing modes
• There are two types of instructions in 8086
1.Sequential flow ---8 modes
2. Control transfer--- 4 modes
Effective address: DS * 10H + offset address
1. Immediate --MOV AL, 80H; MOV AX,8000H
2. Direct ---MOV AL, [8000H]
3. Register---MOV AL, BL; MOV AX,BX
4. Register Indirect---MOV AL, [BX]
5. Register relative---MOV AL, 06H[BX]
6. Indexed---MOV AL, [SI]
7. Based Indexed--- MOV AL, [BX][SI]
8. Relative based indexed -- MOV AL, 07H[BX][SI]
Ex: Mathematically effective address can be
written as DS * 10H + offset address for data
segment.
Control transfer:
1. Intra segment – Program control is transferred
within the same segment
2. Inter segment – Program control is transferred
from one segment to another.
Important Pins in 8086
• ALE – Address latch enable
1; All 20 line --- As address bus
0; A19 – A 16 status signals
AD15 – AD0 Data bus
AD15 – AD8 : Higher byte of Data bus
AD7 – AD0 : Lower byte of Data bus
BHE- Bus high enable,
-- 0; If AD15 – AD8 are used for Data/Address .
BHE is used along with A0 line for selecting the even or odd bank of
memory
BHE A0
0 0 --- whole word (Two bytes)
0 1 --- odd bank byte
1 0 ---- even bank bye
1 1 --- Not used
• DT/R–> Data transmit or receive for bidirectional
buffers
-- 0: Receive ; 1: transmit
• DEN To enable the data buffers when data is
transmitted through AD15 – AD0 lines
• LOCK –> o/p signal , which indicates that Mp is
executing some important instruction having lock
prefix and buses can not be used by other system.
• TEST 0: then only processor executes further
instruction, used with WAIT instruction.