Correct option is C
A
macro is a named sequence of instructions or statements that is expanded into its corresponding code whenever the macro is invoked, so it is primarily used for
code expansion.
An
assembler translates assembly language instructions into machine/object code that can be processed further.
A
loader is responsible for placing the executable program into main memory and performing required
relocation and memory allocation activities. A
compiler translates a high-level programming language into object or machine-level code, often through several intermediate stages.
Information Booster
1.
Macros → Code Expansion
· A macro represents a predefined sequence of statements that can be invoked using a macro name.
· During
macro expansion, the macro call is replaced by the corresponding sequence of statements.
· It reduces repetitive coding and improves programmer convenience.
· Macro processors may operate as part of an assembler or as a separate preprocessing stage.
2.
Assembler → Assembly to Object Code
· An assembler converts
assembly language instructions into machine/object code.
· It resolves symbolic names, labels, and instruction mnemonics.
· A
two-pass assembler commonly uses one pass to construct the symbol table and another to generate the object code.
· Examples of assembly instructions include MOV, ADD, SUB, and JMP, depending on the instruction set.
3.
Loader → Memory Allocation and Relocation
· A loader loads the executable program from secondary storage into
main memory.
· It determines appropriate memory locations for the program and may perform
relocation when required.
· Relocation adjusts address-dependent information when a program is loaded at an address different from the one assumed during translation.
· Loading is performed after the program has been translated and linked.
4.
Compiler → High-Level Language Translation
· A compiler translates a
high-level language into a lower-level representation, commonly producing object code through the compilation process.
· Major compiler phases include
lexical analysis, syntax analysis, semantic analysis, intermediate code generation, optimization, and target-code generation.
· Unlike an assembler, a compiler works with higher-level programming constructs such as variables, expressions, functions, and control structures.