0% found this document useful (0 votes)
16 views

f Unit - III (3.3)

Uploaded by

anupatil7576
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

f Unit - III (3.3)

Uploaded by

anupatil7576
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

3.

3 Flag register of 8086, segment


registers, index register, ALU-
Arithmetic logic unit
TLO 3.3 :

Explain given blocks of architecture of 8086 microprocessor.


Flag Register of 8086
 This register is also called status register.

 It is a 16 bit register which contains 6 status flags and


3 control flags.
 So, only nine bits of the 16 bit register are defined and the
remaining seven bits are undefined.
The Flag Register
contains:
• Carry flag
• Parity flag
• Auxiliary carry flag
• Zero flag
• Sign flag
• Trap flag
• Interrupt flag
• Direction flag
• Overflow flag
CF,PF,AF,ZF,SF,OF are the status flags and the TF,IF and DF
are the control flags.
1. Carry flag(CF):
This flag is set when there is a carry out of MSB in case of
addition or a borrow in case of subtraction.

2. Parity flag(PF):
This flag is set to 1 if the lower byte of the result contains
even numbers of 1s.

3. Auxiliary carry flag (AF):


This is set if there is a carry from the lowest nibble, i.e. bit
three during addition or borrow for the lowest nibble i.e. bit three
during subtraction.

4. Zero Flag(ZF):
This flag is set, if the result of the computation or comparison
performed by the previous instruction is zero.
5. Sign Flag(SF):
This flag is set, when the result of any computation is
negative.

6. Trap Flag(TF):
If TF=1, the CPU automatically generates an internal
interrupt after each instruction. This flag is used for debugging
of program.

7. Interrupt Flag(IF):
If this flag is set, the maskable interrupt INTR of 8086 is
enabled and if it is zero ,the interrupt is disabled.

If IF=1, the CPU will recognize external interrupt request.


8. Direction Flag (DF):
This bit is specially for string instructions.
If this flag bit is ‘0’, the string is processed beginning from the
lowest address to the highest address. Otherwise, the string is
processed from the highest address towards the lowest address.

9. Over flow Flag(OF):


This flag is set, if the result of a signed operation is large
enough to accommodate in a destination register.
Segment Registers of 8086:

BIU has 4 segment registers of 16 bits each i.e

• CS(Code Segment) register


• DS (Data Segment) register
• SS(Stack Segment) register
• ES(Extra
These Segment)
registers register
are used to point/address particular memory location in
memory.
• CS(Code Segment) register :
CS register is used to address/point a memory location in the code
segment of the memory where opcode of program is stored.

• DS (Data Segment) register :


DS register points to the data segment of the memory where the
data is stored.

• SS(Stack Segment) register :


SS Register is used to point Stack location in stack segment of the
memory and used to store data temporarily on the stack.

• ES(Extra Segment) register :


ES register is used to address the segment which is additional
data segment.
Index Register
In the 8086 microprocessor, index registers are used to modify memory
addresses during instruction execution, facilitating efficient data access and
manipulation. The 8086 has two primary index registers:

1. SI (Source Index):
Typically used as a pointer to source data in memory operations,
particularly in string operations. It can be used with the DS (Data Segment)
register by default.
Index Register
2. DI (Destination Index):
Often used as a pointer to destination data in memory operations,
especially in string operations. It usually works with the ES (Extra
Segment) register.

These index registers play a crucial role in array manipulation, string


processing, and various data transfer operations in 8086 assembly
programming.
Key Features Of Index Registers:
• 16-bit Registers:
Both SI and DI are 16-bit registers, allowing them to address up to
64KB of memory.

• Use in Addressing Modes:


These registers can be used in conjunction with displacement, base
registers, or segment registers for complex addressing modes, such
as indexed addressing and base-indexed addressing.

• Auto-Increment/Decrement:
In certain string operations, the SI and DI registers can
automatically increment or decrement, streamlining operations like
copying or comparing strings
ALU - Arithmetic Logic Unit
The ALU (Arithmetic Logic Unit) is a critical component of the 8086
microprocessor responsible for performing all arithmetic and logical
operations on 8 bit as well as 16 bit data.

• Functions:
 Arithmetic Operations: Addition, subtraction, multiplication, division.
 Logical Operations: AND, OR, NOT, XOR.

 Shift Operations: Logical shifts, arithmetic shifts, and rotates.

 Comparison Operations: Comparisons between data values.


Thank You

You might also like