Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
72 views

Brief Study On System Programming Language

The document summarizes an assignment submitted by Rakesh Kumar on system programming languages. The 3-page assignment includes a brief study on system programming languages, a literature review on compilers, and future trends in assemblers. It discusses the need for system software, features of system programming languages, and the phases of compilation from source code to machine code.

Uploaded by

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

Brief Study On System Programming Language

The document summarizes an assignment submitted by Rakesh Kumar on system programming languages. The 3-page assignment includes a brief study on system programming languages, a literature review on compilers, and future trends in assemblers. It discusses the need for system software, features of system programming languages, and the phases of compilation from source code to machine code.

Uploaded by

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

System Programming (BTCS-405A)

Session: Jan-May, 2018

Assignment-1

1. Brief Study on System Programming Languages.


2. The Compiler: A Literature Review
3. Future trends in Assembler

Submitted By:
Rakesh Kumar, 160280687
BTECH(CSE), B(B1)

Submitted To:
Malkeet singh
Assistant professor(CSE)

SAHEED BHAGAT SINGH STATE TECHNICAL CAMPUS


Moga road(NH-95), Ferozepur-152004
March 2018
Brief study on System Programming Language
A System Programming Language is also Known as programming language which is basically
used for system programming. These languages are developed for writing system software.

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.

Need of system software


1. To achieve efficient performance of the system.
2. To make effective execution of general user program.
3. To make effective utilization of human resources.
4. To make available new, better facilities.

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.

System Programming language phases


1. Source Code
2. Compiler
3. Assembler
4. Linker & Loader
5. Editor
6. Machine code
Source Code
It is mainly a set of Instructions called Program Written in Human Readable Programming
language i.e. High level language. The source code facilitates the work of computer
programmers so that they can easily manipulate the system and get the desired output.

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.

This mainly perform these tasks: -

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:

Forth is an example of a self-hosting compiler. The self-compilation and cross compilation


features of Forth are commonly confused with metacompilation and metacompilers. Like Lisp,
forth is an extensible programming language. It is the extensible programming language
features of Forth and Lisp that enable them to generate new versions of themselves or port
themselves to new environments.

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.

Machine independent code optimization:


It is a program transformation technique which transforms the whole code in such a way so
that it consumes less memory and resources of CPU.
The various code optimization techniques are as follows:

1. In lining small functions.


2. Code hoisting.
3. Dead store elimination.
4. Eliminating common sub-expressions.
5. Loop unrolling.

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:

 It should carry the exact meaning of the source code.

 It should be efficient in terms of CPU usage and memory management.


Machine dependent code optimization:

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.

3.Future trends of Assembler:

In high-performance computing we have traditionally measured a machine's capacity in


terms of floating-point (as opposed to integer) operations per second. Several years ago
people started pointing out a worrying trend that applications were only using 70-80% of
these FLOPS, and the figure appeared to be decreasing. We're now around 10% of
theoretical peak flops for applications we care about (known colloquially as "not linpack").

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.

So at least in the high-performance community, we're going to continue to be hiring


developers who understand bare-metal programming.
 Should video game programmers learn assembly language? Why or why not?
 Is it easy to maintain a game that is written in assembly language?
 Was the first assembler written in machine language?
 In what language was C written?
 Were play station 1 games written mainly in C or MIPS assembly?

Ryan Rentfro, Lifelong Software Engineer and OOP evangelist.


Answered Jan 1, 2016 · Author has 206 answers and 825.7k answer views.

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.

3D video game in assembler.

Micro-Assembler: - It is also called meta assembler . A micro-assembler is a computer program


that helps prepare a microprogram to control the low level operation of a computer in much
same way an assembler helps prepare higher level code for a processor. The microgram defines
the instruction set any normal program (including both application programs and operating
system) is written in. The use of micro-computer allows the manufacturer to fix certain
mistakes, including working around hardware design errors, without modify the hardware.
Another means of employing micro assembler –generated micro programs are in allowing the
same hardware to run different instruction set. After it is assembled, the microprogram is then
loaded to a store to become part of the logic of a CPU’s control unit. If a given computer
implantation supports a writeable control store, the micro assembler is usually provided to
customers as a means of writing customized microcode.
Features of Micro Assembler – The features of micro assembler are –
1. The use of Concatenation to type-specific instruction
2. Some standard system variable symbol
3. Conditional Assembly
4. The ABEND macro and its use in signaling run-time errors

There will be future changes in micro assembler. It will become more efficient in future.

THE END.

You might also like