1 addressing modes
DESCRIPTION
xcvTRANSCRIPT
![Page 1: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/1.jpg)
Microprocessor and InterfacesMicroprocessor and Interfaces
8085 addressing modes
![Page 2: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/2.jpg)
Addressing modesAddressing modes• Each instruction of a computer specifies an operation on certain data
• In each instruction, programmer has to specify 3 things:things:– Operation to be performed– Address of source of dataAdd f d ti ti f lt– Address of destination of result
• There are various ways of specifying address of the data to be operated on
• These different ways of specifying data are called the addressing modes
![Page 3: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/3.jpg)
Common addressing modesCommon addressing modes
• Immediate addressing modeImmediate addressing mode• Direct addressing mode
di dd i d• Indirect addressing mode• Register addressing mode• Register indirect addressing mode• Implicit addressing modeImplicit addressing mode
![Page 4: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/4.jpg)
Immediate AddressingImmediate Addressing
• Simplest addressing modeS p est add ess g ode• Operand is given in the instruction itself• Used to define a constant or set initial values ofUsed to define a constant or set initial values of variables
• No memory reference other than instruction yfetch is required to obtain operand
• Size of the number is limited to the size of the address field, which for most instruction sets is small compared to word length
![Page 5: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/5.jpg)
Immediate addressing exampleImmediate addressing example
• MVI A 05 H :: Move 05 H in accumulatorMVI A, 05 H :: Move 05 H in accumulator– MVI is the operation05 H is the immediate data (source)– 05 H is the immediate data (source)
– A is the destination
![Page 6: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/6.jpg)
Direct AddressingDirect Addressing
• Effective address of the operand is given in the ect e add ess o t e ope a d s g e t eaddress field of the instruction
• Requires one memory reference to read the q yoperand from the given location
• Provides only a limited address space• Length of the address field is usually less than the word length
![Page 7: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/7.jpg)
Direct addressing exampleDirect addressing example
• LDA 2500 H :: Load the contents of memoryLDA 2500 H :: Load the contents of memory location 2500 H in accumulator – LDA is the operation– LDA is the operation– 2500 H is the address of sourceAccumulator is the destination– Accumulator is the destination
![Page 8: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/8.jpg)
Indirect AddressingIndirect Addressing
• The address field of the instruction refers to the e add ess e d o t e st uct o e e s to t eaddress of a word in memory, which in turn contains the full length address of the operand
• Advantage ‐ For the word length of N, an address space of 2N can be addressed
• Disadvantage ‐ Instruction execution requires two memory reference to fetch the operandM ltil l d d i di t dd i• Multilevel or cascaded indirect addressing can also be used
![Page 9: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/9.jpg)
Register AddressingRegister Addressing
• Similar to direct addressingSimilar to direct addressing• Only difference is that the address field of the instruction refers to a register rather than ainstruction refers to a register rather than a memory location
• 3 or 4 bits are used as address field to3 or 4 bits are used as address field to reference 8 to 16 general purpose registers
• Advantage :: Small address field is needed inAdvantage :: Small address field is needed in the instruction
![Page 10: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/10.jpg)
Register addressing exampleRegister addressing example
• MOV A B :: Move the contents of register B toMOV A, B :: Move the contents of register B to A– MOV is the operation– MOV is the operation– B is the source of dataA is the destination– A is the destination
![Page 11: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/11.jpg)
Register Indirect AddressingRegister Indirect Addressing
• Similar to indirect addressingS a to d ect add ess g• The address field of the instruction refers to a registerg
• The register contains the effective address of the operand
• Uses one memory reference to obtain the operand
• The address space is limited to the width of the registers available to store the effective address
![Page 12: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/12.jpg)
Register indirect addressing exampleRegister indirect addressing example
• MOV A M :: Move data from memory locationMOV A, M :: Move data from memory location specified by H‐L pair to accumulator– MOV is the operation– MOV is the operation– M is the memory location specified by H‐L register pairpair
– A is the destination
![Page 13: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/13.jpg)
Implicit AddressingImplicit Addressing
• Address of source of data as well as address ofAddress of source of data as well as address of destination of result is fixed
• There is no need to give any operand along• There is no need to give any operand along with the instruction
![Page 14: 1 Addressing Modes](https://reader036.vdocuments.site/reader036/viewer/2022081211/55cf926d550346f57b966e77/html5/thumbnails/14.jpg)
Implicit addressing exampleImplicit addressing example
• CMA :: Complement accumulatorCMA :: Complement accumulator– CMA is the operationA is the source– A is the source
– A is the destination