SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Assembly language Programming
 Low level language.
 Depends on computer architecture.
 Compiler converts high level language into machine language.
 Assembler converts the ALP into machine language.
 Machine language instructions contain only 0’s and 1’s.
 Assembly language contain Mnemonics.
 To study the behavior of particular architecture
Machine Language Assembly Language
B9 04 00 MOV CX,0004
B9 10 00 MOV CX,0010
Instructions
 An instruction is divided in to two fields.
 One field – Operation code (opcode)
 Another field – Operands
 An instruction contains an opcode and one or more operand
 Mostly instructions contain only one or two operand.
 Instruction size varies from 1 to 6 byte.
Assembly Language
MOV CX,0004
MOV  Op-code
0004,CX  Operands
ADD AX,BX
Opcode
Instruction
Operand
Addressing Modes
 The way in which operands are specified
 The operand may be mentioned directly or specified in register/memory.
 7 types of Data Addressing Mode.
Data Addressing Modes
 Immediate
 Direct
 Register
 Register Indirect
 Register Relative
 Based Indexed
 Relative Based Indexed
 One of the operand is mentioned directly.
 Data is available as a part of instruction.
 Data is 8 0r 16 bit long.
 No memory reference is needed to fetch data
Immediate Addressing Modes
Immediate Mode :Eg.
Example 1 : MOV CL, 03H
03 – 8 bit immediate source operand
CL – 8 bit register destination operand
Example 2: ADD AX, 0525H
0525 – 16 bit immediate source operand
AX – 16 bit register destination operand.
Register Addressing Mode
 Both the operands are in registers
 No memory access
 Limited number of registers
 Very small address field is needed to address registers.
 Shorter instructions
Register Address
ES 00
CS 01
SS 10
DS 11
Example
Examples : 16 bit register instruction
MOV AX,BX
ADD AX,DI
8 bit register instructions
MOV CL,DL
ADD AL,CL
Direct addressing Modes
 One or both the operands are in memory.
 Operand in memory is specified through its effective address.
 Default Segment register – DS
 Data in that location will be used for specified operation.
 If the instruction contain stack operation, segment register will
be SS.
Example
MOV CX, [0400]
[DS] = 3050
PA : 30500+0400 = 30540.
[30540]  CL
[30541] CH
Register indirect Mode
 EA of operand(s) is/are specified in register.
 Physical address is computed using segment register and EA .
 Data in the physical address is an operand
Example
 Example 1 : MOV AX, [BX]
[DS] = 5004, [BX] = 0020, PA=50060.
50060 contain 0015H
0015H is moved to memory AX
 Example 2: MOV [BX],[AX]
Source and destination address is calculated by AX and BX content
respectively .
Then content of source address is moved to destination address
Register Relative
 Effective address = [ Base/pointer register] + 8 or 16 bit
displacement
 Base/Pointer register : BX or BP or SI or DI
Example
 MOV AX, 10[BP]
 [BP] = 0105 , [DS] = 2020
 P.A = 20200 + 0105 + 10 = 20315
 Content of memory address 20315 is moved to AX
Based Indexed MODE
 Effective address = [Base register] + [Index register]
 Base register  BX or BP
 Index register  SI or DI
Example
 MOV AX,[BX][SI]
[BX] = 1500 [SI] = 0020 [DS] = 2020
P.A of source : 20200 + 1500 + 0020 = 21720
Content of 21720 is moved to AX
Relative Based Indexed
 Effective address = [Base register] + [Index register]
+ 8 or 16 bit displacement
Example
1. MOV CX,1010[BX][SI]
[BX] = 102B [SI] = 0003 [DS] = 2020
PA = 20200 + 102B + 0008 + 1010 = 2223E
Content of memory address 2223E is moved to CX
2.MOV 1010[BX][SI], CX
Which Mode is fastest? Why?
 Register addressing mode
 Direct addressing modes require more bits to represent address of operand
 Memory reference require 20 bits
 Limited number of registers
 Very small address field needed
 Shorter instructions
 Faster instruction fetch
 Register reference require only 2 or 3 bits .
Problem
Given that
[BP] = 5000 [SI] = 0005 [DI]=0100 [DS] = 1000
[6000] = 520A [6005] = 5402 [6100] = 0003 [6015]=065B
[6110] = 003E
[5000] = 5505 [5100] = FB05 [5005] = 060B
After the following instructions are executed, What will be the value
of registers AX,BX,CX,DX ? DS is a segment register for all instructions.
MOV AX,[BP]
MOV DX, [5100]
MOV BX,5[BP]
MOV CX,[BP][DI]
ALP Program
MOV AX,4343
MOV BX,1111
ADD AX,BX
MOV [2000H],AX
HLT
Note:
HLT – Halt the process.
Indicate end of the program
ALP for different addressing modes
 Immediate mode
