Microprocessor Unit-1 PART A
Microprocessor Unit-1 PART A
PART – B
While addressing any location in the memory bank, the physical address is calculated
from two parts:
Physical address= segment address + offset address
The first is segment address, the segment registers contain 16-bit segment base
addresses, related to different segment.
The second part is the offset value in that segment.
Pointers and Index Registers:
The index and pointer registers are given below:
IP—Instruction pointer-store memory location of next instruction to be executed
BP—Base pointer
SP—Stack pointer
SI—Source index
DI—Destination index
The pointers registers contain offset within the particular segments. The pointer register
IP contains offset within the code segment. The pointer register BP contains offset within
the data segment. Thee pointer register SP contains offset within the stack segment. The
index registers are used as general purpose registers as well as for offset storage in case
of indexed, base indexed and relative base indexed addressing modes. The register SI is
used to store the offset of source data in data segment. The register DI is used to store
the offset of destination in data or extra segment. The index registers are particularly
useful for string manipulation.
8086 flag register
The 8086 flag register contents indicate the results of computation in the ALU. It also
contains some flag bits to control the CPU operations. A 16 bit flag register is used in
8086. It is divided into two parts .
i. Condition code or status flags
ii. Machine control flags
The condition code flag register is the lower byte of the 16-bit flag register. The
condition code flag register is identical to 8085 flag register, with an additional overflow
flag.
The control flag register is the higher byte of the flag register. It contains three flags
namely direction flag (D), interrupt flag (I) and trap flag (T).
4. Describe the 8086 Flag Register of 8086 Microprocessor
The 8086 flag register contents indicate the results of computation in the ALU. It also
contains some flag bits to control the CPU operations.
A 16 bit flag register is used in 8086. It is divided into two parts .
i. Condition code or status flags
ii. Machine control flags
The condition code flag register is the lower byte of the 16-bit flag register. The condition
code flag register is identical to 8085 flag register, with an additional overflow flag. The
control flag register is the higher byte of the flag register. It contains three flags namely
direction flag (D), interrupt flag (I) and trap flag (T).
7. Based Indexed: The effective address of data is formed, in this addressing mode, by
adding content of a base register (any one of BX or BP) to the content of an index register
(any one of SI or DI). The default segment register may be ES or DS.
Ex: MOV AX, [BX][SI]
Here, BX is the base register and SI is the index register the effective address is
computed as 10H * DS + [BX] + [SI].
8. Relative Based Indexed: The effective address is formed by adding an 8 or 16-bit
displacement with the sum of the contents of any one of the base register (BX or BP) and
any one of the index register, in a default segment.
Ex: MOV AX, 50H [BX] [SI]
Here, 50H is an immediate displacement, BX is base register and SI is an index register
the effective address of data is computed as 10H * DS + [BX] + [SI] + 50H
For control transfer instructions, the addressing modes depend upon whether the
destination is within the same segment or different one. It also depends upon the
method of passing the destination address to the processor. Basically, there are two
addressing modes for the control transfer instructions, intersegment addressing and
Intra-segment addressing modes. If the location to which the control is to be transferred
lies in a different segment other than the current one, the mode is called intersegment
mode. If the destination location lies in the same segment, the mode is called intra-
segment mode.