0% found this document useful (0 votes)
22 views

MP Assembly Language5

This document discusses the 7 types of addressing modes in assembly language: 1. Register addressing directly uses registers to access operands. 2. Immediate addressing uses constant values as operands. 3. Direct addressing uses an effective address to access memory locations based on the DS register and offset. 4. Indirect addressing uses registers like BX, BP, SI, or DI to determine the effective address instead of an offset. 5. Register relative addressing uses a displacement added to registers like BX or BP to calculate the effective address. 6. Register base-pulse relative addressing is similar but uses multiple registers and a displacement to determine the effective address.

Uploaded by

Reem Abed Zeidan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

MP Assembly Language5

This document discusses the 7 types of addressing modes in assembly language: 1. Register addressing directly uses registers to access operands. 2. Immediate addressing uses constant values as operands. 3. Direct addressing uses an effective address to access memory locations based on the DS register and offset. 4. Indirect addressing uses registers like BX, BP, SI, or DI to determine the effective address instead of an offset. 5. Register relative addressing uses a displacement added to registers like BX or BP to calculate the effective address. 6. Register base-pulse relative addressing is similar but uses multiple registers and a displacement to determine the effective address.

Uploaded by

Reem Abed Zeidan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 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