0% found this document useful (0 votes)
27 views11 pages

Adressing Mode Notes

The document provides a detailed explanation of various addressing modes used in computer architecture, including Implied, Immediate, Register, and others. Each mode is defined with examples and specific use cases, highlighting how operands are accessed or specified in instructions. The summary table at the end consolidates the definitions, examples, and uses of each addressing mode for easier reference.

Uploaded by

SARWESH TECH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views11 pages

Adressing Mode Notes

The document provides a detailed explanation of various addressing modes used in computer architecture, including Implied, Immediate, Register, and others. Each mode is defined with examples and specific use cases, highlighting how operands are accessed or specified in instructions. The summary table at the end consolidates the definitions, examples, and uses of each addressing mode for easier reference.

Uploaded by

SARWESH TECH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

Implied Addressing Mode:

Definition:
In Implied Addressing Mode, the operand is implicitly specified by the instruction itself. The operand
is often predefined (like an accumulator) and doesn't need to be explicitly provided.

Example:

• CLR (Clear the accumulator).


Here, the operand is the accumulator, and the instruction implies the action without
specifying a memory address.

Uses:

• This mode is used for operations where the operand is always fixed, like in accumulator-
based systems.

2. Immediate Addressing Mode:

Definition:
In Immediate Addressing Mode, the operand is directly specified in the instruction itself, rather than
being stored at a memory location.

Example:

• MOV R1, #5 (Move the value 5 directly into register R1).

Uses:

• Used when we need to work directly with constants (immediate values) rather than memory
locations.

3. Register Addressing Mode:

Definition:
In Register Addressing Mode, the operand is located in one of the processor's registers, and the
instruction specifies which register to use.

Example:

• ADD R1, R2 (Add the contents of register R1 to R2).

Uses:

• Frequently used for operations on fast-access registers within the CPU, which are much
faster than memory.

4. Register Indirect Addressing Mode:

Definition:
In Register Indirect Addressing Mode, the register contains the memory address of the operand. The
instruction points to a register, which indirectly points to the operand's memory address.
Example:

• MOV A, (R1) (Move the data from the memory location pointed to by register R1 into register
A).

Uses:

• Useful when dealing with dynamic memory locations or when the address of the operand
changes frequently.

5. Auto-increment Addressing Mode:

Definition:
In Auto-increment Addressing Mode, the operand’s address is stored in a register, and after the
instruction executes, the register is automatically incremented by a predefined amount.

Example:

• MOV A, (R1)+ (Move the data from memory at the address in register R1, then increment
R1).

Uses:

• Used in operations like iterating through arrays or lists where the pointer to the next data
location is automatically adjusted after each operation.

6. Auto-decrement Addressing Mode:

Definition:
In Auto-decrement Addressing Mode, the address of the operand is stored in a register, and the
register is decremented before accessing the operand.

Example:

• MOV A, -(R1) (Decrement R1 and then move the data from the memory address pointed to
by the updated R1 into A).

Uses:

• Useful in stack operations where elements are pushed or popped automatically.

7. Direct Addressing Mode:

Definition:
In Direct Addressing Mode, the instruction contains the exact memory address of the operand.

Example:

• MOV A, 1000 (Move the data at memory location 1000 into register A).

Uses:
• Simple and fast when you know the exact location of the data in memory.

8. Indirect Addressing Mode:

Definition:
In Indirect Addressing Mode, the instruction specifies a register or memory location that contains
the address of the operand.

Example:

• MOV A, (1000) (Move the data from the memory location whose address is stored at
memory location 1000 into A).

Uses:

• Frequently used in complex memory management schemes, where addresses themselves


are stored in memory.

9. Relative Addressing Mode:

Definition:
In Relative Addressing Mode, the address of the operand is determined by adding a signed offset
(from the instruction) to the current value of the Program Counter (PC).

Example:

• BEQ 100 (Branch to the address 100 positions ahead of the current instruction if the zero flag
is set).

Uses:

• Often used for branching and jumping to different locations in the code.

10. Indexed Addressing Mode:

Definition:
In Indexed Addressing Mode, the effective address is the sum of a base address (often stored in a
base register) and an index value (usually from a register).

Example:

• MOV A, 1000(R1) (Move the data from the memory location at the address 1000 plus the
contents of register R1 into register A).

Uses:

• Commonly used for accessing elements of an array where each element is located at a fixed
offset from a base address.

11. Base Register Addressing Mode:


Definition:
In Base Register Addressing Mode, a base register holds the starting address, and an offset is added
to it to get the final address.

Example:

