100% found this document useful (1 vote)
102 views

MCS-012Addressing Mode

The document discusses different addressing modes used in instruction cycles. It explains that addressing modes determine how operands are selected during program execution. There are three main types of addressing modes: 1) Indexed addressing mode uses the contents of an index register plus a constant to determine the effective address. 2) Base addressing mode uses a displacement and base register value to calculate the effective address. 3) Relative addressing mode adds the program counter value to the address part of the instruction to obtain the effective address. These addressing modes give programming flexibility and reduce the number of bits needed in instruction addresses.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
102 views

MCS-012Addressing Mode

The document discusses different addressing modes used in instruction cycles. It explains that addressing modes determine how operands are selected during program execution. There are three main types of addressing modes: 1) Indexed addressing mode uses the contents of an index register plus a constant to determine the effective address. 2) Base addressing mode uses a displacement and base register value to calculate the effective address. 3) Relative addressing mode adds the program counter value to the address part of the instruction to obtain the effective address. These addressing modes give programming flexibility and reduce the number of bits needed in instruction addresses.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Addressing Modes and Instruction Cycle:

The operation field of an instruction specifies the operation to be performed. This


operation will be executed on some data which is stored in computer registers or the
main memory. The way any operand is selected during the program execution is
dependent on the addressing mode of the instruction. The purpose of using
addressing modes is as follows:
1. To give the programming versatility to the user.
2. To reduce the number of bits in addressing field of instruction.

Types of Addressing Modes:


Below we have discussed different types of addressing modes one by one:
For Example: ADD R1, 4000 - In this the 4000 is effective address of operand.
NOTE: Effective Address is the location where operand is present.
In this the contents of the indexed register is
added to the Address part of the instruction, to
obtain the effective address of operand.
EA = A + (R), In this the address field holds two
values, A(which is the base value) and
R(that holds the displacement), or vice versa.
Types of displacement addressing:-

1.Indexed Addressing mode


2.Base Addressing mode
3.Relative Addressing mode
1. Indexed Addressing mode:-

The address of the operand is obtained by adding to the contents of the general
register (called index register) a constant value. The number of the index register
and the constant value are included in the instruction code. Index Mode is used
to access an array whose elements are in successive memory locations. The
content of the instruction code, represents the starting address of the array
and the value of the index register, and the index value of the current element.
By incrementing or decrementing index register different element of the array
can be accessed.
Effective Address = index + Address A
2. Base register Addressing mode:-

It is again a version of Displacement addressing mode.


This can be defined as EA = A + (R), where A is displacement and
R holds pointer to base address.
3. Relative Addressing mode:-

It is a version of Displacement addressing mode.


In this the contents of PC(Program Counter) is added to address part
of instruction to obtain the effective address.

EA = A + (PC), where EA is effective address and PC is program counter.


The operand is A cells away from the current cell(the one pointed
to by PC)
In this mode, operand is at the top of the stack.
For example: ADD, this instruction will POP top two items
from the stack, add them, and will then PUSH the result to
the top of the stack.
By
“Exam Aasaan Hai” YouTube channel

You might also like