mpi 8086-88

Upload: hafsaasghar

Post on 02-Jun-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 MPI 8086-88

    1/18

    8086/8088 Microprocessors

    Registers and their role inmicroprocessor

  • 8/10/2019 MPI 8086-88

    2/18

    Overview and Basic functions ofRegisters

    Use of Register:Registers are used to store information

    temporarily.

  • 8/10/2019 MPI 8086-88

    3/18

  • 8/10/2019 MPI 8086-88

    4/18

    Division of registers:

    1. General purpose registers (8):

    Operands for logical and arithmetic operations Operands for address calculations Memory pointers

    2. Segment registers (6)

    3. EFLAGS register4. Instruction pointer register

  • 8/10/2019 MPI 8086-88

    5/18

    General purpose Registers

    There are four general registers that areAX,BX,CX and DX.

    Each Can be used as a whole 16 bit/word orcan be used as two 8 bit registers.

    On 8 bit half will known as upper half or AHand other half will known as lower half or AL.

  • 8/10/2019 MPI 8086-88

    6/18

    General Purpose Registers and theirfunctions in System

    AX (Accumulator) : favored by CPU forarithmetic operations

    BX (Base): can hold the address of a procedure or

    variable (SI, DI, and BP can also). Can alsoperform arithmetic and data movement. CX (count) : acts as a counter for repeating or

    looping instructions. DX (Data) : holds the high 16 bits of the product

    in multiply it also handles divide operations.

  • 8/10/2019 MPI 8086-88

    7/18

    General Purpose

    16-Bit and 8-Bit Registers

    AX

    BX

    DX

    CXAH AL

    15 8 7 0

    AX15 0

  • 8/10/2019 MPI 8086-88

    8/18

    Segment Registers

    It is used as base locations for program instructions, data andthe stack

    CS Code Segment holds base location for allexecutable instructions in a program

    SS - Base location of the stack DS Data Segment default base location for

    variables ES Extra Segment additional base location for

    memory variables.

  • 8/10/2019 MPI 8086-88

    9/18

    16-BitSegment Registers

    CS

    SS

    ES

    DS

    CS15 0

  • 8/10/2019 MPI 8086-88

    10/18

    Index Registers

    It is used to Speed up processing of strings, arrays,and other data structures containing multipleelements.

    SI Source Index Used in string movementinstructions. The source string is pointed to bythe SI register.

    DI Destination Index acts as thedestination for string movement instructions

  • 8/10/2019 MPI 8086-88

    11/18

    Pointer Registers

    It Contains the offset of data(variables, labels) andinstructions from its base segment.

    BP ( Base Pointer) :contains an assumed offset fromthe SS register. Often used by a subroutine to locatevariables that were passed on the stack by a callingprogram.

    SP (Stack Pointer):Contains the offset of the top ofthe stack.

  • 8/10/2019 MPI 8086-88

    12/18

    16-Bit Index & pointer

    Registers

    BP

    SP

    DI

    BP15 0SI

  • 8/10/2019 MPI 8086-88

    13/18

    16-Bit RegistersStatus and Control

    IP

    Flags

    IP15 0

  • 8/10/2019 MPI 8086-88

    14/18

    Status and Control Registers

    1. IP (Instruction Pointer): contains the offset ofthe next instruction to be executed.

    2. Flags Register :individual bit positions withinregister show status of CPU or results ofarithmetic operations.

    Control Flags (Direction, Interrupt, Trap)Status Flags (Carry, Overflow, Sign, Zero,Auxiliary Carry, Parity)

  • 8/10/2019 MPI 8086-88

    15/18

    Status Flags Carry (CF) set when the result of an unsigned

    arithmetic operation is too large to fit into thedestination.

    Overflow (OF) set when the result of a signed arithmetic operation is too wide to fit into thedestination.

    Sign (SF) set when the result of an arithmetic orlogical operation generates a negative result.

    Zero (ZF) set when the result of an arithmetic orlogical operation is zero.

  • 8/10/2019 MPI 8086-88

    16/18

    Status Flags

    Auxiliary Carry (AF) set when the result of anoperation causes a carry from bit 3 to bit 4.

    Parity (PF) reflects whether the number of 1bits in the result of an operation is even orodd. 1 odd, 0-even.

  • 8/10/2019 MPI 8086-88

    17/18

    Control Flags

    Interrupt (IF) dictates whether or not systeminterrupts can occur. 1 enabled, 0 disabled.

    Trap (TF) determines whether or not the CPUis halted after each instruction. Allowsprogrammers to do tracing.

    Direction (DF) affects block data transferinstructions such as MOVS, CMPS. 0 up, 1 down.

  • 8/10/2019 MPI 8086-88

    18/18

    Internal structure of Microprocessorsand registers orientation

    AH ALBH BLCH CLDH DL