• MOV A, 1000(R2) (Move the data from memory at the address obtained by adding the value
in register R2 to 1000 into A).

Uses:

• Often used in managing arrays and accessing data structures where the base address is fixed,
but the offset varies.

12. Stack Addressing Mode:

Definition:
In Stack Addressing Mode, operands are accessed from the stack (LIFO – Last In, First Out). The
processor uses stack pointers (SP) to manage the data.

Example:

• PUSH A (Push the contents of A onto the stack).

Uses:

• Essential in function calls, recursive functions, and temporary data storage during execution.

Summary Table:

Addressing
Description Example Uses
Mode

Operand is implied, no address CLR (Clear Operations on predefined


Implied
specified Acc) registers

Operand is a constant, directly in the


Immediate MOV R1, #5 Using constants
instruction

Register Operand is in a register ADD R1, R2 Register-based operations

Register
Operand's address is in a register MOV A, (R1) Dynamic address fetching
Indirect

Auto- Register value incremented after


MOV A, (R1)+ Iterating through arrays
increment operand access

Auto- Register value decremented before


MOV A, -(R1) Stack operations
decrement operand access
Addressing
Description Example Uses
Mode

Address of operand is directly in the Accessing fixed locations in


Direct MOV A, 1000
instruction memory

Address of operand is stored at a MOV A, Complex memory


Indirect
memory location (1000) management

Address is relative to the current PC


Relative BEQ 100 Branching and looping
value

Operand address is sum of base and MOV A,


Indexed Array access
index register 1000(R1)

Operand address is sum of base MOV A,


Base Register Array and structure access
register and offset 1000(R2)

Stack Operand is accessed via the stack PUSH A Function calls, recursion

These explanations with examples will help you remember the addressing modes and their uses
effectively for your exams!

4o mini

You said:

aur Pc Relative adressing mode ,index register realtive adressing mode Base register adressing mode
ye sab ko bhi

ChatGPT said:

ChatGPT

Sure! Let's cover the remaining addressing modes: PC-relative Addressing Mode, Index Register
Relative Addressing Mode, and Base Register Addressing Mode in detail, with definitions, examples,
and uses.

1. PC-Relative Addressing Mode:

Definition:
In PC-relative Addressing Mode, the address of the operand is determined by adding a signed offset
(provided in the instruction) to the current value of the Program Counter (PC). This means the
operand's address is relative to the location of the current instruction.

Example:

• BEQ 100 (Branch to the address 100 positions ahead or behind the current instruction if the
condition is met).
If the Program Counter (PC) is at memory address 2000, the effective address for the branch
instruction will be 2000 + 100 = 2100 if the condition is true.

Uses:

• Branching: This mode is mainly used for branching operations (e.g., BEQ, BNE, JMP), where
the jump address is relative to the current position in the program.

• Short distance jumps: It is useful for short jumps or loops, where the destination address is
relatively close to the current instruction, making it efficient in terms of instruction size.

2. Index Register Relative Addressing Mode:

Definition:
In Index Register Relative Addressing Mode, the effective address of the operand is calculated by
adding the content of an index register to a constant value (which can be a displacement or an offset)
specified in the instruction. This mode is used for accessing elements of arrays, lists, or tables, where
the index register keeps track of the current position.

Example:

• MOV A, 1000(R1)
Here, the effective address will be the value of the content in register R1 added to 1000. If R1
contains 2000, the effective address will be 1000 + 2000 = 3000. The data at address 3000
will be moved to register A.

Uses:

• Arrays/Lists: This addressing mode is useful when accessing data structures such as arrays,
where each element is located at a fixed distance from the base address (i.e., the value in the
index register).

• Tables: It is also used for searching or accessing entries in tables where the base address is
stored in a register, and the offset (displacement) is used to access individual elements.

3. Base Register Addressing Mode:

Definition:
In Base Register Addressing Mode, the operand's address is calculated by adding a constant offset
(displacement) specified in the instruction to the value stored in a base register. This register usually
holds the starting address of a memory segment (e.g., base of an array or data structure). The mode
is often used in systems where the operand's address is not fixed but depends on a base address.

Example:

• MOV A, 1000(R2)
Here, the effective address of the operand is calculated by adding the content of the base
register R2 to the constant 1000. If R2 contains 2000, the effective address will be 1000 +
2000 = 3000. The data at memory address 3000 will be moved to register A.

Uses:
• Memory Segmentation: This mode is often used in systems with memory segmentation,
where different sections of memory (e.g., code, stack, heap) are accessed using a base
register, and the offset is used to point to specific data or instructions.