MOV AX, 200
ADD AX,300
MOV [2000],AX
HLT
 Register mode
MOV BX,500
MOV AX,200
ADD AX,BX
MOV [5000],AX
HLT
 Direct mode
MOV AX,[5000]
ADD AX,[5002]
MOV AX,[5004]
HLT
 Register indirect mode
MOV BX,5000
MOV DX, 5002
ADD [DX],[BX]
MOV [5004],AX
HLT
Register Relative mode
MOV BX,4990
MOV AX,300
ADD AX,10[BX]
MOV [5002],AX
HLT
Based indexed mode
MOV AX,300
MOV BX,5000
MOV SI,5
ADD AX,[BX][SI]
MOV [5002],AX
HLT
 Relative Based indexed
MOV BX,5000
MOV SI,5
MOV CX,5[BX][SI]
MOV AX,300
ADD AX,CX
MOV [5012],AX
HLT
Steps
 Menu display – A,D,F,I,M,P,T,U
 Enter A - Assembly
 Enter program
 Menu display – D input location
 Input data in memory
 Execute using Go command
 Menu display – D output location

Weitere ähnliche Inhalte

Was ist angesagt?

Computer registers
Computer registersComputer registers
Computer registersDeepikaT13
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formatsMazin Alwaaly
 
Register transfer language & its micro operations
Register transfer language & its micro operationsRegister transfer language & its micro operations
Register transfer language & its micro operationsLakshya Sharma
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly languageAhmed M. Abed
 
memory reference instruction
memory reference instructionmemory reference instruction
memory reference instructionDeepikaT13
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operationNikhil Pandit
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and ArchitectureVinit Raut
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference InstructionsRabin BK
 
Stack and its usage in assembly language
Stack and its usage in assembly language Stack and its usage in assembly language
Stack and its usage in assembly language Usman Bin Saad
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer ArchitectureHaris456
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086Dr. AISHWARYA N
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulationSanjeev Patel
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction FormatDhrumil Panchal
 

Was ist angesagt? (20)

Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Computer registers
Computer registersComputer registers
Computer registers
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
Computer architecture addressing modes and formats
Computer architecture addressing modes and formatsComputer architecture addressing modes and formats
Computer architecture addressing modes and formats
 
Register transfer language & its micro operations
Register transfer language & its micro operationsRegister transfer language & its micro operations
Register transfer language & its micro operations
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
 
memory reference instruction
memory reference instructionmemory reference instruction
memory reference instruction
 
Microoperations
MicrooperationsMicrooperations
Microoperations
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and Architecture
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Stack and its usage in assembly language
Stack and its usage in assembly language Stack and its usage in assembly language
Stack and its usage in assembly language
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer Architecture
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Addressing modes of 8086
Addressing modes of 8086Addressing modes of 8086
Addressing modes of 8086
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
Instruction formats-in-8086
Instruction formats-in-8086Instruction formats-in-8086
Instruction formats-in-8086
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction Format
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 

Andere mochten auch (12)

ADDRESSING MODE
ADDRESSING MODEADDRESSING MODE
ADDRESSING MODE
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
 
11 instruction sets addressing modes
11  instruction sets addressing modes 11  instruction sets addressing modes
11 instruction sets addressing modes
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Addressing mode
Addressing modeAddressing mode
Addressing mode
 
Addressing mode
Addressing mode Addressing mode
Addressing mode
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
 
8051 Addressing modes
8051 Addressing modes8051 Addressing modes
8051 Addressing modes
 
Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085
 
Addressing modes of 8051
Addressing modes of 8051Addressing modes of 8051
Addressing modes of 8051
 
List of 8085 programs
List of 8085 programsList of 8085 programs
List of 8085 programs
 

Ähnlich wie Addressing modes

8086 instruction set (with simulator)
8086 instruction set (with simulator)8086 instruction set (with simulator)
8086 instruction set (with simulator)Aswini Dharmaraj
 
Addressing mode of 80286 microprocessor
Addressing mode of 80286 microprocessorAddressing mode of 80286 microprocessor
Addressing mode of 80286 microprocessorpal bhumit
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGFrankie Jones
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086sravanithonta79
 
addressing-modes-of-8086-mr-binu-joy-2 (2).pptx
addressing-modes-of-8086-mr-binu-joy-2 (2).pptxaddressing-modes-of-8086-mr-binu-joy-2 (2).pptx
addressing-modes-of-8086-mr-binu-joy-2 (2).pptxDr.MUTHURAJ BOSE
 
8086 microprocessor pptx JNTUH ece 3rd year
8086 microprocessor pptx JNTUH ece 3rd year8086 microprocessor pptx JNTUH ece 3rd year
8086 microprocessor pptx JNTUH ece 3rd yearBharghavteja1
 
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptxLecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptxVikasMahor3
 
