ACompiler
BLoader
CInterpreter
DAssembler
Answer:
B. Loader
Read Explanation:
A Loader is a system program that loads machine language programs into the computer's memory for execution. When a program is compiled or assembled, it exists as a file on secondary storage (like a hard disk). The loader's primary function is to:
Load the program: Transfer the machine language program from secondary storage into the main memory (RAM)
Allocate memory: Assign appropriate memory locations for the program
Relocate addresses: Adjust memory addresses if needed to fit the program into available memory space
Link libraries: Connect the program with necessary library functions
Initialize execution: Prepare the program for execution by setting up the program counter and other registers
Why other options are incorrect:
Compiler: Translates high-level language programs (like C, Java) into machine language or intermediate code, but does not load programs into memory
Interpreter: Executes high-level language programs line by line without producing a complete machine language program
Assembler: Converts assembly language programs into machine language, but does not load them into memory
The loader is an essential component of the operating system that bridges the gap between a stored program and its execution by placing it in the appropriate memory locations.
