Skip to content
Official PYQ · 1999

GATE CS 1999 Q2.23 — Machine Instructions and Addressing Modes

Explain with AI

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?

Select all correct options
View worked solution

Answer: A;B;C;D

To implement high-level programming language features, specific addressing modes are required. A processor supporting only immediate and direct addressing modes cannot support the following features:

  • Pointers (A): Dereferencing a pointer requires accessing a memory location whose address is stored dynamically inside another variable or register. This requires indirect addressing, which is unavailable.
  • Arrays (B): Accessing an element A[i]A[i] where index ii is determined at runtime requires computing the address dynamically as Base+i×size\text{Base} + i \times \text{size}. This requires indexed or register-indirect addressing.
  • Records (C): General records (especially when allocated dynamically or passed by reference) require base-register with displacement addressing to access fields at runtime.
  • Recursive procedures with local variables (D): Recursion requires a dynamic stack. Local variables inside recursive calls are stored in activation records on the stack, requiring stack-pointer relative or base-register addressing to access them. Direct addressing cannot resolve these dynamic stack addresses.

Thus, none of these features can be implemented on the given processor, making all options correct.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Machine Instructions and Addressing Modes questions