0% found this document useful (0 votes)
2 views16 pages

Lec-2.1 Language Processing System

The document outlines the components and functioning of a Language Processing System, which translates high-level programming languages into machine-level language that computers can understand. It details the roles of various components including the Preprocessor, Compiler, Assembler, Linker, and Loader in the process of code execution. The document emphasizes the importance of these components in enabling programmers to write code in a more comprehensible format while ensuring it can be executed by hardware.

Uploaded by

hexo0064
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views16 pages

Lec-2.1 Language Processing System

The document outlines the components and functioning of a Language Processing System, which translates high-level programming languages into machine-level language that computers can understand. It details the roles of various components including the Preprocessor, Compiler, Assembler, Linker, and Loader in the process of code execution. The document emphasizes the importance of these components in enabling programmers to write code in a more comprehensible format while ensuring it can be executed by hardware.

Uploaded by

hexo0064
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

System Software Full Course

Click Here to Watch Complete Course

Language Processing System


Watch Lecture on YouTube
Agenda
❖Introduction
❖What is a Language Processor?
❖Diagram – Language Processing System
❖Components of Language Processing System
Introduction
The computer is an intelligent combination of software and hardware.
Hardware is simply a piece of mechanical equipment and its functions
are being compiled by the relevant software.
The hardware considers instructions as electronic charge, which is
equivalent to the binary language in software programming.
The binary language has only 0s and 1s. To enlighten, the hardware
code has to be written in binary format, which is just a series of 0s and
1s.
Writing such code would be an inconvenient and complicated task for
computer programmers, so we write programs in a high-level language,
which is convenient for us to comprehend and memorize.
These programs are then fed into a series of devices and operating
system (OS) components to obtain the desired code that can be used
by the machine. This is known as a language processing system.
Language Processor
We know that computers can understand only machine level language,
which is in binary 1 or 0.
The code written in any high-level or low-level languages should be
translated into machine level language and Language Processors are
used for this purpose.
These translators are just computer programs, which accept a program
written in high level or low level language and produce an equivalent
machine language program as output.
E.g. Assembler, Compiler & Interpreter
Language Processing System
Source Code Pre Processor

Expanded Code

Compiler

Assembly Code

Assembler

Object Code

Linker
Executable Code

Loader

Memory
Let us first understand how a program, using C compiler, is executed on
a host machine.
▪ User writes a program in C language (high-level language).
▪ The C compiler, compiles the program and translates it to assembly
program (low-level language).
▪ An assembler then translates the assembly program into machine
code (object).
▪ A linker tool is used to link all the parts of the program together for
execution (executable machine code).
▪ A loader loads all of them into memory and then the program is
executed.
Components of Language Processing System
1. Preprocessor
2. Compiler
3. Assembler
4. Linker
5. Loader
Preprocessor
A Preprocessor is a system software (a computer program that is
designed to run on computer’s hardware and application programs).
It performs preprocessing of the High Level Language(HLL).
Preprocessing is the first step of the language processing system.
A Preprocessor mainly performs three tasks on the HLL code :
i. Removing comments : It removes all the comments. A
comment is written only for the humans to understand
the code. So, it is obvious that they are of no use to a
machine. So, preprocessor removes all of them as they
are not required in the execution and won’t be executed
as well.
ii. File inclusion : Including all the files from library that our program
needs. In HLL we write #include which is a directive for the
preprocessor that tells it to include the contents of the library file
specified.
iii. Macro expansion : Macros can be called as small functions that are
not as overhead to process. If we have to write a function (having a
small definition) that needs to be called recursively (again and
again), then we should prefer a macro over a function. So, defining
these macros is done by preprocessor.
E.g. #define NAME Shubham
Compiler
The compiler takes the modified code as input and produces the target
code as output.

Source Program Compiler Target Program

Error Messages Warnings


Assembler
The assembler takes the target code as input and produces real
locatable machine code as output.
Linker
A linker is a program in a system, also known as a link editor and
binder, which combines object modules into a single object file.
Generally, it is a program that performs the process of linking; it takes
one or multiple object files, which are generated by compiler. And, then
combines these files into an executable files.
The primary function of the linker is to take objects from the assembler
as input and create an executable file as output for the loader
Loader
The loader is special program that takes input of executable files from
linker, loads it to main memory, and prepares this code for execution by
computer.
It calculates the size of a program (instructions and data) and creates
memory space for it.
It initializes various registers to initiate execution.
Executable Code
It is the low level and machine specific code and machine can easily
understand it.
Once the job of linker and loader is done then object code finally
converted into the executable code.
Mail your queries at
[email protected]

company/firstcodeyt @firstcodeyt @firstcodeyt @firstcodeyt

@firstcodeyt

You might also like