edited by
8,532 views
22 22 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$

2 Answers

Best answer
34 34 votes

answer - B

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

edited by
3 3 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:
Position:
Show:

Related questions

35 35 votes
3 answers 3 answers
12.8k
12.8k views
Kathleen asked Sep 25, 2014
12,844 views
In a resident – OS computer, which of the following systems must reside in the main memory under all situations?AssemblerLinkerLoaderCompiler
36 36 votes
2 answers 2 answers
13.1k
13.1k views
Kathleen asked Sep 25, 2014
13,102 views
Faster access to non-local variables is achieved using an array of pointers to activation records called a stackheapdisplayactivation tree
30 30 votes
2 answers 2 answers
16.2k
16.2k views
Kathleen asked Sep 25, 2014
16,222 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...
27 27 votes
1 answers 1 answer
15.0k
15.0k views
Kathleen asked Sep 26, 2014
15,025 views
Let the attribute ‘$val$’ give the value of a binary number generated by $S$ in the following grammar:$S \rightarrow L.L \mid L$$L \rightarrow LB \mid B$$B \rightarrow 0 ...