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

Organization of The 8086/8088 Microprocessor: Lecture#6

The 8086/8088 microprocessor has several registers for storing data, addresses, and status information. The main data registers are the Accumulator (AX), Base (BX), Count (CX), and Data (DX) registers. It also has segment registers for the Code (CS), Stack (SS), Data (DS), and Extra (ES) segments. The Stack Pointer (SP) and Base Pointer (BP) store addresses, while the Source Index (SI) and Destination Index (DI) point to memory locations. The Flags register indicates the status of operations using flags like Carry, Zero, and Sign. The processor also uses an instruction queue to prefetch and speed up instruction execution.

Uploaded by

Asadullah Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
163 views

Organization of The 8086/8088 Microprocessor: Lecture#6

The 8086/8088 microprocessor has several registers for storing data, addresses, and status information. The main data registers are the Accumulator (AX), Base (BX), Count (CX), and Data (DX) registers. It also has segment registers for the Code (CS), Stack (SS), Data (DS), and Extra (ES) segments. The Stack Pointer (SP) and Base Pointer (BP) store addresses, while the Source Index (SI) and Destination Index (DI) point to memory locations. The Flags register indicates the status of operations using flags like Carry, Zero, and Sign. The processor also uses an instruction queue to prefetch and speed up instruction execution.

Uploaded by

Asadullah Khan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Organization Of The 8086/8088

Microprocessor

Lecture#6
Intel 8086 Microprocessor Organization
Registers

Fastest storage elements, A register is a very


small amount of very fast memory that is built
into the CPU.
16 bits

8 bits 8 bits

AH AL
AX Accumulator

BH BL Base
BX
CH CL Count
CX

DX
DH DL
Data
SP
Stack Pointer
Pointer
BP Base Pointer

SI
Source Index
Index
DI Destination
Index
Data Register: AX, BX, CX, DX

AX (Accumulator):
This is accumulator register. It gets used in
arithmetic, logic and data transfer instructions. In
manipulation and division.

BX (Base Register):
This is base register. BX register is an address
register. It usually contain a data pointer used for
based, based indexed or register indirect addressing.

 
CX (Count register):
This is Count register. This serves as a loop counter.
Program loop constructions are facilitated by it.
Count register can also be used as a counter in string
manipulation and shift/rotate instruction.

DX (Data Register):
This is data register. Data register can be used as a
port number in I/O operations. It is also used in
multiplication and division.

                       
Segment Register (CS, DS, SS, ES)

CS (Code Segment):

Code segment (CS) is a 16-bit register containing


address of 64 KB segment with processor
instructions. The processor uses CS segment for all
accesses to instructions referenced by instruction
pointer (IP) register. CS register cannot be changed
directly. The CS register is automatically updated
during far jump, far call and far return instructions.
 
           
Stack segment (SS):

Stack segment  is a 16-bit register containing address


of 64KB segment with program stack. The stack
segment register contains the initial address of the
stack segment. This address plus the value contained
in the stack pointer (SP) is used for stack operations.
SS register can be changed directly using POP
instruction.
Data segment (DS):

Data segment is a 16-bit register containing address


of 64KB segment with program data. By default, the
processor assumes that all data referenced by general
registers (AX, BX, CX, DX) and index register (SI,
DI) is located in the data segment. DS register can be
changed directly using POP instructions.
Extra Segment (ES):

Extra segment (ES) is a 16-bit register containing


address of 64KB segment, usually with program
data. By default, String instructions always use the
ES & DI registers to calculate the physical address
for the instruction. ES register can be changed
directly using POP instructions.
Pointer & Index Register (SP, BP, SI, DI)

SP (Stack Pointer): This is stack pointer register


pointing to program stack. It is used in conjunction
with SS for accessing the stack segment.
 
BP (Base Pointer): This is base pointer register
pointing to data in stack segment. Unlike SP, we can
use BP to access data in the other segments.
SI (Source Index): This is source index register
which is used to point to memory locations in the
data segment addressed by DS. By incrementing the
contents of SI one can easily access consecutive
memory locations.

DI (Destination Index): This is destination


index register performs the same function as SI.
There is a class of instructions called string
operations that use DI to access the memory
locations addressed by ES.
Flags Register

Flags Register determines the current state of the


processor. They are modified automatically by CPU
after mathematical operations, this allows to
determine the type of the result, and to determine
conditions to transfer control to other parts of the
program.
Types Of Flags
1. Status Flag
2. Control Flag
1. Carry Flag (CF):

This flag is set to 1 when there is an unsigned


overflow. For example when you add bytes 255 +
1 (result is not in range 0...255). When there is no
overflow this flag is set to 0. 

2. Parity Flag (PF):


This flag is set to 1 when there is even number of one
bits in result, and to 0when there is odd number of one
bits. 
3. Auxiliary Flag (AF)
This flag set to 1 when there is an unsigned
overflow for low nibble (4 bits). 

4. Zero Flag (ZF)


This flag set to 1 when result is zero. For non-zero
result this flag is set to 0. 

5. Sign Flag (SF)


This flag set to 1 when result is negative. When result
is positive it is set to 0. (This flag takes the value of
the most significant bit.)
6. Overflow Flag (OF)
This flag set to 1 when there is a signed overflow. For
example, when you add bytes 100 + 50 (result is not
in range -128...127).
1. Trap Flag (TF)
This Used for on-chip debugging. 

2. Interrupt enable Flag (IF)


when this flag is set to 1 CPU reacts to interrupts from
external devices. 

3. Direction Flag (DF)


This flag is used by some instructions to process data
chains, when this flag is set to 0 - the processing is
done forward, when this flag is set to 1 the processing
is done backward. 
Instruction Queue
BIU also contain an instruction queue. When the
EU executes instructions, the BIU gets up to 6
bytes of the next instruction and stores them in the
instruction queue and this process is called
instruction prefetch. This is a process to speed up
the processor.

You might also like