Introduction to Compiler Design || Lesson 3 || Compiler Design || Learning Monkey ||

preview_player
Показать описание
Introduction to Compiler Design
In this class, We discuss Introduction to Compiler Design.
The reader should have prior knowledge of understanding the compiler. Click Here.
To understand the concept, the reader should understand previous classes.
We take an example and understand the concept of the compiler.
Example:
#include stdio.h
#define z 8
main ()
{
int x, y;
x= z * y;
}
We should convert the program from a high-level language to a machine-level language.
Different programs will execute along with the compiler to convert the source code to machine code.
The above program has a header file and a macro.
We need some of the code presented in the header file.
We use the macro to replace z with 8.
The below diagram shows the different programs and their responsibilities during conversion.
We give the source program as input to the pre-processor.
The pre-processor will replace the macro value in the source code.
The output of the pre-processor is the modified source program.
We give the modified source program as input to the compiler.
The compiler will output the target assembly code.
In our following classes, we discuss them in detail compiler.
We give the target assembly code as input to the assembler.
The assembler will output relocatable machine code.
For relocatable machine code understanding, click here.
We give the relocatable code as input to the linker and loader.
Suppose the source program uses a code present in some other file.
The linker software is responsible for getting the address of the other file.
The relocatable code for library files is present in the lib folder.
The loader will take the code brought from the linker, the relocatable source code, and the relocatable library code. And convert to target machine code.
Link for playlists:

Рекомендации по теме
Комментарии
Автор

00:07 Introduction to Compiler Design
00:56 Understanding roles and responsibilities of compilers
01:39 The preprocessor in compiler design converts macros and comments into machine level code.
02:29 Compiler converts modified program to assembly code
03:21 Explanation of assembler program and relocatable machine code conversion
04:10 Linking software provides address for placing code in random access memory
04:59 Loader converts source code to target machine code
05:52 Introduction to compiler design and its role in converting files into machine code.

surajr