COMPILER DESIGN

CODE GENERATION

ROLE OF CODE GENERATION

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Translates source code from high level languages into object code and then into machine code
A
Assembler
B
Compiler
C
Interpreter
D
None of the above
Explanation: 

Detailed explanation-1: -The correct answer is Compiler. A compiler takes the program code (source code) and converts the source code to a machine language module (called an object file).

Detailed explanation-2: -A program that converts a high-level language source file into a machine-language file is called a compiler.

Detailed explanation-3: -Compilers convert high-level language code to machine (object) code in one session. Compilers can take a while, because they have to translate high-level code to lower-level machine language all at once and then save the executable object code to memory.

Detailed explanation-4: -A translator is required to translate the assembly language to machine language. This translator program is called the ‘assembler.

There is 1 question to complete.