Nielit Scientist-B CS 2016 march
May 27, 2024Question 1274 – Nielit Scientist-B CS 2016 march
May 27, 2024Question 1273 – Nielit Scientist-B CS 2016 march
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?
Correct Answer: D
Question 9 Explanation:
→ Pointer access requires indirect addressing which can be simulated with indexed addressing or register indirect addressing but not with direct and immediate addressing.
→ 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.
→ 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.
Pointers
Arrays
Records
All of these
Subscribe
Login
0 Comments