2[1].Registers

Embed Size (px)

Citation preview

  • 8/3/2019 2[1].Registers

    1/17

    8086 Processors

    An Introduction

  • 8/3/2019 2[1].Registers

    2/17

    Limitations of 8-bit Processors

    Low speed

    Low memory addressing

    capabilityLimited number of registers

    Less powerful instruction set

  • 8/3/2019 2[1].Registers

    3/17

    8086 Processors

    Advanced architecture

    More processing capabilities

    Larger memory addressing capability

    Powerful instruction set

    Improved speed

  • 8/3/2019 2[1].Registers

    4/17

    Register Organization of

    8086

    Module-1

  • 8/3/2019 2[1].Registers

    5/17

    AH AL

    BH BL

    CH CL

    DH

    SP

    DL

    BP

    SIDI Flags

    IP

    DS

    CS

    Memory address & data bus interface

    Internal data bus

    Adder

    InstructionByte

    queue

    Control Unit

    Bus

    Interface

    Unit

    Execution

    Unit

    Internal data bus

    SS

    ES

    ALU

  • 8/3/2019 2[1].Registers

    6/17

    Registers in 8086 CPU

  • 8/3/2019 2[1].Registers

    7/17

    8086 Registers

    General purpose registers

    Special purpose registers

  • 8/3/2019 2[1].Registers

    8/17

    General purpose registers

    AH AL

    BH

    CH

    DH DL

    BL

    CL

    AX

    BX

    CX

    DX

    16-bit registers

    Uses

    Holds data & variables

    intermediate results

    Counter

    Stores offset addressStores port address

  • 8/3/2019 2[1].Registers

    9/17

    Continued

    Register Use

    AXUsed as 8-bit accumulator & in instructions that

    access I/O ports

    BXUsed as offset storage for forming physical

    addresses

    CXUsed as default counter in case of string & loop

    instructions

    DX Used to hold I/O address during I/O operations

  • 8/3/2019 2[1].Registers

    10/17

    Special purpose registers

    Used as:-

    Segment registers

    Pointers

    Index registers

  • 8/3/2019 2[1].Registers

    11/17

    Segment registers

    Code segment register

    Data segment register

    Extra segment register

    Stack segment register

    Uses

    stores 16-bit segment base

    address which is used forcalculating physical address

    CS

    SS

    DS

    ES

  • 8/3/2019 2[1].Registers

    12/17

    Continued

    Register Use

    CS

    Addresses a memory location in the code

    segment of memory where executable programis stored

    DSPoints to data segment of memory where data

    resides

    ESRefers to a segments which is another data

    segment of memory

    SSUsed to address memory which is used for

    storing stack data

  • 8/3/2019 2[1].Registers

    13/17

    Pointers & Index Registers

    IP- Instruction pointer

    SP-Stack pointer

    BP-Base pointer

    SI-Source index

    DI-Destination index

    B

    P

    SI

    DI

    IP

    SP

  • 8/3/2019 2[1].Registers

    14/17

    Continued

    Register Use

    IPstore the memory location of the next instruction

    to be executed.

    SPContains the offset of the address that lies in the

    stack segment

    BP Base register used for accessing the stack

    SI Store offset of source data in data segment

    DIStore offset of destination data in data or extra

    segment

  • 8/3/2019 2[1].Registers

    15/17

    Flag Registers

    Indicates results of computation in ALU

    16-bit flag register

    Condition code or status flags

    Machine control flags

    X X X X OD

    I T S Z X Ac X P XC

    y

    15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

  • 8/3/2019 2[1].Registers

    16/17

    ContinuedFlag Use

    S Set when result of any computation is negative

    Z Set if result of any computation or comparison is 0

    P Set if lower byte of result contains even number of 1s

    CySet when there is a carry out of MSB in case ofaddition and borrow in case of subtraction

    TIf set to 1 the processor enters the single step

    execution mode

    Iwhen this flag is set to 1 CPU reacts to interrupts

    from external devices

    DUsed by string manipulation instructions. If set string

    is processed in the auto decrementing mode

    AcSet if there is a carry out of bit 3 during addition or a

    borrow by bit 3 during subtraction (BCD arithmetic)

    O Set if an overflow occurs

  • 8/3/2019 2[1].Registers

    17/17

    Thank You!