Addressing Modes Assignment
Addressing Modes Assignment
QUESTION:
Discuss about Addressing Modes in computer architecture!
INTRODUCTION
What is Addressing Modes:
An addressing mode is the process used by a microprocessor to deliver instructions to a machine
so operations can be performed.
The addressing mode is the method to specify the operand of an instruction. The job of a
microprocessor is to execute a set of instructions stored in memory to perform a specific task.
For example, if we wanted to add the numbers 1 and 2 and get a result, mathematically we would
likely write this as 1 + 2. In this case, our operator is (+), or the addition, and our operands are
the numbers 1 and 2.
In a microprocessor, the machine needs to be told how to get the operands to perform the
operation. The effective address is a term that describes the address of an operand that is stored
in memory.
Computers use addressing mode techniques for the purpose of accommodating one or both of the
following provisions:
To give programming versatility to the user by providing such facilities as pointers to
memory, counters for loop control, indexing of data, and program relocation.
To reduce the number of bits in the addressing field of the instruction.
Means, in other words, in this mode, the address field contain the Effective Address of operand
Such as, EA=A
Means, here Control fetches the instruction from memory and then uses its address part to access
memory again to read Effective Address.
Means, control fetches instruction from memory and then uses its address to access Register and
looks in Register(R) for effective address of operand in memory.
On this example, it is clear that, the instruction(MOV AL, [BX]) specifies a register[BX],
and in coding of register, we see that, when we move register [BX], the register contain the
address of operand(1000H) rather than address itself.
That is, in this case also, the Effective Address is equal to EA=(R)
But, after accessing operand, register is incremented by 1.
Here, we see that, in the Auto-decrement mode, the register R1 is decremented to 399 prior to
execution of the instruction, means the operand is loaded to accumulator, is of address 1099H in
memory, instead of 1088H.Thus, in this case effective address is 1099H and contents loaded into
accumulator is 700.
Means, Displacement Addressing Modes requires that the instruction have two address fields, at
least one of which is explicit means, one is address field indicate direct address and other
indicate indirect address. That is, value contained in one addressing field is A, which is used
directly and the value in other address field is R, which refers to a register whose contents are to
be added to produce effective address.
It look like;
There are three areas where Displacement Addressing modes are used. In other words,
Displacement Based Addressing Modes are of three types. These are:
That is, in Relative Addressing Mode, the address field of the instruction is added to implicitly
reference register Program Counter to obtain effective address. Such as EA=A+PC.
It look like;
As, indexed type instruction make sense that data array is in memory and each operand in the
array is stored in memory relative to base address. And the distance between the beginning
address and the address of operand is the indexed value stored in indexed register.
Any operand in the array can be accessed with the same instruction, which provided that the
index register contains the correct index value.
It look like;
Means, in it, the register indirect address field point to the Base Register and to obtain EA, the
contents of Instruction Register, is added to direct address part of the instruction. This is similar
to indexed addressing mode except that the register is now called as Base Register instead of
Index Register.
That is, the EA=A+Base
It look like;
Thus, the difference between Base and Index mode is in the way they are used rather than the
way they are computed. An Index Register is assumed to hold an index number that is relative to
the address part of the instruction. And a Base Register is assumed to hold a base address and
the direct address field of instruction gives a displacement relative to this base address.
Thus, the Base register addressing mode is used in computer to facilitate the relocation of
programs in memory.
Means, when programs and data are moved from one segment of memory to another, then Base
address is changed, the displacement value of instruction do not change. So, only the value of
Base Register requires updating to reflect the beginning of new memory segment.
REFERENCES
https://edurev.in/studytube/Addressing-Modes-Computer-Organization-and-Archite/d68b7138-
0ce7-401f-8e56-ab31b910cd47_t
https://www.studytonight.com/computer-architecture/addressingmodes-instructioncycle
https://www.brainkart.com/article/Computer-Architecture--Addressing-and-Addressing-
Modes_8612/
https://www.tutorialspoint.com/what-are-the-types-of-addressing-modes