Notes 8086 instruction format
Notes 8086 instruction formatNotes 8086 instruction format
Notes 8086 instruction formatHarshitParkar6677
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Bilal Amjad
 
All-addressing-modes of the 80386 /microprocessor.pptx
All-addressing-modes of the 80386 /microprocessor.pptxAll-addressing-modes of the 80386 /microprocessor.pptx
All-addressing-modes of the 80386 /microprocessor.pptxVidyaAshokNemade
 
02 Addressing Modes.pptx
02 Addressing Modes.pptx02 Addressing Modes.pptx
02 Addressing Modes.pptxssuser586772
 
Assembly programming 8085/8086 microprocessors
Assembly programming 8085/8086 microprocessorsAssembly programming 8085/8086 microprocessors
Assembly programming 8085/8086 microprocessorsFazalHameed14
 
8086 Register organization and Architecture details
8086 Register organization and Architecture details8086 Register organization and Architecture details
8086 Register organization and Architecture detailsMahendraMunirathnam1
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language BasicsEducation Front
 

Ähnlich wie Addressing modes (20)

8086 instruction set (with simulator)
8086 instruction set (with simulator)8086 instruction set (with simulator)
8086 instruction set (with simulator)
 
Addressing mode of 80286 microprocessor
Addressing mode of 80286 microprocessorAddressing mode of 80286 microprocessor
Addressing mode of 80286 microprocessor
 
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMINGChapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
 
Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086Mastering Assembly Language: Programming with 8086
Mastering Assembly Language: Programming with 8086
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
addressing-modes-of-8086-mr-binu-joy-2 (2).pptx
addressing-modes-of-8086-mr-binu-joy-2 (2).pptxaddressing-modes-of-8086-mr-binu-joy-2 (2).pptx
addressing-modes-of-8086-mr-binu-joy-2 (2).pptx
 
8086 microprocessor pptx JNTUH ece 3rd year
8086 microprocessor pptx JNTUH ece 3rd year8086 microprocessor pptx JNTUH ece 3rd year
8086 microprocessor pptx JNTUH ece 3rd year
 
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptxLecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
 
Notes 8086 instruction format
Notes 8086 instruction formatNotes 8086 instruction format
Notes 8086 instruction format
 
8086 add mod
8086 add mod8086 add mod
8086 add mod
 
8086 Instruction set
8086 Instruction set8086 Instruction set
8086 Instruction set
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
All-addressing-modes of the 80386 /microprocessor.pptx
All-addressing-modes of the 80386 /microprocessor.pptxAll-addressing-modes of the 80386 /microprocessor.pptx
All-addressing-modes of the 80386 /microprocessor.pptx
 
02 Addressing Modes.pptx
02 Addressing Modes.pptx02 Addressing Modes.pptx
02 Addressing Modes.pptx
 
Assembly programming 8085/8086 microprocessors
Assembly programming 8085/8086 microprocessorsAssembly programming 8085/8086 microprocessors
Assembly programming 8085/8086 microprocessors
 
Addressing modes
Addressing  modesAddressing  modes
Addressing modes
 
Addressingmodes
Addressingmodes Addressingmodes
Addressingmodes
 
Addressing modes
Addressing  modesAddressing  modes
Addressing modes
 
8086 Register organization and Architecture details
8086 Register organization and Architecture details8086 Register organization and Architecture details
8086 Register organization and Architecture details
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 

Kürzlich hochgeladen

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 

Kürzlich hochgeladen (20)

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 

