0% found this document useful (0 votes)
3 views6 pages

Addressing Modes

Addressing modes are techniques used by the CPU to locate operands for instruction execution, with different types including Immediate, Direct, Indirect, Indexed, and Relative addressing. Each mode specifies how the operand's address is determined, either directly from the instruction or through various calculations involving registers. Understanding these modes is essential for interpreting assembly code and executing machine instructions effectively.

Uploaded by

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

Addressing Modes

Addressing modes are techniques used by the CPU to locate operands for instruction execution, with different types including Immediate, Direct, Indirect, Indexed, and Relative addressing. Each mode specifies how the operand's address is determined, either directly from the instruction or through various calculations involving registers. Understanding these modes is essential for interpreting assembly code and executing machine instructions effectively.

Uploaded by

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

1

Addressing Modes


Addressing modes are techniques used by the CPU to identify the location of
the operand(s) needed for executing an instruction. They provide rules for
interpreting the address field in an instruction, helping the CPU fetch
operands correctly.

● Assembly code uses mnemonics to represent instructions.


● It is a simplified way of representing machine code .
● The instruction is divided up into operand and opcode
● Opcode is used to determine the type of instruction and what hardware to
use to
execute
it.
● The operand
is the data or
address
of where the operation is performed.

Types of addressing modes:

1. Immediate Addressing
 In this mode the operand is specified in the instruction In other words, an
immediate-mode instruction has an operand field rather than an address field.

 This instruction has an operand field rather than an address field. The operand
field contains the actual operand to be used in conjunction with the operation
specified in the
2

 These

instructions are useful for initializing register to a constant value; For example MVI
B, 50H

 In Immediate Mode, the operand is part of the instruction itself.. …The operand is
actual value to be used.

 So if the instruction LDM 4 – the number 4 would be sent to the accumulator.

2. Direct Addressing
 In this mode the effective address is equal to the address part of the instruction.
The operand resides in memory and its address is given directly by the address
field of the instruction.

 In Direct Mode, the memory address of the operand is specified directly as part of
the instruction.
3

 The operand is the address of the value to be used.

 If the instruction is LDD 1 then the value stored at address 1 will sent to the
accumulator.

3. Indirect Addressing
 In this mode the address field of the instruction gives the address where the
effective address is stored in memory.

 Control unit fetches the instruction from the memory and uses its address part to
access memory again to read the effective address.

 In Indi
r ect
Mode,
the

address of the operand is given indirectly. The instruction contains a memory


4

address that points to another memory location holding the effective address of
the operand.

 The operand is the address of the address to be used. This is similar to direct, but
with one more hop in the process.

4.

Indexed Addressing
 In this mode the content of an index register (XR) is added to the address part of
the instruction to obtain the effective address.

 The index register is a special CPU register that contains an index value.

 Note: If an index-type instruction does not include an address field in its format,
the instruction is automatically converted to the register indirect mode of
operation.

Effective Address (EA) = XR + A


5

 Indexed Mode works by adding a constant value to a register to get the effective
memory [Link] mode is typically used to index an array in memory, and it is
also useful in executing loops.

 The operand plus the contents of the Index Register is the address of the value to
be used.

5. Relative Addressing
 In this mode the content of the program counter (PC) is added to the address part
of the instruction in order to obtain the effective address.

 The address part of the instruction is usually a signed number (either a +ve or a –
ve number).

 When the number is added to the content of the program counter, the result
produces an effective address whose position in memory is relative to the address
of the next instruction.
Effective Address (EA) = PC + A

 In Relative Mode, the effective address of the operand is determined by adding a


displacement to the program counter (PC).

 The operand is the offset from the current address of the value to be used.
6

So……
o Immediate: Operand is part of the instruction.
o Direct: Instruction contains the memory address of
the operand.
o Indirect: Instruction contains the address that holds
the effective address.
o Indexed: Address is calculated by adding an offset
to a base register.
o Relative: Address is relative to the current program
counter.

You might also like