0% found this document useful (0 votes)
32 views

Addressing Modes Assignment

Uploaded by

epimacklaurent
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Addressing Modes Assignment

Uploaded by

epimacklaurent
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

UNIVERSITY OF IRINGA

FACULTY OF SCIENCE AND EDUCATION


DEPARTMENT OF INFORMATION TECHNOLOGY

COURSE NAME: INTRO. TO COMPUTER ARCHITECTURE.


COURSE CODE: DIT-112.
COURSE INSTRUCTOR: SIR. MICHAEL MTEI.
NATURE OF WORK : GROUP ASSIGNMENT.
GROUP NUMBER: ONE (01).
DATE OF SUBMISSION: 6th May, 2022.

PARTICIPANTS REGISTRATION NUMBER SIGNATURE

LAYA AMIRI D_IT-29689


JAMILA J KILIMA D_IT-29418
JAMES JOHN D_IT-31219
PAULO DOTTO PAULO D_IT-30854
SALIM K ALLY D_IT-28971
RAMADHAN HAMIS D_IT-31073
SEVERIN KIMBE D_IT-30670

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.

Operations require the following:


 The operator or opcode which determines what will be done
 The operands which define the data to be used in the operation

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.

Effective Address (EA).


Effective address is the address of the exact memory location where the value of the operand is
present.

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.

Types of Addressing Modes:


There are several methods to designate the effective address of those operands or get them
directly from the register.
Implied Addressing Mode.
Implied Addressing Mode also known as "Implicit" or "Inherent" addressing mode is the
addressing mode in which, no operand (register or memory location or data) is specified in the
instruction. As in this mode the operand are specified implicit in the definition of instruction.

Example: The instruction:


“Complement Accumulator” is an Implied Mode instruction because the operand in the
accumulator register is implied in the definition of instruction. In assembly language it is written
as;
 CMA: Take complement of content of AC
 RLC: Rotate the content of Accumulator is an implied mode instruction.

Immediate Addressing Mode.


In Immediate Addressing Mode operand is specified in the instruction itself. In other words, an
immediate mode instruction has an operand field rather than an address field, which contain
actual operand to be used in conjunction with the operand specified in the instruction. That
is, in this mode, the format of instruction is;

Example: The Instruction:


 MVI 06 -------- Move 06 to the accumulator
 ADD 05 ------- ADD 05 to the content of accumulator

Direct Addressing Mode.


Direct Addressing Mode is also known as “Absolute Addressing Mode”. In this mode the
address of data (operand) is specified in the instruction itself. That is, in this type of mode, the
operand resides in memory and its address is given directly by the address field of the
instruction.

Means, in other words, in this mode, the address field contain the Effective Address of operand
Such as, EA=A

Example: The instruction:


 ADD A ------- Means add contents of cell A to accumulator
Indirect Addressing Mode.
In this mode, the address field of instruction gives the memory address where on, the operand is
stored in memory. That is, in this mode, the address field of the instruction gives the address
where the “Effective Address” is stored in memory. 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.

Example: The instruction:


 ADD (A) --------- Means adds the content of cell pointed to contents of A to
Accumulator.

Register Addressing Mode.


In Register Addressing Mode, the operands are in registers that reside within the CPU. That is, in
this mode, instruction specifies a register in CPU, which contain the operand. It is like Direct
Addressing Mode, the only difference is that the address field refers to a register instead of
memory location.

Example of such instructions:


 MOV AX, BX ------- Move contents of Register BX to AX
 ADD AX, BX ------ Add the contents of register BX to AX
Here, AX, BX are used as register names which is of 16-bit register.

Register Indirect Addressing Mode.


In Register Indirect Addressing Mode, the instruction specifies a register in CPU whose contents
give the operand in memory. In other words, the selected register contain the address of operand
rather than the operand itself. Such as, EA=(R)

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.

Example of such instructions:


MOV AL, [BX]
Code example in Register:
MOV BX, 1000H
MOV 1000H, operand

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.

Auto-increment Addressing Mode.


Auto-increment Addressing Mode are similar to Register Indirect Addressing Mode except that
the register is incremented after its value is loaded (or accessed) at another location like
accumulator (AC).

That is, in this case also, the Effective Address is equal to EA=(R)
But, after accessing operand, register is incremented by 1.

Example of such instructions:

Here, we see that effective address is (R) =400 and operand in AC is 7.


And after loading R1 is incremented by 1.It becomes 401.
Means, here we see that, in the Auto-increment mode, the R1 register is increment to 401 after
execution of instruction.

Auto-decrement Addressing Mode.


Auto-decrement Addressing Mode is reverse of auto-increment, as in it the register is decrement
before the execution of the instruction. That is, in this case, effective address is equal to
EA=(R) – 1.
Example of such instructions:

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.

Displacement Based Addressing Modes.


Displacement Based Addressing Modes is a powerful addressing mode as it is a combination of
direct addressing or register indirect addressing mode. Such as, EA=A+(R)

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:

i. Relative Addressing Mode


ii. Indexing Addressing Mode
iii. Base Register Addressing Mode

1. Relative Addressing Mode.


In Relative Addressing Mode, the contents of program counter is added to the address part of
instruction to obtain the Effective Address.

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;

2. Index Register Addressing Mode.


In indexed addressing mode, the content of Index Register is added to direct address part (or
field) of instruction to obtain the effective address.
Means, the register indirect addressing field of instruction point to Index Register, which is a
special CPU register that contain an Indexed value, and direct addressing field contain base
address.

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;

3. Base Register Addressing Mode.


In this mode, the content of the Base Register is added to the direct address part of the instruction
to obtain the effective address.

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

You might also like