You are on page 1of 10

MP & Assembly language

Lecture No(5)
Addressing Mode
• Addressing mode mean way in which an
operands is specified in Memory Location
• There are 7 type of addressing mode can be
Calculate by Assembly language to Reach
memory location
Register Addressing Mode
• Register Addressing or Direct Addressing
(Stored In Register Directly)
Ex : Mov ax,bx
Immediate Addressing Mode
• Immediate operands represent constant value
Mov al,12h
Mov ax,1234h
Note : Don’t forget Same Size
Direct Addressing Mode
• The Location for source is EA(Effective memory Address)
• Don’t forget EA is 16 bit offset of storage specified by current
value in DS
Ex: Mov cl,[2000h]
If Ds =1000h
value of source operand not stored in 2000h but In
PA = DS*10H+ offset
=1000h*10h+2000h
= 12000h
Means the value of cl is stored in [12000h] memory location
Indirect Addressing Mode
• Same to Direct Addressing but EA deal with BX,BP OR SI,DI
Ex: Mov AX,[Bx] --->Note: location of Bx not Bx
If Ds =1000h ,Bx=1234h
PA = DS*10H+ offset
=1000h*10h+1234h
= 11234h
Means the value of
Al -------->[11234h]
Ah ------[11235h]
Ex-2-: Mov AX,[SI] --->Note location of SI not SI
If Ds =1000h
PA = DS*10H+ offset OF SI

Ex-3-: Mov AX,[BP] --->Note BP deals with SS


PA = SS*10H+ offset OF BP
Register Relative Addressing Mode
(Base Addressing)
• Deal with Displacement to BX or BP
Ex: Mov AX,[Bx+1000h] --->Note BX with Ds
If Ds =1000h ,Bx=1234h
PA = DS*10H+ offset + Displacement
=1000h*10h+1234h+1000h
= 12234h
Mean value of
Al -------->[12234h]
Ah ------[12235h]
Ex-2-: Mov Al,[BX]+BETA --->
If Ds =1000h
PA = DS*10H+ offset OF BX+ BETA

Ex-3-: Mov AX,[BP+200h]--->Note BP deals with SS


PA = SS*10H+ offset OF BP+ Displacement
Register Base - Pulse Relative Addressing Mode

• same as Base - Pulse Relative Addressing Mode with


Displacement
Ex: Mov AX,[ BX + SI+1000h ]
PA = DS*10H+ BX+ SI + Displacement

Ex2: Mov [ BX + DI+1000h ],SP


[ DS*10H+ BX+SI+1000h]SP

You might also like