0% found this document useful (0 votes)
4 views

TPL2

Uploaded by

shafiqfiverr345
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

TPL2

Uploaded by

shafiqfiverr345
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Language Processing Systems

Converting a high-level language into a low-level language takes multiple steps and involves many
programs apart from the Compiler. Before the compilation can start, our source code needs to be
preprocessed. After the compilation, our code needs to be converted into executable code to execute
on our machine. These essential tasks are performed by the preprocessor, assembler, Linker, and
Loader. They are known as the Cousins of the Compiler.

High-Level Language: If a program contains pre-processor directives such as #include or #define


it is called HLL. They are closer to humans but far from machines. These (#) tags are called
preprocessor directives. They direct the pre-processor about what to do.
Pre-Processor: The pre-processor removes all the #include directives by including the files called
file inclusion and all the #define directives using macro expansion. It performs file inclusion,
augmentation, macro-processing, etc.
Interpreter: An interpreter converts high-level language into low-level machine language, just like a
compiler. But they are different in the way they read the input. The Compiler in one go reads the
inputs, does the processing, and executes the source code whereas the interpreter does the same
line by line. A compiler scans the entire program and translates it as a whole into machine code
whereas an interpreter translates the program one statement at a time. Interpreted programs are
usually slower concerning compiled ones.
Assembly Language: It's neither in binary form nor high level. It is an intermediate state that is a
combination of machine instructions and some other useful data needed for execution.
Assembler: For every platform (Hardware + OS) we will have an assembler. They are not universal
since for each platform we have one. The output of the assembler is called an object file. It translates
assembly language to machine Code.
Relocatable Machine Code: It can be loaded at any point and can be run. The address within the
program will be in such a way that it will cooperate with the program movement.
Loader/ILinker: Loader/Linker converts the relocatable code into absolute code and tries to run
the program resulting in a running program or an error message (or sometimes both can happen).
Linker loads a variety of object files into a single file to make it executable. Then loader loads it in
memory and executes it.
Efficiency of a Program Code
The efficiency of a programming code is directly proportional to the algorithmic efficiency and the
execution speed. Good efficiency ensures higher performance.
The factors
that affect the efficiency of a program includes:
• The speed of the machine
• Compiler speed
• Operating system
• Choosing right Programming language
• The way of data in a program is organized
• Algorithm used to solve the problem
The efficiency of a programming language can be improved by performing the following tasks -
• By removing unnecessary code or the code that goes to redundant processing.
• By making use of optimal memory and nonvolatile storage By making the use of reusable
components wherever applicable.
• By making use of error & and exception handling at all layers of the program.
• By creating programming code that ensures data integrity and consistency.
• By developing the program code that's compliant with the design logic and flow.
An efficient programming code can reduce resource consumption and completion time as much as
possible with mininmum risk to the operating environment.

You might also like