Lecture 1
Lecture 1
(CS F363)
BITS Pilani Dr. Raghunath
CS&IS Dept.
Hyderabad Campus
BITS Pilani
Hyderabad Campus
Weightage Nature of
Component Duration Date & Time
(%) Component
Assignments-1 Take Home 12% before mid-sem Open Book
Assignments-2 Take Home 18% after mid-sem Open Book
➢ GCC
➢ These compilers take source code written in high-level languages like C, C++, or
others and generate machine code, which consists of binary instructions that
the CPU can execute directly.
➢ The resulting executable files contain machine code that's specific to the
targeted hardware architecture and can be run on compatible systems without
further translation or interpretation.
Assembly code as Target code: Examples
➢ There are compilers that specifically generate assembly language as their
target output. Some examples include:
➢ Keil C51 Compiler: This compiler is designed for the 8051 microcontroller
architecture. It can compile C code and generate assembly language output
specific to the 8051 microcontroller family.
High-level language as Target code
➢ Some compilers produce a target program written in a human-oriented
programming language rather than the assembly language of some computer.
Changes in
architecture
influence changes
in compilers
Errors
Functions:
• Recognize legal (and illegal) programs
➢ The compiler has a front end to deal with the source language.
➢ Connecting the front end and the back end, it has a formal
structure for representing the program in an intermediate form
whose meaning is largely independent of either language.
➢ The front end determines if the input code is well formed, in terms of
both syntax and semantics.
➢ It decides which values will reside in registers and which values will
reside in memory and inserts code to enforce those decisions.
➢ Lexical Analysis
➢ Syntax Analysis
➢ Code Optimization
➢ Code Generation