You are on page 1of 14

ASSEMBLY LANGUAGE

LECTURE:3

THE MICROPROCESSOR

DATA ADDRESSING
MODES

DATA ADDRESSING
MODES
MOV AX,BX
MOV= opcode
AX and BX = operand
different ways of specifying data are
called the data addressing modes

DATA ADDRESSING MODES

Register Addressing
Immediate Addressing
Direct Addressing
Register Indirect Addressing
Base plus Index Addressing
Register Relative Addressing
Base Relative Plus Index Addressing

Register Addressing Mode


The register addressing mode involves the use of registers to hold
The data to be manipulated. Memory is not accessed when this
addressing mode is executed
Examples:
MOV BX,DX ; copy the contents of DX into BX
MOV AX,BX ; copy the contents of AX into BX
ADD AL,BH ; add the contents of BX into AL
Note:
the source and destination register must match in size
Error Statement:
MOV CL,AX
Since the source is a 16 bit registers and destination is 8-bit
register.

Examples:
MOV
MOV
MOV
MOV
MOV
MOV

AL,BL
CH,CL
AX,CX
SP,BP
DS,AX
SI,DI

Immediate Addressing Mode


In the immediate addressing mode, the
source operand is constant. In the
immediate addressing mode, as the name
implies, when the instruction is
assembled, the operand comes
immediately after the opcode. For this
reason, this addressing mode can be used
to load information into any of the
registers except the segment register and
flag registers.

Examples:
MOV AX,2550H; move 2550H into AX
MOV CX,625 ; load decimal value 625 into CX
MOV BL,40H ; load 40H into BL
In case of data segment registers:
MOV AX,2550H
MOV DS,AX
In other words the following would produce an error:
MOV DS,0123H; illegal

EXAMPLES
MOV
MOV
MOV
MOV
MOV
MOV

AL,44
AX,44H
SI,0
CH,100
AL,A
AX,AB

Register direct Addressing


Mode
In register direct Addressing mode
the data is in some memory location
and the address of the data in
memory comes immediately after
the instruction.
MOV DL,[2400]

EXAMPLES

MOV AL,NUMBER
MOV AX,COW
MOV HOME,AX

PROBLEM:
Find the physical address of the
memory location and its content
after execution of the following.
Assuming DS:1512H
Mov AL,99H
MOV [3518],AL

SOLUTION:
First AL is initialized to 99H
Then the content of AL are moved to logical
address DS:3518
Shifting Ds left and adding it to the offset
gives the physical address of 18638H (15120h
+ 3518H= 18638H). That means after the
execution of the 2nd instruction, the memory
location with address 18638H will contain the
value 99h

PROBLEM:
Find the physical address of the
memory location and its content
after execution of the following.
Assuming DS:1012H
Mov AL,64H
MOV [4318],AL

You might also like