Question:

Match each addressing mode in List I with a data element or an element of a data structure (in a high-level language) in List II:
List IList II
P. Immediate1. Element of an array
Q. Indirect2. Pointer
R. Base with index3. Element of a record
S. Base with offset/displacement4. Constant

Show Hint

Immediate stores a constant, Indirect fetches an address which behaves like a pointer, Base+index walks arrays, and Base+displacement reaches fixed-offset record fields.
Updated On: Jul 22, 2026
  • P-4, Q-3, R-1, S-2
  • P-4, Q-2, R-1, S-3
  • P-1, Q-4, R-3, S-2
  • P-2, Q-3, R-1, S-4
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Step 1: Recall what each addressing mode in List I does.

P. Immediate: the operand value is encoded directly inside the instruction, no memory or register access is needed to fetch it. In a high-level language, a fixed literal such as 5 or 'A' that never changes is exactly this, so Immediate addressing is used to hold a Constant (List II item 4).

Q. Indirect: the instruction supplies a register that does not itself contain the operand, it contains the address of the operand. This is exactly how a Pointer works in a high-level language, a pointer variable stores the address of the real data, and dereferencing it is one level of indirection, matching indirect addressing (List II item 2).

R. Base with index: the effective address is base register plus an index register, and the index register is meant to change from one access to the next. This is the standard way a compiler accesses an element of an array, a[i], the base register holds the array's starting address and the index register holds i, so as i varies the same instruction walks through the array (List II item 1).

S. Base with offset/displacement: the effective address is base register plus a constant offset fixed at compile time. This matches accessing an element of a record, a struct or object field, the base register holds the record's starting address and each field sits at a fixed, compile-time-known displacement from that base (List II item 3).

Step 2: Combine the matches. P-4 (Immediate to Constant), Q-2 (Indirect to Pointer), R-1 (Base with index to Array element), S-3 (Base with offset to Record element). This is exactly option (B).

Step 3: Why the other options are wrong. Option (A) swaps Q and S, pairing Indirect with record element and base-with-offset with pointer, which is backwards, indirect addressing stores an address rather than a fixed compile-time offset, so it is the pointer case, not the record-field case. Option (C) pairs Immediate with array element and Indirect with constant, contradicting the basic definition of Immediate addressing, since a constant baked into the instruction cannot be an array element needing its own address. Option (D) pairs Immediate with pointer and base-with-offset with constant, again wrong since an immediate operand has no address of its own to serve as a pointer, and a fixed displacement is not a standalone constant value being read.

\[ \boxed{\text{P-4, Q-2, R-1, S-3 (option B)}} \]
Was this answer helpful?
0
0

Top GATE CS Computer Organization and Architecture Questions

View More Questions