Addressing-Modes
Question 1 |
Consider the C struct defined below:
struct data { int marks [100]; char grade; int cnumber; }; struct data student;
The base address of student is available in register R1. The field student.grade can be accessed efficiently using
Post-increment addressing mode, (R1)+ | |
Pre-decrement addressing mode, -(R1) | |
Register direct addressing mode, R1 | |
Index addressing mode, X(R1), where X is an offset represented in 2’s complement 16-bit representation |
{
int marks[100];
char grade;
int cnumber;
}; struct data student
Base Address of student is available in R1.
So student.grade can be accessed efficiently by Relative Indexed Addressing Mode.
It is clearly mentioned X is the offset address to be summed with Base Address of R1.

Hence Index Addressing mode X(R1), where X is an offset represented in 2’s complement 16-bit representation.
⇾ Relative, Base Indexed & all subtypes of Indirect addressing modes are used with Arrays.
Question 2 |
Which of the following is/are true of the auto-increment addressing mode?
- I. It is useful in creating self-relocating code
II. If it is included in an Instruction Set Architecture, then an additional ALU is required for effective address calculation
III. The amount of increment depends on the size of the data item accessed
I only | |
II only | |
III Only | |
II and III only |
II. An additional ALU is not necessary for auto-increment. So this statement is wrong.
III. In auto-increment addressing mode the address where next data block to be stored is generated automatically depending upon the size of single data item required to store. This is based on pointer arithmetic. So this statement is true.
Hence option C is the answer.
Question 3 |
Which of the following addressing modes are suitable for program relocation at run time?
(i) Absolute addressing (ii) Based addressing (iii) Relative addressing (iv) Indirect addressing
(i) and (iv) | |
(i) and (ii) | |
(ii) and (iii) | |
(i), (ii) and (iv)
|
A fixed address in memory which indicates a location by specifying a distance from another location. In this displacement type addressing is preferred.
So, option A is false.
Based Addressing:
This scheme is used by computers to control access to memory. In this pointers are replaced by protected objects which can be executed by kernel (or) some other privileged process authors.
So, this is suitable for program relocation at runtime.
Relative Addressing:
The offset of the relative addressing is to allow reference to code both before and after the instruction.
This is also suitable.
Indirect Addressing:
Which leads to extra memory location which can be not suitable at run time.
This is not suitable.
→ Only Based Addressing and Relative Addressing are suitable.
Question 4 |
In the absolute addressing mode
the operand is inside the instruction | |
the address of the operand is inside the instruction | |
the register containing the address of the operand is specified inside the instruction | |
the location of the operand is implicit |
The operand is inside the instruction --- absolute addressing.
The register containing the address of the operand is specified inside the instruction --- Register addressing.
The location of the operand is implicit --- Implicit addressing.
Question 5 |
A certain processor supports only the immediate and the direct addressing modes. Which of the following programming language features cannot be implemented on this processor?
Pointers | |
Arrays | |
Records | |
Recursive procedures with local variable | |
All the above |
B) Cannot be implemented because arrays need Register indexing.
C) Records also needs pointers which needs indirect addressing modes, so this also cannot be implemented.
D) Recursive procedures needs stack, and so it needs stack pointers which in turn needs indirect addressing. So this also cannot be implemented.
Question 6 |
Which of the following addressing modes permits relocation without any change whatsoever in the code?
Indirect addressing | |
Indexed addressing | |
Base register addressing | |
PC relative addressing |
Question 7 |
Relative mode of addressing is most relevant to writing
coroutines | |
position – independent code | |
shareable code | |
interrupt handlers |
Question 8 |
The most relevant addressing mode to write position-independent codes is:
Direct mode | |
Indirect mode | |
Relative mode | |
Indexed mode |
Question 9 |
Which of the following statements about relative addressing mode is FALSE?
It enables reduced instruction size | |
It allows indexing of array elements with same instruction | |
It enables easy relocation of data | |
It enables faster address calculations than absolute addressing |
Question 10 |

