Brief Study On System Programming Language
Brief Study On System Programming Language
Assignment-1
Submitted By:
Rakesh Kumar, 160280687
BTECH(CSE), B(B1)
Submitted To:
Malkeet singh
Assistant professor(CSE)
System software is designed to control and operate the Hardware component of the computer
and to provide an environment for running application software which includes the software
categories such as O.S(Operating System), Device drivers, Utility software etc.
Features
Compared to application languages, the System programming language usually gives more
direct access to the hardware component of the Machine. It also offers more control to the user
Regarding resource Management. System programming languages frequently lack built-
in (I/O) services because a system-software project generally develops its own I/O mechanisms
or builds on top of basic monitor I/O or screen management services.
Compiler
It basically scans the whole code which is written in human readable language i.e. high
level language and converts that into the Assembly level language. It basically works in
Three phases they are:
1. Lexical Analysis: It scans the whole code and Generates the tokens. This work is
done by Lexar.
2. Syntax Analysis: A syntax analyzer or parser takes the input from the Lexar in the
form of Tokens. The parser analyzes the whole token contrary to the production
rules to find any errors in the source code.
3. Semantics Analysis: Semantics is the area of mathematical study of the meaning of
the programming language. It basically checks that the written code is meaningful
or not.
Assembler
It is basically a computer software which converts the assembly level language into the
Machine language. An Assembler is Sometimes called as the compiler of the assembly level
language because it converts it into the machine code.it also provide the work of the Interpreter.
Linker:
It is a tool that merge the object files produced by the separate compilation or assembly and
after doing these works creates an Executable file.
This mainly perform these Tasks: -
1. Search the program to find the library routine used by the program, e.g. – printf(), sqrt().
2. It combines two or more separate object programs and supplies the information needed
to allow references between them.
3. It also helps in RELOCATION.
Loader:
It is a system program that brings an executable file residing on disk into memory and starts
Running.
1. Read executable file’s header to determine the size of text and data segment.
2. Copies instruction and data inti address space.
3. Creates a new address space for the program.
4. Copies argument passed to the program on the stack.
Editors
The term editor is basically referred to the Text editors, which enables many tools helps
programmer to manipulate plain text or Computer files, these are frequently used in computers
for Coding by programmers.
Machine Code:
When a source code written in high level language is converted into low level language i.e.
stream of bits (0’s and 1’s) with the help of compiler and assembler is known as machine code.
2. Compiler: A Literature Review
In Computer, A compiler is a Small program which basically helps in the transformation of the
source code (High level language) into the machine code. The reason behind this
transformation is to create an executable program.
Any programming language written in high level language must be converted into object code
before it’s execution, which is mainly done by a compiler or an interpreter that’s why they play
a very important role in the life of a programmer.
Compilers can be smaller, larger and complex depending upon where it is being used but
systematic analysis and Research by the computer scientist has led to a clearer understanding
of the structure of a compiler or compiler construction, Research into structure of compiler has
discovered tools that make it very easy to create compilers. So that computer science student
can construct a small programming language and develop their own small compiler in few
weeks.
History:
In past years, the computer software’s were basically being written in assembly language. It is
basically more easy and productive for a programmer to write his code in high level language
because the programs written in high level language are portable (which can be reused).
It took many years for a compiler to get established because the code written in high level
language could not perform as well as the hand written assembly code. At that time there was
very limited memory capacity which creates many technical problems for the implementation
of the compilers.
The first compiler was designed and written by Corrado Bohm, in 1951. He did this for his
PhD thesis. The term compiler was Coined by Grace Hooper. The FORTRAN team led by
John W Backus at IBM introduced the first commercially available compiler in 1957.
Self Hosting Compiler:
Like any other software, there are benefits from implementing a compiler in a high-level
language. In particular, a compiler can be self-hosted – that is, written in the programming
language it compiles. Building a self-hosting compiler is a bootstrapping problem, i.e. the first
such compiler for a language must be either hand written machine code or compiled by a
compiler written in another language, or compiled by running the compiler in an interpreter.
1) Neliac:
NELIAC was the brainchild of Harry Huskey— then Chairman of the ACM and a well
known computer scientist (and later academic supervisor of Niklaus Wirth), and supported by
Maury Halstead, the head of the computational center at NEL. The earliest version was
implemented on the prototype USQ-17 computer at the laboratory. It was the world's first self-
compiling compiler - the compiler was first coded in simplified form in assembly language ,
then re-written in its own language and compiled by the bootstrap, and finally re-compiled by
itself, making the bootstrap obsolete.
2) Lisp:
Another early self-hosting compiler was written for Lisp by Tim Hart and Mike Levin at MIT
in 1962. They wrote a Lisp compiler in Lisp, testing it inside an existing Lisp interpreter. Once
they had improved the compiler to the point where it could compile its own source code, it was
self-hosting.
3) Forth:
Compiler Phases:
1. Lexical analysis
2. Syntax analysis
3. Semantic analysis
4. Machine dependent code optimization
5. Code generation
6. Machine independent code optimization
7. Machine code
Lexical analysis:
It scans the whole code and Generates the tokens. This work is done by Lexar.
Syntax analysis:
A syntax analyzer or parser takes the input from the Lexar in the form of Tokens. The parser
analyzes the whole token contrary to the production rules to find any errors in the source code.
Semantics Analysis:
Semantics is the area of mathematical study of the meaning of the programming language. It
basically checks that the written code is meaningful or not.
Code generation:
Code generation can be considered as the final phase of compilation. Through post code
generation, optimization process can be applied on the code, but that can be seen as a part of
code generation phase itself. The code generated by the compiler is an object code of some
lower-level programming language, for example, assembly language. We have seen that the
source code written in a higher-level language is transformed into a lower-level language that
results in a lower-level object code, which should have the following minimum properties:
Machine-dependent optimization is done after the target code has been generated and when
the code is transformed according to the target machine architecture. It involves CPU
registers and may have absolute memory references rather than relative references. Machine-
dependent optimizers put efforts to take maximum advantage of memory hierarchy.
Two of the causes of this are CPU clock frequencies increasing much faster than bus
frequencies and new vector units on the processors (e.g., AVX instructions). Compilers are
really good about getting the most use out of processor bandwidth and making sure that the
vector units are kept busy, but often a highly-skilled developer can do a significantly better
job. And that's where you need expertise in assembly.
Going forward, we're much more concerned with performance under a power bound. At the
moment, every compiler on the market is power-oblivious and assumes the processor will be
running at the highest available frequency. To fix this, we're going to need to rebuild the
compiler back-ends, which is another place we need expertise in assembly.
Finally, no higher-level language I know of exposes architectural features such as cache
lines, cache associatively, hyper threading, core count, etc. Developing such a language will
require rethinking the tasks a compiler needs to perform (for one, it will have to have a much
more detailed understanding of the processor architecture). That kind of language ultimately
has to be translated into assembly.
Anything can be written in assembly. Research the damascene and you'll find endless amounts
of 3D visuals built in assembly. Most of these you can't control - but some you can.
Furthermore the people saying "Why would you want to write a game in assembly" must have
not played Rollercoaster Tycoon:
Rollercoaster Tycoon
"Sawyer wrote Rollercoaster Tycoon in x86 assembly language, which was rare for a game
published in the late 1990s. Some functions were written in C for interaction with the Windows
operating system and DirectX."
This is one of the most successful games of all time. You will not believe how well it runs
either
and the sheer amount of things it can handle compared to other games of that day.
This game is 2D isometric simulating 3D camera but none-the less it proves these things are
more than possible.
There will be future changes in micro assembler. It will become more efficient in future.
THE END.