Addressing Modes & its types

Addressing Modes & its types

Addressing Mode

Addressing mode उन Rules को Specify करता है जिनके use से User द्वारा दिए जाने वाला Instruction, Computer के Primary memory means की RAM में Store Data को Access करता है।

Addressing modes का Definition को Exact से समझने के लिए Instruction को समझना जरूरी है। User द्वारा किसी input device जैसे की keyboard, Mouse आदि के use से computer को दिया जाने वाला Instruction दो भाग में divide होता है| operand (ऑपरेंड) और opcode (ऑप-कोड).

 

Opcode उस Work के बारे में बताता है जिसे Instruction को पूरा करना है। ये Task Addition, Subtraction, Multiplication करना आदि हो सकता है और Opcode जिस data पर Work करता है उसकी information Operand में होती है। Addressing mode Operand को Memory में Store data तक Access करता है।

Important Terms

  •  memory segment का starting address
  • Effective address और Offset: तीन address element के किसी भी combination को जोड़कर एक Offset defines किया जाता है| displacement, base, and index.
  1. Displacement: यह Instruction में दिया गया 8 bit या 16 bit का immediate value है।
  2. Base: Base register, BX or BP का Content होता है |
  3. Index: Index register SI or DI Content होता है |

Types of Addressing Modes

1. Immediate addressing mode

इस Mode में, 8 या 16 bit data instruction के अंदर ही specify रहता है| यदि Data 8 bit का होता है तब instruction 2 bytes की होती है| यदि Data 16 bit का होता है तब instruction 3 Bytes का होता है|

Example

MVI B, 45H (data 45H को immediately, register B में move करना)
LXI H, 3050H (H-L pair को operand 3050H के साथ immediately load करना)
JMP address (operand address पर immediately jump करना)

2. Register Addressing Mode

इस Mode में Data एक Register से दूसरे Register पर copy होता है| इसमें registers में ही data होता है और Operation को microprocessor के अन्य registers पर perform किया जाता है |

Example

MOV A, B (register B के content को register A में copy करना)
MOV A, C (register C के content को रजिस्टर A में copy करना)
INR A (register A के content को एक से increment करना)

3. Direct  Addressing  Mode

Direct Addressing Mode को हम Absolute Addressing Mode भी कहते है और यह addressing  mode सबसे ज्यादा Important addressing mode माना जाता है Direct  addressing  mode में Instruction के operand वाले Field में हमें Memory का direct address दिया गया होता है| हमें Memory की उस Location पर जाकर Data को केवल fetch करना होता है|

Example

LDB 5000K - 5000K address में available data को register B में copy करना होता है|

4. Indirect Addressing Mode

Indirect addressing mode में किया जाने वाला Operation एक Data memory location के अंदर Available होता है और वह Memory location indirectly रूप से एक Register pair द्वारा Specify किया जाता है।

Example

MOV K, B: – register के द्वारा point किये गये memory address से data, register K में transfer होता है|

5. Relative Addressing Mode 

Relative Addressing Mode  में किसी operand की Actual  address या Effective address को पता करने के लिए हमें instruction के  Address part  में Program counter  के content को जोड़ा जाता है सामान्यता  instruction का address part  2 ‘s Complements के रूप में होता है जो की positive और negative हो सकता है

जब  instruction के address part को program counter साथ जोड़ा जाता है तो हमें Effective address  प्राप्त होता है Relative Addressing Mode का use करके हम एक memory location से दूसरी memory  location पर आसानी से जा सकते है |

 

 Effective Address = 

Program  Counter  (PC) + Address Part  of  the  instruction

6. Indexed Addressing Mode

Indexed Addressing Mode में हम array को efficiently use कर सकते है और हम इसमें multiple register को use करते है| Indexed Addressing mode  में अगर हमें instruction के Effective Address  को  Calculate करना है तो उसके लिए हमें instruction के address part में Index Register के content  को जोड़ दिया जाता है| index register, CPU  का एक विशेष register होता है जिसमे हम register array के  index के मान को सुरक्षित रखते है|

Effective Address =

 Register  Index + Address Part  of  the  instruction
Previous articleWhat is MPCU & Difference between RISC and CISC
Next articleInstructions Formats & its Types and RISC Instruction

LEAVE A REPLY

Please enter your comment!
Please enter your name here