Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views15 pages

Addressing Mode

Uploaded by

sangam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views15 pages

Addressing Mode

Uploaded by

sangam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Addressing Mode

Introduction

THE FUNDAMENTAL DATA TYPES OF THE INTEL


ARCHITECTURE ARE
BYTES, WORDS, AND DOUBLEWORDS,
QUADWORDS.
BYTE: 8 BITS = 1 BYTE
WORD: 2 BYTES = 16 BITS
DOUBLE WORD: 4 BYTES = 32 BITS
QUAD WORD: 8 BYTES = 64 BITS
Fundamental Data Types in
Memory
Specifying an Offset

THE OFFSET PART OF A MEMORY ADDRESS CAN BE


SPECIFIED EITHER DIRECTLY AS AN STATIC VALUE OR
THROUGH AN ADDRESS COMPUTATION MADE UP OF ONE
OR MORE OF THE FOLLOWING COMPONENTS:

• DISPLACEMENT—AN 8-, 16-BIT VALUE.


• BASE—THE VALUE IN A GENERAL-PURPOSE REGISTER.
• INDEX—THE VALUE IN A GENERAL-PURPOSE REGISTER.
DEPEND ON THE EQUATION BELOW:

[ ][ ]
𝑂𝐹𝐹𝑆𝐸𝑇 = 𝐵𝑋 ± 𝑆𝐼 ± 𝐷𝐼𝑆𝑃𝐿𝐴𝐶𝐸𝑀𝐸𝑁𝑇
𝐵𝑃 𝐷𝐼
Examples

Instruction Description
MOV AL, [0123H] COPY THE CONTENT OF MEMORY LOCATION 0123H TO AL

MOV AL, [BX] COPY THE CONTENT OF MEMORY LOCATION 1000H TO AL

MOV AL, [SI] COPY THE CONTENT OF MEMORY LOCATION 100H TO AL

MOV AL, [BX+22H] COPY THE CONTENT OF MEMORY LOCATION 1022H TO AL

MOV AL, [BP+DI] COPY THE CONTENT OF MEMORY LOCATION 2200H TO AL

MOV AL, [BX+DI+30H] COPY THE CONTENT OF MEMORY LOCATION 1230H TO AL

LET: BX =1000H, BP=2000H, SI= 100H, DI=200H,


DATA-ADDRESSING MODES

SOFTWARE DEVELOPMENT FOR THE MICROPROCESSOR


REQUIRES A COMPLETE FAMILIARITY WITH THE
ADDRESSING MODES EMPLOYED BY EACH INSTRUCTION.

WE USED THE MOV INSTRUCTION TO DESCRIBE THE DATA-


ADDRESSING MODES.

NOTE THAT MEMORY-TO-MEMORY TRANSFERS ARE NOT


ALLOWED BY ANY INSTRUCTION.
Register addressing
Register addressing transfers a copy of a MOV REG. , REG.
byte or word from the source to the Source
destination register. Destination

INSTRUCTION DISCRIPTION
MOV AL, BL Copy The Content Of BL Into AL
MOV AX, BX Copy The Content Of BX Into AX
MOV CX, SI Copy The Content Of CX Into SI
MOV BP, DX Copy The Content Of DX Into BP
Immediate addressing
Immediate addressing transfers the source MOV REG. Immi.
, Value
( an immediate byte, word of data ) into the
Source
destination register. Destination

INSTRUCTION DISCRIPTION
MOV AL, Transfers Binary Number 01010011 Into AL
01010011B
MOV AX, 5F12H Transfers Hexadecimal Number 5F12 Into AX
MOV CX, 1980 Transfers Decimal Number 1980 Into CX
MOV BP, 374O Transfers Octal Number 374 Into BP
MOV AL, ‘A’ Transfers ASCII CODE ‘A’ Into AL
Direct Data Addressing
Direct Data Addressing transfers a byte or MOV REG. , [Value]
MOV [Value] REG.
word from or into the content of memory
specified by direct address. Source
Destination

INSTRUCTION DISCRIPTION
MOV AL, Copy The Content Of Memory Location 0123H Into AL
[0123H]
MOV AX, Copy The Content Of Memory Location 0123H Into AX
[0123H]
MOV [1000H], Copy The Content Of DL into the content of Memory Location
DL 1000H
MOV [1000H], Copy The Content Of DX into the content of Memory Location
DX 1000H
Register Indirect Addressing
Register indirect addressing allows data to be MOV REG. , [REG.]
addressed at any memory location through an MOV [REG.] REG.
offset address held in any of the following registers:
Source
BP, BX, DI, SI Destination

INSTRUCTIO DISCRIPTION
N
MOV AL, [BX] Copy The Content Of Memory Location at the address [BX] Into
AL
MOV AX, [SI] Copy The Content Of Memory Location at the address [SI] Into AX
MOV [DI], DL Copy The Content Of DL into the content of Memory Location [DI]
MOV [BP], DX Copy The Content Of DX into the content of Memory Location [BP]
Base-Plus-Index Addressing
Base-plus-index addressing is similar to indirect MO REG. , [REG.
addressing because it indirectly addresses V [REG. ±REG.]
MO ±REG.] REG.
memory data. In the 8086, this type of addressing V
uses one base register (BP or BX) and one index Source
register (DI or SI) to indirectly address memory. Destination

INSTRUCTION Addressing Mode Type


MOV AL, [BX] Base Addressing Mode
MOV AX, [SI] Index Addressing Mode
MOV [DI], DL Index Addressing Mode
MOV [BP], DX Base Addressing Mode
MOV DL, [BX+SI] Base Index Addressing Mode
MOV [BP-DI], CL Base index Addressing Mode
Register relative addressing
Register relative addressing is similar to base- MO REG. , [REG. ± Val.]
plus-index addressing with displacement. The V [REG. ± Val.] REG.
MO
data in a segment of memory are addressed by V
adding the displacement to the contents of a base Source
or an index register (BP, BX, DI, or SI). Destination

INSTRUCTION Addressing Mode Type


MOV AL, [BX+9] Base Relative Addressing Mode
MOV AX, [SI-5] Index Relative Addressing Mode
MOV CX, Base Index Relative Addressing Mode
[BP+DI+04H]
MOV [BP+12], DX Base Relative Addressing Mode
MOV DL, [SI+40] Index Relative Addressing Mode
MOV [BX-DI+8H], AL Base Index Relative Addressing Mode
EXAMPLES
Write the addressing mode for all the following
instructions :

INSTRUCTION Addressing Mode Type


MOV AL, BL Register Addressing Mode
MOV AX, 65D3H Immediate Addressing Mode
MOV CX, [0564H] Direct Addressing Mode
MOV [BX+SI], DX Base Index Addressing Mode / Register Indirect Addressing
MOV DX, [SI+40] Index Relative Addressing Mode/Register Indirect Addressing
MOV [DI-SI+8H], Base Index Relative Addressing Mode/Register Indirect
AX Addressing
EXAMPLES
Write the addressing mode for all the following
instructions :

INSTRUCTION Addressing Mode Type


MOV AX, 0231H Immediate Addressing Mode
MOV AX, [65D3H] Direct Addressing Mode
MOV CX, [BP+DI] Base Index Addressing Mode / Register Indirect Addressing
MOV [BX+SI-18], Base Index Relative Addressing Mode / Register Indirect
DX Addressing
MOV DX, [DI+26] Index Relative Addressing Mode/Register Indirect Addressing
MOV DI, AX Register Addressing Mode/Register Indirect Addressing
THE END

You might also like