You are on page 1of 3

types of loaders and schemes of loaders

Loaders are programs that are responsible for loading executable programs from secondary
storage into the main memory of a computer system. There are several types of loaders,
including:
1. Compile and Go loader: This type of loader loads the source code into the memory,
compiles it, and executes the resulting code. It is commonly used in interpreted
languages.
2. Absolute loader: This type of loader loads the program into a specific memory location
without any modification.
3. Relocating loader: This type of loader loads the program into memory and modifies the
program's object code to adjust memory references based on the final location of the
program in memory.
4. Direct linking loader: This type of loader links all external references to the
corresponding memory locations and loads the program into memory.
5. Dynamic loading loader: This type of loader loads only the necessary parts of the
program into memory when needed.
6. Dynamic linking loader: This type of loader links external references to the
corresponding memory locations at runtime, rather than at load time.
The scheme of loaders involves several steps, which may vary depending on the type of loader.
Generally, the loader scheme includes the following steps:
1. Read the executable file from secondary storage into memory.
2. Allocate memory for the program.
3. Load the program into memory.
4. Perform relocation if necessary.
5. Resolve external references if necessary.
6. Start executing the program.

linkage loader vs dynamic direct linkage


functions v/s macro. suggest which is preferred

1. Functions and macro processors are two different ways of organizing and reusing code
in a program. Functions are defined in high-level languages like C++, Python, or Java
and are executed at runtime. They take input parameters and return a value based on
the logic defined in the function body. They are reusable and modular, making them the
preferred option for complex logic.
2. Macroprocessors, on the other hand, are defined in low-level languages like assembly or
C preprocessor directives. They execute at compile time and use text substitution to
replace placeholders in the code with actual values. They do not take input parameters
or return a value, and their code is not reusable. They are preferred for repetitive tasks
and for optimizing code by removing duplication.
3. In summary, functions are preferred for complex logic where code reuse and modularity
are important, while macro processors are preferred for repetitive tasks where code
optimization and duplication removal are important.

You might also like