X − 3, Y − 2, Z −1 | |
X − 2, Y − 3, Z −1 | |
X − 3, Y −1, Z − 2 | |
X − 2, Y −1, Z − 3 |
Indirect addressing means that the address of the data is held in an intermediate location so that the address is first 'looked up' and then used to locate the data itself.
Immediate addressing:
Immediate Addressing. An immediate operand has a constant value or an expression. When an instruction with two operands uses immediate addressing, the first operand may be a register or memory location, and the second operand is an immediate constant. Auto increment or decrements: can be one by using loops.
Question 11 |
Coroutines | |
Position-independent code | |
Shareable code | |
Interrupt Handlers |
Question 12 |
I. It is useful in creating self-relocating code
II. If it is included in an Instruction Set Architecture, then an additional ALU is required for effective address calculation
III. The amount of increment depends on the size of the data item accessed
I only | |
II only | |
III only | |
) II only |
For example, (A7)+ would access the content of the address register A7, then increase the address pointer of A7 by 1 (usually 1 word). Within a loop, this addressing mode can be used to step through all the elements of an array or vector.
Question 13 |
Absolute mode
| |
Indirect mode
| |
Immediate mode
| |
Index mode |
2. Indirect addressing is a scheme in which the address specifies which memory word or register contains not the operand but the address of the operand.
Immediate Operand:
The simplest way for an instruction to specify an operand is for the address part of the instruction actually to contain the operand itself rather than an address or other information describing where the operand is. Such an operand is called an immediate operand because it is automatically fetched from memory at the same time the instruction itself is fetched. It is immediately available for use.
Index 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
Question 14 |
It enables reduced instruction size | |
It allows indexing of array element with same instruction | |
It enables easy relocation of data | |
It enables faster address calculation than absolute addressing |
In absolute addressing, you specify the actual address (called the absolute address) of a memory location.
Question 15 |
Pointers | |
Arrays | |
Records | |
All of these |
→ An array and record access needs a pointer access. So, options (A), (B) and (C) cannot be implemented on such a processor.
→ Now to handle recursive procedure we need to use stack. A local variable inside the stack will be accessed as *(SP+Offset) which is nothing but a pointer access and requires indirect addressing. Usually this is done by moving the SP value to the base register and then using base register addressing to avoid unnecessary memory access for indirect addressing but not possible with just direct and immediate addressing.
Question 16 |
Direct | |
Register | |
Register indirect | |
Immediate |
PUSH A, PUSH B, add α popc
Wherein addressing mode used are as follows: –
PUSH A – Direct
PUSH B – Register
Add – Register indirect
Pop.C – Immediate
Question 17 |
Consider the following statements :
- (i) Auto increment addressing mode is useful in creating self-relocating code.
(ii) If auto addressing mode is included in an instruction set architecture, then
an additional ALU is required for effective address calculation.
(iii) In auto increment addressing mode, the amount of increment depends on
the size of the data item accessed.
Which of the above statements is/are true ?
Choose the correct answer from the code given below :
Code :(iii) only | |
(ii) and (iii) only | |
(i) and (ii) only
| |
(ii) only |
→ After determining the effective address, the value in the base register is incremented by the size of the data item that is to be accessed. For example, (A7)+ would access the content of the address register A7, then increase the address pointer of A7 by 1 (usually 1 word).
→ Within a loop, this addressing mode can be used to step through all the elements of an array or vector.
Question 18 |
Direct | |
Absolute | |
Indirect | |
Indexed |
● Indirect addressing is generally used for variables containing several elements like, arrays. Starting address of the array is stored in, say, the EBX register.
● 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.
● An absolute address is represented by the contents of a register. This addressing mode is absolute in the sense that it is not specified relative to the current instruction address.
Question 19 |
4 | |
6 | |
8 | |
10 |
Given instruction is
Instruction-1: Load the value “M” into accumulator
Instruction-2:Add the “N” value to M and store result into accumulator register
Instruction-3:Multiply “O” with the accumulator register value and store in to accumulator register
instruction-4: Store that result into Memory
Instruction-5:Load/store the value “P” into accumulator register
instruction-6:Multiply “Q” with the accumulator register value and store in to accumulator
instruction-7:Divide the memory value with the accumulator register value and store in to accumulator
Instruction-8: Store the accumulator value in the memory location.
Question 20 |
Based indexed mode | |
Absolute mode | |
Immediate mode | |
Register indirect mode |
Immediate mode
In immediate addressing the operand is specified in the instruction itself. In this mode the data is 8 bits or 16 bits long and data is the part of instruction.
Example: MOV AL, 35H (move the data 35H into AL register)
Question 21 |
index | |
absolute | |
immediate | |
indirect |
Question 22 |
Immediate | |
Direct | |
Indirect | |
Implied |
Question 23 |
Pointer | |
Indexed register | |
Special Locations | |
Scratch Pad |
→ Indirection is noted by placing the name of the register or the memory address given in the instruction in parentheses.
→ The register or memory location that contains the address of the operand is a pointer. When an execution takes place in such mode, instruction may be told to go to a specific address. Once it's there, instead of finding an operand, it finds an address where the operand is located.
Note:Two memory accesses are required in order to obtain the value of the operand (fetch operand address and fetch operand value).
Example: (textbook) ADD (A), R0
(address A is embedded in the instruction code and (A) is the operand address = pointer variable)
Question 24 |
(i) Auto increment addressing mode is useful in creating self-relocating code.
(ii) If auto addressing mode is included in an instruction set architecture, then an additional ALU is required for effective address calculation.
(iii) In auto increment addressing mode, the amount of increment depends on the size of the data item accessed.
Which of the above statements is/are true ?
(iii) only | |
(ii) and (iii) only | |
(i) and (ii) only | |
(ii) only |
→ After determining the effective address, the value in the base register is incremented by the size of the data item that is to be accessed. For example, (A7)+ would access the content of the address register A7, then increase the address pointer of A7 by 1 (usually 1 word).
→ Within a loop, this addressing mode can be used to step through all the elements of an array or vector.
Question 25 |
Absolute | |
Indirect | |
Immediate | |
Index |
2. Indirect addressing is a scheme in which the address specifies which memory word or register contains not the operand but the address of the operand.
Immediate Operand:
The simplest way for an instruction to specify an operand is for the address part of the instruction actually to contain the operand itself rather than an address or other information describing where the operand is. Such an operand is called an immediate operand because it is automatically fetched from memory at the same time the instruction itself is fetched. It is immediately available for use.
Index 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
Question 26 |
absolute | |
immediate | |
indirect | |
index |
Question 27 |
pointer | |
special location | |
indexed register | |
None of the above |
Question 28 |
Absolute mode | |
Immediate mode | |
Indirect mode | |
Index mode |
Question 29 |
absolute mode | |
immediate mode | |
indirect mode | |
index mode |
Indirect addressing is a scheme in which the address specifies which memory word or register contains not the operand but the address of the operand.
Immediate Operand: The simplest way for an instruction to specify an operand is for the address part of the instruction actually to contain the operand itself rather than an address or other information describing where the operand is. Such an operand is called an immediate operand because it is automatically fetched from memory at the same time the instruction itself is fetched. It is immediately available for use.
Index 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.
Question 30 |
the operand in decimal form | |
the address of the location where the value of the operand is stored
| |
the address of the location where the address of the operand is stored
| |
the operand in an encoded form |
→ Indirect addressing is a scheme in which the address specifies which memory word or register contains not the operand but the address of the operand.
Example: LOAD R1, @R2 Load the content of the memory address stored at register R2 to register R1.
Question 31 |

