A linker reads four modules whose lengths are 200, 800, 600 and 500 words…

1998

A linker reads four modules whose lengths are 200, 800, 600 and 500 words respectively. If they are loaded in that order, what are the relocation constants?

Answer: B. 0, 200, 1000, 1600A relocation constant is the starting address assigned to a module when the linked program is loaded. The first module starts at 0. The second module starts…

  1. A.

    0, 200, 500, 600

  2. B.

    0, 200, 1000, 1600

  3. C.

    200, 500, 600, 800

  4. D.

    200, 700, 1300, 2100

Attempted by 63 students.

Show answer & explanation

Correct answer: B

A relocation constant is the starting address assigned to a module when the linked program is loaded. The first module starts at 0. The second module starts after the first 200 words, so its relocation constant is 200. The third starts after the first two modules, 200 + 800 = 1000. The fourth starts after the first three modules, 200 + 800 + 600 = 1600. The final length 500 determines the end address 2100, not another relocation constant. Therefore, the relocation constants are 0, 200, 1000, 1600, so option B is correct.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…