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 I
List II
P. Immediate
1. Element of an array
Q. Indirect
2. Pointer
R. Base with index
3. Element of a record
S. Base with offset/displacement 4. Constant

Show Hint

Immediate = constant, Indirect = pointer (address of an address), Base+index = array element (varying subscript), Base+offset = record field (fixed displacement) - giving P-4, Q-2, R-1, S-3.
Updated On: Jul 7, 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

We must match each addressing mode with the kind of high-level-language data element it is typically used to access.

Step 1: P. Immediate addressing.

In immediate addressing, the operand value is embedded directly in the instruction itself - there is no memory access to fetch the operand. This directly corresponds to a constant in a high-level language (item 4). So P -> 4.

Step 2: Q. Indirect addressing.

In indirect addressing, the instruction holds the address of a location that itself contains the address of the operand (an address of an address). This is exactly how a pointer variable works in a high-level language - the pointer holds an address that must be dereferenced to reach the data. So Q -> 2.

Step 3: R. Base with index addressing.

Here the effective address is computed as base register + index register, and the index is typically varied (e.g., in a loop) to walk through consecutive memory locations. This is the standard way compilers implement access to an element of an array - base = array start address, index = the array subscript. So R -> 1.

Step 4: S. Base with offset/displacement addressing.

Here the effective address is base register + a fixed constant offset known at compile time. This is exactly how a compiler accesses a specific named field inside a structure - base = address of the record/structure, offset = the fixed byte distance to that particular field. So S -> 3, i.e., element of a record.

Step 5: Combine the matches.

P-4, Q-2, R-1, S-3.

Final Answer: P-4, Q-2, R-1, S-3, option (B).

Was this answer helpful?
0
0

Top GATE CS Computer Science and IT Engineering Questions

View More Questions

Top GATE CS Computer Organization and Architecture Questions

View More Questions