Microprocessor Systems
Microprocessor Systems
Microprocessor Systems
ASSIGNMENT No.3
15 Sessionals =
OPTIONS
BIU has
segment registers, instruction pointer, address generation and bus
control logic block, instruction queue
2. EU (Execution Unit)
EU has
general purpose registers,
ALU, control unit, instruction register, flag (or status) register
Description of 8086 Architecture
FETCH & EXECUTE CYCLE IN 8086
Although the 8086/88 still functions as a stored program computer, organization of the
CPU into a separate BIU and EU allows the fetch and execute cycles to overlap. To see
this, consider what happens when the 8086 or 8088 is first started.
1. The BIU outputs the contents of the instruction pointer register (IP) onto the address
bus, causing the selected byte or word to be read into the BIU.
3. Once inside the BIU, the instruction is passed to the queue. This is a first-in, first-out
storage register sometimes likened to a "pipeline".
4. Assuming that the queue is initially empty, the EU immediately draws this instruction
from the queue and begins execution.
5. While the EU is executing this instruction, the BIU proceeds to fetch a new
instruction. Depending on the execution time of the first instruction, the BIU may fill
the queue with several new instructions before the EU is ready to draw its next
instruction.
Description of 8086 Architecture
Registers of 8086
Description of 8086 Architecture
Address Generator:
Its responsibility is to generate 20-bit physical address for memory, by adding
base address with offset and zero hardwired.
Control System:
It is responsible to decoding the instruction, controlling the overall functions &
timing of Microprocessor.
Segment Registers:
Those are used to hold the base address of their relevant segments of
memory.
ES Register is used to hold base address of Extra Segment of memory
CS Register is used to hold base address of Code Segment of memory
SS Register is used to hold base address of Stack Segment of memory
DS Register is used to hold base address of Data Segment of memory
Description of 8086 Architecture
IP (Instruction Pointer)
IP is used to hold the offset address of next instruction to be fetched from
Code segment
SP (Stack Pointer)
SP is used to hold the offset of the top of stack, in stack segment
BP (Base Pointer)
Data Area may exists in stack segment, so BP is used to hold the base
address of Data Area within Stack Segment
SI (Source index)
It is used to hold the offset of the next instruction to be fetched from Data
Segment; it is also used in string operations
DI (Destination Index)
It is used to hold the offset of the next instruction to be fetched from Extra
Segment; it is also used in string operations
Accumulator register consists of two 8-bit registers AL and AH, which can be combined
together and used as a 16-bit register AX. AL in this case contains the low-order byte of
the word, and AH contains the high-order byte. Accumulator can be used for I/O
operations and string manipulation.
Base register consists of two 8-bit registers BL and BH, which can be combined together
and used as a 16-bit register BX. BL in this case contains the low-order byte of the word,
and BH contains the high-order byte. BX register usually contains a data pointer used for
based, based indexed or register indirect addressing.
Count register consists of 2 8-bit registers CL and CH, which can be combined together
and used as a 16-bit register CX. When combined, CL register contains the low-order
byte of the word, and CH contains the high-order byte. Count register can be used as a
counter in string manipulation and shift/rotate instructions.
Data register consists of 2 8-bit registers DL and DH, which can be combined together
and used as a 16-bit register DX. When combined, DL register contains the low-order
byte of the word, and DH contains the high-order byte. Data register can be used as a
port number in I/O operations. In integer 32-bit multiply and divide instruction the DX
register contains high-order word of the initial or resulting number.
Description of 8086 Architecture
FLAG REGISTER
Out of nine flags, six are condition flags and three are control flags.
Description of 8086 Architecture
The control flags
TF (Trap),
When TF (trap flag) is set (=1), the processor operates in single
stepping mode—i.e., pausing after each instruction is executed. This
mode is very useful during program development or program
debugging. When an interrupt is recognized, TF flag is cleared.
IF (Interrupt)
IF (interrupt flag) is set, the maskable interrupt INTR is enabled
otherwise disabled (i.e., when IF = 0).
DF (Direction) flag
DF (direction flag) is used in string (also known as block move)
operations. If DF is set to 1 and MOVS instruction is executed, the
contents of the index registers DI and SI are automatically decremented
to access the string from the highest memory location down to the
lowest memory location.
Description of 8086 Architecture
Condition flags
OF (Overflow),
OF is used only for signed arithmetic operation and is set if the result is too large to be fitted
in the number of bits available to accommodate it.
SF (Sign),
Set equal to high-order bit of result (0 is positive, 1 if negative)
ZF (Zero),
ZF is set if the result of an arithmetic or logical operation is zero.
AF (Auxiliary Carry),
AF is set if there is a carry out of bit 3 resulting from an addition operation or a borrow
required from bit 4 into bit 3 during subtraction operation.
PF (Parity)
PF is set if the lower 8-bits of the result of an operation contains an even number of 1’s
CF (Carry)]
CF is set if there is a carry out of the MSB position resulting from an addition operation or if a
borrow is needed out of the MSB position during subtraction.
1 MB Address Space of 8086
• SI (Source Index) Register contains offset, it is added with DS (Data Segment) Register ,
that contains base address and hardwired Zero is included before addition
• DI (Destination Index) Register contains offset, it is added with with ES (Extra Segment)
Register that contains base address and hardwired Zero is included before addition
• IP (Instruction Pointer) Register contains offset, it is added with CS (Code Segment)
Register that contains base address and hardwired Zero is included before addition
• SP (Stack Pointer) Register contains offset, it is added with with SS (Stack Segment)
Register that contains base address and hardwired Zero is included before addition
• Data area(s) may exist in stack. To access such data area in stack segment, BP register is
used which contains the offset address. BP register is also used as a general purpose
register.
Physical Addressing in 8086 Architecture (2/4)
Physical Addressing in 8086 Architecture (3/4)
Physical Addressing in 8086 Architecture (4/4)
Advantages of Memory Segmentation
Allow the memory capacity to be 1Mb
even though the addresses associated
with the individual instructions are only 16
bits wide.
Facilitate the use of separate memory
areas for the program, its data and the
stack.
Permit a program and/or its data to be put
into different areas of memory each time
the program is executed.
Multitasking becomes easy.
Architecture of INTEL 8086
Addressing Modes of 8086 (1/2)