Addressing modes

  • 1.
  • 2. Assembly language Programming  Low level language.  Depends on computer architecture.  Compiler converts high level language into machine language.  Assembler converts the ALP into machine language.  Machine language instructions contain only 0’s and 1’s.  Assembly language contain Mnemonics.  To study the behavior of particular architecture Machine Language Assembly Language B9 04 00 MOV CX,0004 B9 10 00 MOV CX,0010
  • 3. Instructions  An instruction is divided in to two fields.  One field – Operation code (opcode)  Another field – Operands  An instruction contains an opcode and one or more operand  Mostly instructions contain only one or two operand.  Instruction size varies from 1 to 6 byte. Assembly Language MOV CX,0004 MOV  Op-code 0004,CX  Operands ADD AX,BX Opcode Instruction Operand
  • 4. Addressing Modes  The way in which operands are specified  The operand may be mentioned directly or specified in register/memory.  7 types of Data Addressing Mode.
  • 5. Data Addressing Modes  Immediate  Direct  Register  Register Indirect  Register Relative  Based Indexed  Relative Based Indexed
  • 6.  One of the operand is mentioned directly.  Data is available as a part of instruction.  Data is 8 0r 16 bit long.  No memory reference is needed to fetch data Immediate Addressing Modes
  • 7. Immediate Mode :Eg. Example 1 : MOV CL, 03H 03 – 8 bit immediate source operand CL – 8 bit register destination operand Example 2: ADD AX, 0525H 0525 – 16 bit immediate source operand AX – 16 bit register destination operand.
  • 8. Register Addressing Mode  Both the operands are in registers  No memory access  Limited number of registers  Very small address field is needed to address registers.  Shorter instructions Register Address ES 00 CS 01 SS 10 DS 11
  • 9. Example Examples : 16 bit register instruction MOV AX,BX ADD AX,DI 8 bit register instructions MOV CL,DL ADD AL,CL
  • 10. Direct addressing Modes  One or both the operands are in memory.  Operand in memory is specified through its effective address.  Default Segment register – DS  Data in that location will be used for specified operation.  If the instruction contain stack operation, segment register will be SS.
  • 11. Example MOV CX, [0400] [DS] = 3050 PA : 30500+0400 = 30540. [30540]  CL [30541] CH
  • 12. Register indirect Mode  EA of operand(s) is/are specified in register.  Physical address is computed using segment register and EA .  Data in the physical address is an operand
  • 13. Example  Example 1 : MOV AX, [BX] [DS] = 5004, [BX] = 0020, PA=50060. 50060 contain 0015H 0015H is moved to memory AX  Example 2: MOV [BX],[AX] Source and destination address is calculated by AX and BX content respectively . Then content of source address is moved to destination address
  • 14. Register Relative  Effective address = [ Base/pointer register] + 8 or 16 bit displacement  Base/Pointer register : BX or BP or SI or DI
  • 15. Example  MOV AX, 10[BP]  [BP] = 0105 , [DS] = 2020  P.A = 20200 + 0105 + 10 = 20315  Content of memory address 20315 is moved to AX
  • 16. Based Indexed MODE  Effective address = [Base register] + [Index register]  Base register  BX or BP  Index register  SI or DI
  • 17. Example  MOV AX,[BX][SI] [BX] = 1500 [SI] = 0020 [DS] = 2020 P.A of source : 20200 + 1500 + 0020 = 21720 Content of 21720 is moved to AX
  • 18. Relative Based Indexed  Effective address = [Base register] + [Index register] + 8 or 16 bit displacement
  • 19. Example 1. MOV CX,1010[BX][SI] [BX] = 102B [SI] = 0003 [DS] = 2020 PA = 20200 + 102B + 0008 + 1010 = 2223E Content of memory address 2223E is moved to CX 2.MOV 1010[BX][SI], CX
  • 20. Which Mode is fastest? Why?  Register addressing mode  Direct addressing modes require more bits to represent address of operand  Memory reference require 20 bits  Limited number of registers  Very small address field needed  Shorter instructions  Faster instruction fetch  Register reference require only 2 or 3 bits .
  • 21. Problem Given that [BP] = 5000 [SI] = 0005 [DI]=0100 [DS] = 1000 [6000] = 520A [6005] = 5402 [6100] = 0003 [6015]=065B [6110] = 003E [5000] = 5505 [5100] = FB05 [5005] = 060B After the following instructions are executed, What will be the value of registers AX,BX,CX,DX ? DS is a segment register for all instructions. MOV AX,[BP] MOV DX, [5100] MOV BX,5[BP] MOV CX,[BP][DI]
  • 22. ALP Program MOV AX,4343 MOV BX,1111 ADD AX,BX MOV [2000H],AX HLT Note: HLT – Halt the process. Indicate end of the program
  • 23. ALP for different addressing modes  Immediate mode MOV AX, 200 ADD AX,300 MOV [2000],AX HLT  Register mode MOV BX,500 MOV AX,200 ADD AX,BX MOV [5000],AX HLT
  • 24.  Direct mode MOV AX,[5000] ADD AX,[5002] MOV AX,[5004] HLT  Register indirect mode MOV BX,5000 MOV DX, 5002 ADD [DX],[BX] MOV [5004],AX HLT
  • 25. Register Relative mode MOV BX,4990 MOV AX,300 ADD AX,10[BX] MOV [5002],AX HLT Based indexed mode MOV AX,300 MOV BX,5000 MOV SI,5 ADD AX,[BX][SI] MOV [5002],AX HLT
  • 26.  Relative Based indexed MOV BX,5000 MOV SI,5 MOV CX,5[BX][SI] MOV AX,300 ADD AX,CX MOV [5012],AX HLT
  • 27. Steps  Menu display – A,D,F,I,M,P,T,U  Enter A - Assembly  Enter program  Menu display – D input location  Input data in memory  Execute using Go command  Menu display – D output location