FOC Unit 1A Slides
FOC Unit 1A Slides
Reference: Reema Thareja - Programming in C, Oxford University press 2nd Edition, 2015
◦ Computer hardware does all the physical work computers are known for.
◦ Computer Software commands the hardware.
Disk checkers: Used to scan the contents of a hard disk to find files
or areas that are either corrupted in some way, or were not
correctly saved, and eliminate them in order to make the hard drive
operate more efficiently
Disk space analysers: Used for visualizing the disk space usage by
getting the size for each folder (including subfolders) and files in a
folder or drive
➢It uses symbolic codes also known as mnemonic codes that are easy-to-remember
abbreviations, rather than numbers.
➢Examples of these codes include ADD for add, CMP for compare, MUL for multiply, etc.
➢Basically, an assembly language statement consists of a label, an operation code, and one or
more operands.
➢The operand specifies the register or the location in main memory where the data to be processed is
located.
➢machine to another - not designed to be machine independent and hence is not portable.
➢The code written is efficient in terms of execution time and main memory usage.
➢Programs written in assembly language need a translator often known as assembler to convert them into
machine language.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 51
Second Generation – Assembly Language
➢This is because the computer will understand only the language of 1s and 0s and will not
understand mnemonics like ADD and SUB.
➢The following instructions are a part of assembly language code to illustrate addition of two
numbers:
➢ADD AX,BX Adds the contents of AX and BX registers. Stores the result in AX register
➢ Programmers still use assembly language to write parts of applications where speed of
execution is critical, such as video games.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING 52
Third Generation Programming Languages
➢Third Generation Programming Languages are not closely related to the internal architecture of the
computer and is therefore often referred to as high-level languages.
➢A statement written in a high-level programming language will expand into several machine language
instructions.
➢Third Generation Programming Languages include languages such as FORTRAN (FORmula TRANslator) and
COBOL (COmmon Business Oriented Language)
➢Some high-level languages were designed to serve a specific purpose (such as controlling industrial robots
or creating graphics), other languages were flexible and considered to be general-purpose languages.
➢Most of the programmers preferred to use general-purpose high-level languages like BASIC (Beginners’ All-
purpose Symbolic Instruction Code), FORTRAN, PASCAL, COBOL, C++, or Java to write the code for their
applications.
➢A translator is needed to translate the instructions written in high-level language into computer-
executable machine language.
➢For example, the machine language generated by one computer’s C compiler is not the same as the
machine language of some other computer.
➢Therefore, it is necessary to have a C compiler for each type of computer on which the C program has to
be executed.
➢The programs written in such languages are portable between machines. For example, a program written
in standard C can be compiled and executed on any computer that has a standard C compiler.
➢When writing code using a procedural language, the programmer has to tell
the computer how a task is done—add this, compare that, do this if the
condition is true, and so on, in a very specific step-by-step manner.
➢ they are non-procedural, so users concentrate on ‘what’ instead of the ‘how’ aspect of
the task;
➢ the code enhances the productivity of the programmers as they have to type fewer lines
of code to get something done.
➢For example if a report has to be generated that displays the total number of students enrolled in each
class and in each semester.
➢The same code if written in C language or any other 3GL would require multiple lines of code to do the
same task.
➢The only downside of a 4GL is that it does not make efficient use of the machine’s resources.
➢Most constraint-based and logic programming languages and some declarative languages form
a part of the fifth-generation languages. Widely used in artificial intelligence research.
➢Another aspect of a 5GL is that it contains visual tools to help develop a program.
➢Generally, 5GLs were built upon Lisp, many originating on the Lisp machine,
such as ICAD. Then, there are many frame languages such as KL-ONE.
➢Software vendors across the globe currently claim that their software meets
the visual ‘programming’ requirements of the 5GL concept.
➢Today, C has become a popular language and various software programs are
written using this language.
➢Many other commonly used programming languages such as C++ and Java
are also based on C
➢Small size. C has only 32 keywords. This makes it relatively easy to learn.
➢Stable language – ANSI C was created in 1983 and since then it has not been
revised.
➢C is a portable language.
➢C is considered to be the second best language for any task while the first
best language depends on that particular task.
➢C has been used to write compilers, libraries, and interpreters of other programming
languages.