In the standard segmentation loading sequence, after the compiler or assembler…

2023

In the standard segmentation loading sequence, after the compiler or assembler has constructed the program segments, which of the following assigns segment numbers to the prepared code, data, and other segments?

Answer: C. LoaderConceptSegmentation divides a program into variable-sized logical units, such as code, data, stack, and procedure segments. A logical address is represented…

  1. A.

    Compiler

  2. B.

    Assembler

  3. C.

    Loader

  4. D.

    Linker

Attempted by 359 students.

Show answer & explanation

Correct answer: C

Concept

Segmentation divides a program into variable-sized logical units, such as code, data, stack, and procedure segments. A logical address is represented by a segment number together with an offset within that segment.

Under the standard loading convention, constructing segments and assigning their numbers are separate stages: the compiler or assembler constructs the logical segments, while the loader assigns numbers to the prepared segments during loading.

Application

  1. The compiler or assembler produces object material organized into code, data, and other logical segments.

  2. The linker combines the required object modules and resolves external references to form the executable image.

  3. The loader receives those prepared segments, assigns their segment numbers during loading, and places them in memory for execution.

  4. At run time, each segment-number-and-offset address is mapped through the segment table to the segment’s memory location.

Cross-check and contrast

  • Compiler: translates high-level source and constructs logical program segments before loading.

  • Assembler: translates assembly source and processes segment-defining directives before loading.

  • Loader: loads prepared segments and assigns their segment numbers during the loading stage.

  • Linker: combines object modules and resolves external symbols before loading.

Therefore, the component asked for is the Loader.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…