• Dynamic Memory Access: It is also used in situations where the address of the data changes
dynamically, and the base register helps in adjusting the address accordingly.

Summary Table of Addressing Modes:

Addressing Mode Definition Example Uses

PC-relative Addressing Effective address = PC + offset


BEQ 100 Branching, short jumps, loops
Mode (signed)

Index Register Relative Effective address = Index MOV A,


Array/List access, tables
Addressing Mode Register + Displacement 1000(R1)

Base Register Effective address = Base MOV A, Memory segmentation,


Addressing Mode Register + Displacement 1000(R2) dynamic memory access

1) Implied Addressing Mode

Definition: Is mode mein operand directly instruction ke part nahi hota. Matlab, jo instruction hai,
usme jo specific register ya memory location ka use ho raha hai, woh directly specified hota hai.

Example: Instruction like INR A (Increment register A). Yahan operand A hai, jo already instruction
mein implied hai.

Use: Ye simple operations jese increment, decrement, or negation ke liye hota hai, jisme operand ka
address already specified hota hai.

2) Immediate Addressing Mode

Definition: Is mode mein operand directly instruction ke andar diya jata hai, na ki kisi register ya
memory address se. Yani, jo value aapko chahiye, woh directly instruction mein embedded hoti hai.

Example: Instruction like MOV A, #5. Yahan operand 5 hai, jo direct instruction mein diya gaya hai.

Use: Ye mode tab use hota hai jab hume specific value ko directly register mein load karna ho.

3) Register Addressing Mode

Definition: Is mode mein operand register mein hota hai, yani operand ka address ek register ke
andar store hota hai.

Example: Instruction like MOV A, B. Yahan operand A aur B dono registers hain.

Use: Ye mode fast access operations ke liye hota hai, kyunki registers bahut fast hote hain.
4) Register Indirect Addressing Mode

Definition: Is mode mein, ek register ke andar memory address hota hai, aur us memory address se
operand ko access kiya jata hai.

Example: Instruction like MOV A, (R1). Yahan R1 register mein ek address hai, aur us address se value
ko A register mein transfer kiya jaata hai.

Use: Ye mode tab useful hota hai jab hume ek address se data access karna ho jo ek register mein
stored ho.

5) Direct Addressing Mode

Definition: Is mode mein, operand ka address directly instruction ke andar diya jata hai. Matlab,
instruction mein directly jo address mention hota hai, wahi address operand ka hota hai.

Example: Instruction like MOV A, 2000. Yahan 2000 ek direct memory address hai jahan operand
stored hai.

Use: Ye mode tab use hota hai jab directly kisi memory location se data ko fetch ya store karna ho.

6) Indirect Addressing Mode

Definition: Is mode mein, operand ka address ek register ya memory location mein store hota hai,
aur us address ko follow karke operand ko access kiya jata hai.

Example: Instruction like MOV A, (2000). Yahan 2000 ek memory location hai jahan address stored
hai, aur us address par value stored hai.

Use: Ye mode complex data structures ko access karne ke liye use hota hai, jisme ek address ke andar
doosra address stored hota hai.

7) Auto-increment Addressing Mode

Definition: Is mode mein, operand ka address ek register ya memory location ke andar hota hai, aur
operation ke baad address automatically increment ho jata hai.

Example: Instruction like MOV A, (R1)+. Yahan R1 register ka value address ko point kar raha hai, aur
operation ke baad R1 ka value increment ho jata hai.

Use: Ye mode stack operations aur sequential data access ke liye use hota hai.

8) Auto-decrement Addressing Mode

Definition: Is mode mein, operand ka address ek register ya memory location ke andar hota hai, aur
operation ke baad address automatically decrement ho jata hai.

Example: Instruction like MOV A, -(R1). Yahan R1 register ka value address ko point kar raha hai, aur
operation ke baad R1 ka value decrement ho jata hai.
Use: Ye mode bhi stack operations ke liye use hota hai, jahan hum stack ke top se data ko fetch karte
hain aur pointer ko decrement karte hain.

9) Relative Addressing Mode

Definition: Is mode mein, jo address diya gaya hota hai, woh program counter ke value ke saath add
ya subtract hota hai, aur isse effective address milta hai.

Example: Maan lo program counter ka value 1000 hai aur instruction mein 20 ka offset diya hai, to
effective address hoga 1000 + 20 = 1020.

Use: Ye branch instructions ke liye use hota hai, jaise jumps ya loops mein.

10) PC Relative Addressing Mode

Definition: Is mode mein, jo address diya gaya hota hai, woh program counter ke value ke saath add
kiya jata hai, aur isse effective address milta hai. Yeh branches ya jumps ke liye kaafi useful hota hai.

