Professional Documents
Culture Documents
THE ARCHITECTURE OF
8086
CHAPTER 1
unit
in stack
IP instruction pointer-points to the next
instruction to be executed
FLAGS
CONDITIONAL FLAGS
CONTROL FLAGS
OF =
Overflow flag
DF = Direction Flag
SF =
ZF =
Sign Flag
Zero Flag
Auxiliary carry Flag
Parity Flag
Carry Flag
AF =
PF =
CF =
IF = Interrupt Flag
TF = Trap Flag
10
Example 1.1
Find the status of the flags CF ,SF, AF after
11
Example 1.2
Show the effect of the following instructions
MOV BX,45ECH
ADD
BX,7723H
12
Example 1.3
Assuming we are adding signed 8 bit
numbers, how is the result of the following
addition to be interpreted?
MOV AL,125
ADD AL,75
13
14
15
MEMORY SEGMENTATION
Each address is 20 bit
But address registers are only 16 bits long
16
17
18
19
20
computations.
is the most important unit of the processor
instructions that are fetched and decoded, are
executed in the ALU.
the ALU has direct access to the general
purpose registers and flags.
21
22
Effective address
How is it calculated?
What is its relationship with the physical
address?
23
24
Example 1.4
The content of DS is 345BH. The amount of
25
26
Example 1.5
The contents of the following segment registers
are as given
CS =1111H, DS = 3333H, SS = 2526H
IP = 1232H, SP = 1100H ,
offset in data segment = 0020H
Calculate the corresponding physical addresses
for the addressed byte in a) CS b) SS and c) DS
27
28
Advantages of Segmentation
All address registers are only 16 bit long,
29
30
31
ADDRESSING MODES
The way in which operands are specified in an
32
33
Register Addressing
Here both the source and destination are
registers
MOV AL, AH
MOV CH, BL
MOV SI, BX
MOV ES,AX
34
Immediate Addressing
Here, the source will be a constant data
MOV AL, 45H
MOV BX, 34E3H
MOV CL.Q
MOV PRICE,40
MOV NUMS, 0FC6H
PRICE and NUMS are labels for memory
addresses
The x86 Microprocessor Lyla B Das
35
Direct Addressing
Here either the source or the destination will
be a memory address
MOV AX,[2345H]
MOV [1089H],AL
MOV AX , PRICE
MOV COST,AL
PRICE and COST are labels for memory
addresses
The x86 Microprocessor Lyla B Das
36
in a register
Effective address
EA = EA = { [BX] / [DI] /[SI]}
37
38
Example 1.6
39
40
41
42
43
Example 1.7
Find the address of physical memory for
the following instructions if the content
of the required registers are as given below
SS = 2344 H, DS = 4022H ,
BX = 0200H, BP = 1402H, SI = 4442H
i) MOV CL,1234H[SI]
i) MOV AL,5[SI[[BP]
44
45
Segment Override
MOV AL, ES: [BX]
MOV DS: [BP+7], BL
MOV AX, CS:[BX ]
46