MIP Unit 2
MIP Unit 2
Microprocessor Programming
Unit 1-8086- 16 Bit Microprocessor
Akhil M. Jaiswal
9028637523
2
Akhil M. Jaiswal 9028637523
8086 Pin Description in detail −
1. Vcc,/GND: Power supply and frequency signals : It uses 5V DC supply at VCC pin 40,
and uses ground at VSS pin 1 and 20 for its operation.
2. Clock signal: Clock signal is provided through Pin-19. It provides timing to the
processor for operations. Its frequency is different for different versions, i.e. 5MHz,
8MHz and 10MHz.
3. Address/data bus- AD0-AD15. These are 16 address/data bus. AD0-AD7 carries low
order byte data and AD8AD15 carries higher order byte data. During the first clock
cycle, it carries 16-bit address and after that it carries 16-bit data.
4. Address/status bus- A16-A19/S3-S6. These are the 4 address/status buses. During
the first clock cycle, it carries 4-bit address and later it carries status signals.
5. S7/BHE- BHE stands for Bus High Enable. It is available at pin 34 and used to indicate
the transfer of data using data bus D8-D15. This signal is low during the first clock
cycle, thereafter it is active.
6. Read- It is available at pin 32 and is used to read signal for Read operation.
7. Ready- It is available at pin 22. It is an acknowledgement signal from I/O devices that
data is transferred. It is an active high signal. When it is high, it indicates that the
device is ready to transfer data. When it is low, it indicates wait state.
8. RESET- It is available at pin 21 and is used to restart the execution. It causes the
processor to immediately terminate its present activity. This signal is active high for
the first 4 clock cycles to RESET the microprocessor.
9. INTR- It is available at pin 18. It is an interrupt request signal, which is sampled
during the last clock cycle of each instruction to determine if the processor
considered this as an interrupt or not.
10. NMI- It stands for non-maskable interrupt and is available at pin 17. It is an edge
triggered input, which causes an interrupt request to the microprocessor.
11. TEST: This signal is like wait state and is available at pin 23. When this signal is high,
then the processor has to wait for IDLE state, else the execution continues.
12. MN/MX- It stands for Minimum/Maximum and is available at pin 33. It indicates what
mode the processor is to operate in; when it is high, it works in the minimum mode
and vice-aversa.
13. INTA- It is an interrupt acknowledgement signal and id available at pin 24. When the
microprocessor receives this signal, it acknowledges the interrupt.
14. ALE- It stands for address enable latch and is available at pin 25. A positive pulse is
generated each time the processor begins any operation. This signal indicates the
availability of a valid address on the address/data lines.
15. DEN- It stands for Data Enable and is available at pin 26. It is used to enable
Transreceiver 8286. The transreceiver is a device used to separate data from the
address/data bus.
16. DT/R- It stands for Data Transmit/Receive signal and is available at pin 27. It decides
the direction of data flow through the transreceiver. When it is high, data is
transmitted out and vice-a-versa.
3
Akhil M. Jaiswal 9028637523
17. M/IO- This signal is used to distinguish between memory and I/O operations. When it
is high, it indicates I/O operation and when it is low indicates the memory operation. It
is available at pin 28.
18. WR- It stands for write signal and is available at pin 29. It is used to write the data
into the memory or the output device depending on the status of M/IO signal.
19. HLDA- It stands for Hold Acknowledgement signal and is available at pin 30. This
signal acknowledges the HOLD signal.
20. HOLD- This signal indicates to the processor that external devices are requesting to
access the address/data buses. It is available at pin 31.
21. QS1 and QS0 :-These are queue status signals and are available at pin 24 and 25.
These signals provide the status of instruction queue. Their conditions are shown in
the following table −
22. S0, S1, S2: These are the status signals that provide the status of operation, which is
used by the Bus Controller 8288 to generate memory & I/O control signals. These are
available at pin 26, 27, and 28. Following is the table showing their status −
S2 S1 S0 Status
0 0 0 Interrupt acknowledgement
0 0 1 I/O Read
0 1 0 I/O Write
0 1 1 Halt
1 0 0 Opcode fetch
1 0 1 Memory read
1 1 0 Memory write
1 1 1 Passive
23. LOCK:- When this signal is active, it indicates to the other processors not to ask the
CPU to leave the system bus. It is activated using the LOCK prefix on any instruction
and is available at pin 29.
24. RQ/GT1 and RQ/GT0 :-These are the Request/Grant signals used by the other
processors requesting the CPU to release the system bus. When the signal is received
by CPU, then it sends acknowledgment. RQ/GT0 has a higher priority than RQ/GT1.
4
Akhil M. Jaiswal 9028637523
1.2 Architecture of 8086
Functional Block Diagram of 8086: The following diagram depicts the
architecture of a 8086 Microprocessor
8086 architecture is divided into two main units: Bus Interface Unit (BIU) &
Execution Unit (EU)
The BIU:
5
Akhil M. Jaiswal 9028637523
o The EU receives opcode of an instruction from the queue, decodes it and then
executes it. While Execution, unit decodes or executes an instruction, then the BIU
fetches instruction codes from the memory and stores them in the queue.
o The BIU and EU operate in parallel independently. This makes processing faster.
o Execution Unit Contains: General purpose registers, stack pointer, base pointer and
index registers, ALU, flag registers (FLAGS), instruction decoder and timing and
control unit.
o Let’s see each block in detail:
1. General Purpose Registers: There are four 16-bit general purpose registers Used
for arithmetic, logic, and data operations: AX (Accumulator Register), BX (Base
Register), CX (Counter) and DX. Each of these 16-bit registers are further
subdivided into 8-bit registers as shown below:
16-bit registers 8-bit high-order registers 8-bit low-order registers
6
Akhil M. Jaiswal 9028637523
AX AH AL
BX BH BL
CX CH CL
DX DH DL
2. Index Register: The following four registers are in the group of pointer and index
registers:
o Stack Pointer (SP): Used to point to the top of the stack
o Base Pointer (BP): Used to point to the base of the stack
o Source Index (SI): Used for source indexed addressing for string
operations.
o Destination Index (DI): Used for destination indexed addressing for string
operations.
3. ALU: It handles all arithmetic and logical operations. Such as addition, subtraction,
multiplication, division, AND, OR, NOT operations.
4. Flag Register: It is a 16-bit register which exactly behaves like a flip-flop, means it
changes states according to the result stored in the accumulator. It has 9 flags and
they are divided into 2 groups i.e. conditional and control flags.
5. Conditional Flags: This flag represents the result of the last arithmetic or logical
instruction executed. Conditional flags are:
o Carry Flag
o Auxiliary Flag
o Parity Flag
o Zero Flag
o Sign Flag
o Overflow Flag
6. Control Flags: It controls the operations of the execution unit. Control flags are:
o Trap Flag
o Interrupt Flag
o Direction Flag
Register Organization:
1. General Purpose Registers: There are four 16-bit general purpose: AX
(Accumulator Register), BX (Base Register), CX (Counter) and DX. Each of
these 16-bit registers are further subdivided into 8-bit registers
2. AX, BX, CX, DX: Used for arithmetic, logic, and data operations
3. Segment Registers:
o CS, DS, SS, ES: Hold base addresses of code, data, stack, and extra
segments.
4. Pointer and Index Registers:
o SP, BP: Stack-related operations.
o SI, DI: Used for indexed addressing and string operations.
5. Flag Register:
o Status flags (e.g., Zero Flag, Sign Flag) and control flags (e.g., Interrupt Flag).
7
Akhil M. Jaiswal 9028637523
1.3 Concept of Pipelining
Memory Segmentation:
Definition: Divides memory into segments for better organization and protection.
Segment Types:
o Code Segment (CS): Stores program instructions.
o Data Segment (DS): Stores data variables.
o Stack Segment (SS): Holds stack-related data.
o Extra Segment (ES): Additional data storage.
Advantages:
o Easier program and data management.
o Supports modular programming.
8
Akhil M. Jaiswal 9028637523
It consists of a powerful instruction set, which provides operation like division and
multiplication very quickly.
8086 is designed to operate in two modes, i.e., Minimum and Maximum mode.
8086 does not have a RAM or ROM inside it. However, it has internal
registers for storing intermediate and final results and interfaces with
memory located outside it through the System Bus.
In the case of 8086, it is a 16-bit Integer processor in a 40-pin, Dual
Inline Packaged IC.
The size of the internal registers(present within the chip) indicates how
much information the processor can operate on at a time (in this case 16-
bit registers) and how it moves data around internally within the chip,
sometimes also referred to as the internal data bus.
8086 provides the programmer with 14 internal registers, each of 16 bits or
2 bytes wide. The main advantage of the 8086 microprocessor is
that it supports Pipelining.
Architecture of 8086: The following diagram depicts the architecture of a 8086 Microprocessor –
9
Akhil M. Jaiswal 9028637523
The Clock speed of this microprocessor varies between 5, 8 and 10 MHz for different versions.
It supports pipelining.
In 8086, more than one processor is used. An additional external processor can also be employed.
It contains more number of transistors compare to 8085 microprocessor. It contains about 29000 in size.
10
Akhil M. Jaiswal 9028637523
Architecture of Intel 8086 is divided into 2 units: The Bus Interface
Unit (BIU), and The Execution Unit (EU). These are explained as following
below.
It provides the interface of 8086 to external memory and I/O devices via the
System Bus. It performs various machine cycles such as memory read, I/O
read, etc. to transfer data between memory and I/O devices.
BIU performs the following functions are as follows:
It generates the 20-bit physical address for memory access.
It fetches instructions from the memory.
It transfers data to and from the memory and I/O.
Maintains the 6-byte pre-fetch instruction queue(supports
pipelining).
BIU mainly contains the 4 Segment registers, the Instruction Pointer, a
pre-fetch queue, and an Address Generation Circuit.
Instruction Pointer (IP):
It is a 16-bit register. It holds offset of the next instructions in
the Code Segment.
IP is incremented after every instruction byte is fetched.
IP gets a new value whenever a branch instruction occurs.
CS is multiplied by 10H to give the 20-bit physical address of the Code
Segment.
The address of the next instruction is calculated by using the formula
CS x 10H + IP.
Example:
CS = 4321H IP = 1000H
then CS x 10H = 43210H + offset = 44210H
Here Offset = Instruction Pointer(IP)
This is the address of the next instruction.
Code Segment register: (16 Bit register): CS holds the base address for
the Code Segment. All programs are stored in the Code Segment and
accessed via the IP.
Data Segment register: (16 Bit register): DS holds the base address for
the Data Segment.
Stack Segment register: (16 Bit register): SS holds the base address for
the Stack Segment.
Extra Segment register: (16 Bit register): ES holds the base address for
the Extra Segment.
11
Akhil M. Jaiswal 9028637523
Segment registers store starting address of each segments in memory.
Address Generation Circuit:
2.prefetch unit:
The main components of the EU are General purpose registers, the ALU,
Special purpose registers, the Instruction Register and Instruction Decoder,
and the Flag/Status Register.
1. Fetches instructions from the Queue in BIU, decodes, and executes
arithmetic and logic operations using the ALU.
2. Sends control signals for internal data transfer operations within the
microprocessor.(Control Unit)
3. Sends request signals to the BIU to access the external module.
4. It operates with respect to T-states (clock cycles) and not machine
cycles.
8086 has four 16-bit general purpose registers AX, BX, CX, and DX which
store intermediate values during execution. Each of these has two 8-bit parts
(higher and lower).
AX register: (Combination of A L and AH Registers)
It holds operands and results during multiplication and division
operations. Also an accumulator during String operations.
Arithmetic Logic Unit (16-bit): Performs 8 and 16-bit arithmetic and logic
operations.
Special purpose registers (16-bit): Special purpose registers are called
Offset registers also. Which points to specific memory locations under each
segment.
We can understand the concept of segments as Textbook pages. Suppose
there are 10 chapters in one textbook and each chapter takes exactly 100
pages. So the book will contain 1000 pages. Now suppose we want to access
page number 575 from the book then 500 will be the segment base address
which can be anything in the context of microprocessors like Code, Data,
Stack, and Extra Segment. So 500 will be segment registers that are present
in Bus Interface Unit (BIU). And 500 + 75 is called an offset register through
which we can reach on specific page number under a specific segment.
Hence 500 is the segment base address and 75 is an offset address or
(Instruction Pointer, Stack Pointer, Base Pointer, Source Index, Destination
Index) any of the above according to their segment implementation.
Stack Pointer: Points to Stack top. Stack is in Stack Segment, used
during instructions like PUSH, POP, CALL, RET etc.
Base Pointer: BP can hold the offset addresses of any location in the
stack segment. It is used to access random locations of the stack.
Source Index: It holds offset address in Data Segment during string
operations.
Destination Index: It holds offset address in Extra Segment during
string operations.
Instruction Register and Instruction Decoder:
The EU fetches an opcode from the queue into the instruction register. The
instruction decoder decodes it and sends the information to the control circuit
for execution.
Flag/Status register (16 bits) : It has 9 flags that help change or recognize
the state of the microprocessor.
6 Status flags:
1. Carry flag(CF)
2. Parity flag(PF)
3. Auxiliary carry flag(AF)
14
Akhil M. Jaiswal 9028637523
4. Zero flag(Z)
5. Sign flag(S)
6. Overflow flag (O)
Status flags are updated after every arithmetic and logic operation.
3 Control flags:
1. Trap flag(TF)
2. Interrupt flag(IF)
3. Direction flag(DF)
These flags can be set or reset using control instructions like CLC, STC, CLD,
STD, CLI, STI, etc. The Control flags are used to control certain operations.
4.Decode unit:
The Decode Unit in the 8086 microprocessor is a component that decodes the
instructions that have been fetched from memory. The decode unit takes the
machine code instructions and translates them into micro-operations that can
be executed by the microprocessor’s execution unit.
The Decode Unit works in parallel with the Prefetch Unit, which fetches
instructions from memory and stores them in a queue. The Decode Unit reads
the instructions from the queue and translates them into micro-operations
that can be executed by the microprocessor.
The Decode Unit is an important component of the 8086 microprocessor, as it
allows the microprocessor to execute instructions efficiently and accurately.
The decode unit ensures that the microprocessor can execute complex
instructions, such as jump instructions and loop instructions, by translating
them into a series of simple micro-operations.
The Decode Unit is responsible for decoding instructions, performing register-
to-register operations, and performing memory-to-register operations. It also
decodes conditional jumps, calls, and returns, and performs data transfers
between memory and registers.
The Decode Unit helps to improve the performance of the 8086
microprocessor by allowing it to execute instructions quickly and accurately.
This improved performance helps to ensure that the 8086 remains
competitive in its performance and capabilities, even as technology continues
to advance.
5.control unit :
15
Akhil M. Jaiswal 9028637523
coordinating the activities of the other components, including the Decode
Unit, Execution Unit, and Prefetch Unit.
The Control Unit acts as the central coordinator for the microprocessor,
directing the flow of data and instructions and ensuring that the
microprocessor operates correctly. It also monitors the state of the
microprocessor, ensuring that the correct sequence of operations is followed.
The Control Unit is responsible for fetching instructions from memory,
decoding them, executing them, and updating the microprocessor’s state. It
also handles interrupt requests and performs system management tasks,
such as power management and error handling.
The Control Unit is an essential component of the 8086 microprocessor, as it
allows the microprocessor to operate efficiently and accurately. The control
unit ensures that the microprocessor can execute complex instructions, such
as jump instructions and loop instructions, by coordinating the activities of
the other components.
The Control Unit helps to improve the performance of the 8086
microprocessor by managing the flow of instructions and data through the
microprocessor, ensuring that the microprocessor operates correctly and
efficiently. This improved performance helps to ensure that the 8086 remains
competitive in its performance and capabilities, even as technology continues
to advance.
1.Address Bus: The address bus is used to send the memory address of the
instruction or data being read or written. The address bus is 16 bits wide,
allowing the 8086 to address up to 64 kilobytes of memory.
2.Data Bus: The data bus is used to transfer data between the
microprocessor and memory. The data bus is 16 bits wide, allowing the 8086
to transfer 16-bit data words at a time.
3.Control Bus: The control bus is used to transfer control signals between
the microprocessor and other components in the computer system. The
control bus is used to send signals such as read, write, and interrupt requests,
and to transfer status information between the microprocessor and other
components.
The buses in the 8086 microprocessor play a crucial role in allowing the
microprocessor to access and transfer data from memory, as well as to
interact with other components in the computer system. The 8086’s ability to
use these buses efficiently and effectively helps to ensure that it remains
16
Akhil M. Jaiswal 9028637523
competitive in its performance and capabilities, even as technology continues
to advance.
Execution of whole 8086 Architecture:
1. All instructions are stored in memory hence to fetch any instruction
first task is to obtain the Physical address of the instruction is to be
fetched. Hence this task is done by Bus Interface Unit (BIU) and by
Segment Registers. Suppose the Code segment has a Segment
address and the Instruction pointer has some offset address then the
physical address calculator circuit calculates the physical address in
which our instruction is to be fetched.
2. After the address calculation instruction is fetched from memory and
it passes through C-Bus (Data bus) as shown in the figure, and
according to the size of the instruction, the instruction pre-fetch
queue fills up. For example MOV AX, BX is 1 Byte instruction so it will
take only the 1st block of the queue, and MOV BX,4050H is 3 Byte
instruction so it will take 3 blocks of the pre-fetch queue.
3. When our instruction is ready for execution, according to the FIFO
property of the queue instruction comes into the control system or
control circuit which resides in the Execution unit. Here instruction
decoding takes place. The decoding control system generates an
opcode that tells the microprocessor unit which operation is to be
performed. So the control system sends signals all over the
microprocessor about what to perform and what to extract from
General and Special Purpose Registers.
4. Hence after decoding microprocessor fetches data from GPR and
according to instructions like ADD, SUB, MUL, and DIV data residing in
GPRs are fetched and put as ALU’s input. and after that addition,
multiplication, division, or subtraction whichever calculation is to be
carried out.
5. According to arithmetic, flag register values change dynamically.
6. While Instruction was decoding and executing from step-3 of
our algorithm, the Bus interface Unit doesn’t remain idle. it
continuously fetches an instruction from memory and put it in
a pre-fetch queue and gets ready for execution in a FIFO
manner whenever the time arrives.
7. So in this way, unlike the 8085 microprocessor, here the fetch,
decode, and execution process happens in parallel and not
sequentially. This is called pipelining, and because of the instruction
pre-fetch queue, all fetching, decoding, and execution process happen
side-by-side. Hence there is partitioning in 8086 architecture like Bus
Interface Unit and Execution Unit to support Pipelining phenomena.
What is Pipelining?
To grasp the concept of pipelining let us look at the root level of how the program is
executed. Instruction is the smallest execution packet of a program. Each instruction
contains one or more operations. Simple scalar processors execute one or more
instruction per clock cycle, with each instruction containing only one operation.
Instructions are executed as a sequence of phases, to produce the expected results. This
sequence is given below
Not all instructions require all the above steps but most do. These steps use different
hardware functions. In pipelining these different phases are performed concurrently. In
pipelining these phases are considered independent between different operations and can
be overlapped. Thus, multiple operations can be performed simultaneously with each
operation being in its own independent phase.
Instruction Pipelining
Let us look the way instructions are processed in pipelining. This can be easily understood
by the diagram below.
Instruction Pipelining
Assume that the instructions are independent. In simple pipelining processor, at a given
time, there is only one operation in each phase. The initial phase is the IF phase. So, at
the first clock cycle, one operation is fetched. When the next clock pulse arrives, the first
operation goes into the ID phase leaving the IF phase empty. Now, this empty phase is
allocated to the next operation. So, during the second clock pulse first operation is in the
ID phase and the second operation is in the IF phase.
For the third cycle, the first operation will be in AG phase, the second operation will be in
the ID phase and the third operation will be in the IF phase. In this way, instructions are
executed concurrently and after six cycles the processor will output a completely executed
instruction per clock cycle.
Has this instruction executed sequentially, initially the first instruction has to go through all
the phases then the next instruction would be fetched? So, for execution of each
instruction, the processor would require six clock cycles. But in a pipelined processor as
the execution of instructions takes place concurrently, only the initial instruction requires
six cycles and all the remaining instructions are executed as one per each cycle thereby
reducing the time of execution and increasing the speed of the processor.
20
Akhil M. Jaiswal 9028637523
Advantages of Pipelining
Instruction throughput increases.
Increase in the number of pipeline stages increases the number of instructions
executed simultaneously.
Faster ALU can be designed when pipelining is used.
Pipelined CPU’s works at higher clock frequencies than the RAM.
Pipelining increases the overall performance of the CPU.
Disadvantages of Pipelining
Designing of the pipelined processor is complex.
Instruction latency increases in pipelined processors.
The throughput of a pipelined processor is difficult to predict.
The longer the pipeline, worse the problem of hazard for branch instructions.
A16-A19: High order address bus. These are multiplexed with status signals.
S2, S1, S0: Status pins. These pins are active during T4, T1 and T2 states
and is returned to passive state (1,1,1 during T3 or Tw (when ready is
inactive). These are used by the 8288 bus controller for generating all the
memory and I/O operation) access control signals. Any change in S2, S1, S0
during T4 indicates the beginning of a bus cycle.
21
Akhil M. Jaiswal 9028637523
S S S Characteristic
2 1 0 s
Interrupt
0 0 0
acknowledge
0 1 1 Halt
1 0 0 Code access
1 0 1 Read memory
1 1 0 Write memory
1 1 1 Passive state
Extra segment
0 0
access
Stack segment
0 1
access
Code segment
1 0
access
1 1 Data segment
22
Akhil M. Jaiswal 9028637523
A17/ A16/
S4 S3 Function
access
23
Akhil M. Jaiswal 9028637523
is internally synchronized during each of the clock cycle on leading edge of
the clock.
CLK : Clock Input. The clock input provides the basic timing for processing
operation and bus control activity. Its an asymmetric square wave with a 33%
duty cycle.
RESET : This pin requires the microprocessor to terminate its present activity
immediately. The signal must be active high(1) for at least four clock cycles.
Vcc : Power Supply( +5V D.C.)
GND : Ground
QS1,QS0 : Queue Status. These signals indicate the status of the internal
8086 instruction queue according to the table shown below:
QS QS
1 0 Status
0 0 No operation
M/IO’: This signal is used to distinguish between memory and I/O operations.
The M Signal is Active high whereas the IO’ Signal is Active Low. When this Pin
is High, the memory operations takes place. On the other hand, when the Pin
is low, the Input/Output operations from the peripheral devices takes place.
=DT/R : Data Transmit/Receive. This pin is required in minimum systems,
that want to use an 8286 or 8287 data bus transceiver. The direction of data
flow is controlled through the transceiver.
DEN: Data enable. This pin is provided as an output enable for the 8286/8287
in a minimum system which uses transceiver. DEN is active low(0) during
each memory and input-output access and for INTA cycles.
HOLD/HOLDA: HOLD indicates that another master has been requesting a
local bus .This is an active high(1). The microprocessor receiving the HOLD
request will issue HLDA (high) as an acknowledgement in the middle of a T4
or T1 clock cycle.
24
Akhil M. Jaiswal 9028637523
ALE : Address Latch Enable. ALE is provided by the microprocessor to latch
the address into the 8282 or 8283 address latch. It is an active high(1) pulse
during T1 of any bus cycle. ALE signal is never floated, is always integer.
Conclusion
The 8086 chip addresses a milestone in the development of PC innovation,
presenting a 16-bit design that laid the foundation for future progressions. Its
capacity to address up to 1 MB of memory and its fragmented memory model
gave huge enhancements in figuring power and effectiveness. Understanding
its pin outline and inward construction is fundamental for both authentic
setting and viable applications in framework plan and investigating. The
tradition of the 8086 is apparent in its impact on resulting processors and its
part in forming the advancement of current registering frameworks.
The description of the pins of 8086 is as follows:
AD0-AD15 (Address Data Bus): Bidirectional address/data lines. These are low order
address bus. They are multiplexed with data.
When these lines are used to transmit memory address, the symbol A is used instead of AD,
for example, A0- A15.
A16 - A19 (Output): High order address lines. These are multiplexed with status signals.
A16/S3, A17/S4: A16 and A17 are multiplexed with segment identifier signals S3 and S4.
BHE/S7 (Output): Bus High Enable/Status. During T1, it is low. It enables the data onto the
most significant half of data bus, D8-D15. 8-bit device connected to upper half of the data
bus use BHE signal. It is multiplexed with status signal S7. S7 signal is available during T3
and T4.
Ready (Input): The addressed memory or I/O sends acknowledgment through this pin.
When HIGH, it denotes that the peripheral is ready to transfer data.
25
Akhil M. Jaiswal 9028637523
TEST (Input): Wait for test control. When LOW the microprocessor continues execution
otherwise waits.
GND: Ground.
26
Akhil M. Jaiswal 9028637523
31
Akhil M. Jaiswal 9028637523
35
Akhil M. Jaiswal 9028637523
Segment Registers
Flag Registers
37
Akhil M. Jaiswal 9028637523
The functions of each general purpose registers are
stated below:
Accumulator Register(AX):When ALU performs
Segment Registers
The Bus Interface Unit (BIU) of 8086 microprocessor.
The segment registers are responsible for managing
memory access. As the computer memory is
segmented, the segment registers tracks the memory
location of each and every segment. The segment
registers contains four 16-bit registers namely, Code
Segment(CS), Data Segment(DS), Stack segment(SS)
and Extra Segment(ES). These registers are used to
38
Akhil M. Jaiswal 9028637523
hold the 16 bits of starting address. Each segment
register holds the starting address of its respective
memory segment, allowing the microprocessor to
quickly locate and access the data it needs during
program execution.
Segment Registers
39
Akhil M. Jaiswal 9028637523
Stack Segment(SS): It is used to store the
address as well as data in the memory while the
subprogram is executing.
Extra Segment(ES): This register is used to hold
the extra data by providing additional data
segment in the memory.
40
Akhil M. Jaiswal 9028637523
The function of each general purpose registers are
stated below:
Stack Pointer(SP): Stack Pointer register is used
Flag Register
The flag register is also called as status register. It is
a 16-bit register which is a set of flip-flops. There are
nine flags in this register.
Flag
Register
41
Akhil M. Jaiswal 9028637523
Conditional Flags
These flags are used to hold the result obtained by
ALU i.e., by arithmetical and logical operations. There
are six conditional flags:
Carry Flag(CF): If any arithmetic operation results
Conclusion
In this article we have gone through the types of
registers in 8086,we have gone through different
types of flags and gone their working in brief. As we
have already seen there are four types of registers in
8086 microprocessor named as General Purpose
Registers, Segment Registers, Special Purpose
Registers and Flag Register.
43