Example: Maan lo program counter 1000 hai aur offset 100 hai, to effective address hoga 1000 + 100
= 1100.

Use: Ye mode mainly jumps aur conditional branching ke liye use hota hai.

11) Indexed Addressing Mode

Definition: Is mode mein, ek base address register aur ek index register ka use hota hai. Index
register ka value base address ke saath add karke final address milta hai.

Example: Maan lo base register mein 5000 hai aur index register mein 100 hai, to final address hoga
5000 + 100 = 5100.

Use: Ye arrays ko access karne ke liye useful hota hai, jahan base address array ka starting address
hota hai aur index register array ke elements ko point karta hai.

12) Base Register Addressing Mode

Definition: Is mode mein, ek base register ka use hota hai jo memory ke ek specific location ko point
karta hai. Base register ke value ke saath instruction mein diya gaya offset add karke final address
milta hai.

Example: Agar base register mein 3000 hai aur offset 200 hai, to final address hoga 3000 + 200 =
3200.

Use: Ye mode large memory ko access karne ke liye useful hota hai, jahan ek base register large
memory block ka starting address hota hai.

13) Zero Addressing Mode


Definition: Is mode mein, kisi bhi operand ka address explicitly instruction mein nahi diya jata. Yeh
pushdown stack ka use karta hai, jahan operands stack ke top par hote hain.

Example: Instruction like PUSH A (pushes A to stack), ADD (adds top two operands of stack), and
then POP X (pops result to X).

Use: Ye mode stack-based machines jese kalkulations aur function calls ke liye hota hai.

1) PC Relative Addressing Mode

Definition: Is mode mein operand ka address, program counter (PC) ke value ke saath add ya
subtract hota hai. Matlab, jo address instruction mein diya gaya hai, woh program counter ke current
position ke relative hota hai. Yeh mainly program control (branches, loops) ke liye use hota hai.

Example:
Maan lo program counter (PC) ka current value 1000 hai aur instruction mein 20 ka offset diya gaya
hai. Toh, effective address (EA) hoga:

yaml

Copy code

EA = PC + Offset = 1000 + 20 = 1020

Yahan PC ke value (1000) ko 20 ke offset se add kiya gaya hai, aur address 1020 milta hai.

Use:

• Yeh mode primarily jumps aur conditional branches ke liye use hota hai.

• Jahan program ka flow change karna ho, jaise loops aur function calls mein.

2) Indexed Addressing Mode

Definition: Is mode mein, operand ka address ek base register aur ek index register se milke calculate
hota hai. Matlab, ek base address register mein stored value aur ek index register ke value ko add
karke final address milta hai.

Example:
Maan lo, base register (say BR) mein value 5000 hai aur index register (say IR) mein value 100 hai.
Toh, effective address (EA) hoga:

yaml

Copy code

EA = BR + IR = 5000 + 100 = 5100

Yahan, base register (5000) ke value ko index register (100) se add karke final address (5100) milta
hai.

Use:

• Yeh mode arrays aur data structures ko access karne ke liye use hota hai, jahan array ke
elements sequential memory locations mein stored hote hain.
• Data ko efficiently access karne mein madad karta hai.

3) Base Register Addressing Mode

Definition: Is mode mein ek base register hota hai jisme starting memory address stored hota hai.
Operand ka address calculate karne ke liye, base register ki value aur ek offset add kiya jata hai.

Example:
Maan lo, base register (say BR) mein 3000 ka address stored hai aur instruction mein offset 200 diya
gaya hai. Toh, effective address (EA) hoga:

yaml

Copy code

EA = BR + Offset = 3000 + 200 = 3200

Yahan, base register (3000) ko offset (200) se add karke final address (3200) milta hai.

Use:

• Yeh mode large memory systems aur dynamic memory allocation ke liye use hota hai.

• Yeh especially memory management mein helpful hota hai, jahan base address aur variable
offsets ke through memory access kiya jata hai.

• Efficient way hai large blocks of memory ko access karne ke liye.

Summary of Uses and Differences:

• PC Relative Addressing Mode: Program flow control ke liye use hota hai. Jumps ya branches
ko handle karta hai, jahan program counter (PC) se relative address calculation hoti hai.

• Indexed Addressing Mode: Arrays aur data structures ko access karne ke liye use hota hai.
Jahan base aur index registers ka combination address calculation mein hota hai.

• Base Register Addressing Mode: Memory management ke liye use hota hai. Large memory
blocks ko efficiently access karne ke liye base register aur offset ka use hota hai.

You might also like