a-(iv), b-(iii), c-(i), d-(ii) | |
a-(iv), b-(i), c-(iii), d-(ii) | |
a-(iv), b-(ii), c-(i), d-(iii) | |
a-(iv), b-(iii), c-(ii), d-(i) |
Immediate→ Registers which are in CPU
Register→ Specified in the register
Register Indirect→ Specified implicitly in the definition of instruction
Question 32 |
Base indexed | |
Base indexed plus displacement | |
Indexed | |
Displacement |
Question 33 |
Immediate | |
Implied | |
register | |
indexed | |
None of the above |
Question 34 |
1, 3, 9, 19 | |
1, 4, 9, 18 | |
1, 4, 8, 19 | |
1, 8, 8, 20 |
Memory unit= 512K words
512K words of 32 bits each.
Binary instruction code stored in 1 word of memory.
Instruction divided into 4 parts.
1. Operation code= ?
2. Register code= ?
3. Addressing mode (Direct and indirect)
4. Address port= ?
Addressing Mode part = 1 (Direct and indirect)
Operation Code = 32 - 1 - 18 - 8 bits = 5 bits
Register Code = 256 = 28 = 8 bits
Address port = 28 (256kB) * 210 (1024 bytes/kB) = 218 ⇒ 18 bits
final Answer is (1,5,8,18)
Note: None of the options given correct answer. We are given answer according to key given by NTA.
Question 35 |
An instruction is stored at location 500 with it address field at location 501. The address field has the value 400. A processor register R1 contains the number 200. Match the addressing mode (List-I) given below with effective address (List-II) for the given instruction:

Choose the correct option from those given below:
(a)-(iii), (b)-(i), (c)-(iv), (d)-(ii) | |
(a)-(i), (b)-(ii), (c)-(iii), (d)-(iv) | |
(a)-(iv), (b)-(ii), (c)-(iii), (d)-(i) | |
(a)-(iv), (b)-(iii), (c)-(ii), (d)-(i) |

Direct Address = 400
Relative Address = Next Instruction memory location + Direct Address value
= 502 + 400
= 902
Register indirect Address= 200
Indexed Address = Register Indirect Address + Direct Address
= 200 + 400
= 600
Question 36 |
Index mode | |
Auto increment mode | |
Displacement mode | |
Register mode |
→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.
Question 37 |
Register mode | |
Direct mode | |
Displacement mode | |
Immediate mode |
Single memory reference to access data.
No additional calculations to find the effective address of the operand.
Question 38 |
1. Loading internal registers with initial values
2. Perform arithmetic or logical operations on data contained in instructions Which of the following is true?
Only 1 | |
Only 2 | |
Both 1 and 2 | |
Immediate mode refers to data in cache |
Question 39 |
Indirect addressing | |
Direct addressing | |
Zero addressing | |
Index addressing |
For example ADD will do addition of top two elements of the stack and puts the result as the top most element.
Question 40 |
Direct | |
Indirect | |
Immediate | |
Implied addressing |
More over in indirect addresing mode @X should have been given which is a notation for indirect addressing mode.
In implied addressing mode operand is appended in the opcode itself which is not in the above instruction.
Hence the given instruction is direct addressing mode. In direct addressing mode the address of operand is present in the operand part of instruction.
Question 41 |
Direct mode | |
Indirect mode
| |
Relative mode | |
Indexed mode |
Indexed mode is for arrays and structure.
Indirect mode is used for pointers.