edited by
5,820 views
18 votes
18 votes

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?

  1. $0, 200, 500, 600$
  2. $0, 200, 1000, 1600$
  3. $200, 500, 600, 800$
  4. $200, 700, 1300, 2100$
edited by

2 Answers

Best answer
27 votes
27 votes

answer - B

first module loaded starting at address $0$. Size is $200$. hence it will occup first $200$ address last address being $199$. Second module will be present from $200$ and so on.

edited by
0 votes
0 votes
  1. Module 1 (Length: 200 words):

    • Starting Address: 0 (No preceding modules)
  2. Module 2 (Length: 800 words):

    • Starting Address: 200 (Length of Module 1)
  3. Module 3 (Length: 600 words):

    • Starting Address: 1000 (Sum of lengths of Modules 1 and 2)
  4. Module 4 (Length: 500 words):

    • Starting Address: 1600 (Sum of lengths of Modules 1, 2, and 3)

Therefore, the relocation constants for each module are as follows:

  1. Module 1: 0
  2. Module 2: 200
  3. Module 3: 1000
  4. Module 4: 1600
Answer:

Related questions

26 votes
26 votes
3 answers
1
Kathleen asked Sep 25, 2014
9,315 views
In a resident – OS computer, which of the following systems must reside in the main memory under all situations?AssemblerLinkerLoaderCompiler
28 votes
28 votes
1 answer
2
Kathleen asked Sep 25, 2014
8,681 views
Faster access to non-local variables is achieved using an array of pointers to activation records called a stackheapdisplayactivation tree
24 votes
24 votes
2 answers
3
Kathleen asked Sep 25, 2014
12,606 views
Which of the following statements is true?SLR parser is more powerful than LALRLALR parser is more powerful than Canonical LR parserCanonical LR parser is more powerful t...