8. Addressing Modes

Embed Size (px)

Citation preview

  • 8/9/2019 8. Addressing Modes

    1/14

    Engr. Nio E. Merencilla

  • 8/9/2019 8. Addressing Modes

    2/14

    Real Mode Operation

    It allows the microprocessor to

    address only the first 1 M byte ofmemory space.

    It also allows application softwarewritten for 8086/8088 and above

    to function in 80286 with out

    changing the software.

    Real memory it is also known as

    conventional memory system.

  • 8/9/2019 8. Addressing Modes

    3/14

    Segments and Offsets

    The combination of a segment

    address and an offset address isused to access a memory location

    in the real mode.

    Segment address located

    within one of the segment

    registers, defines the beginning

    address of any 64 K byte memory

    segment.

  • 8/9/2019 8. Addressing Modes

    4/14

    Offset address selects any

    location within 64K byte memorysegment. which sometimes called

    displacement segmentin thereal mode and always have a

    length of 64K byte.

  • 8/9/2019 8. Addressing Modes

    5/14

    Segment and Offset

    relationship

    Segment Offset Special Purpose

    CS IP Instruction address

    SS SP or BP Stack address

    DS BX, DI, SI Data address

    ES DI for stringinstructions

    String destinationaddress

  • 8/9/2019 8. Addressing Modes

    6/14

    Addressing Modes

    A structure of the different

    instruction used by themicroprocessor to execute the

    fetched instruction

  • 8/9/2019 8. Addressing Modes

    7/14

    Register addressing

    Transfer a copy of a byte or word

    from the source register to thedestination register.

    EX:

    MOV CX, DX

    The instruction copies the word-size contents

    of register DX to CX.

  • 8/9/2019 8. Addressing Modes

    8/14

    Immediate Addressing

    Transfers the source-immediate

    byte or word of data in thedestination register or memory

    location.EX:

    MOV AL, 22H

  • 8/9/2019 8. Addressing Modes

    9/14

    Direct Addressing

    Moves a byte or word between a

    memory location and a register.

    EX:

    MOV AL, VAR1

    The instruction copies the word-sized contents

    of memory location VAR1 into register.

  • 8/9/2019 8. Addressing Modes

    10/14

    Register Indirect Addressing

    Transfers a byte or word betweena register and a memory location

    addressed by an index or baseregister.

    The index and base registers are BP, BX, DI andSI

    EX:

    MOV AX, [BX]The instruction copies the word sized data

    from the data segment offset address indexedby the BX into the register AX.

  • 8/9/2019 8. Addressing Modes

    11/14

    Base-plus-index Addressing

    Transfers a byte or word between

    a register and a memory locationaddressed by a base register (BP

    or BX) plus index register (DI or SI)

    EX:

    MOV [BX + DI], CL

    It copies the byte size content of register CL to

    the Data segment location addressed by BX plus

    DI.

  • 8/9/2019 8. Addressing Modes

    12/14

    Register Relative Addressing

    Moves a byte or word between a

    register and a memory locationaddressed by an index or base

    register plus displacement.EX:

    MOV AX, [BX + 4]Loads AX from the data segment address

    formed by BX plus 4.

  • 8/9/2019 8. Addressing Modes

    13/14

    Base relative plus index

    Addressing Transfers a byte or word between

    a register and a memory locationaddressed by a base register andindex register plus a displacement

    EX:MOV AX, [BX + DI + Displacement]

    Similar to the base-plus-index addressing modebut it adds a displacement besides using a baseregister and index register

  • 8/9/2019 8. Addressing Modes

    14/14

    Endnd