Professional Documents
Culture Documents
Chapter 3
Chapter 3
Chapter 3
3.1.Assembler
3.2.Assembly Language
3.3.Loaders and Linkers
3.4.Compilers
3.5.Interpreters
3.1. Assembler
Introduction
System software refers to the files and programs that make up the computer's operating system.
System files consist of libraries of functions, system services, drivers for printers, other hardware,
system preferences and various configuration files.
System Software consists of the following programs:
Assemblers
Compilers
System Utilities
Debuggers
The system software is installed on the computer when the operating system is installed. The
software can be updated by running programs such as "Windows Update" for Windows or "Software
Update" for Mac OS X. Application programs are used by end user, whereas system software is not
meant to be run by the end user. For example, while Web browser like Internet Explorer are used by
users every day, they don't have to use an assembler program (unless the user is a computer
programmer).
System software runs at the most basic level of the computer and hence it is called "low-level"
software. User interface is generated by the system software and allows the operating system to
interact with the hardware.
System software is the interface between the computer hardware and the application software.
Assembler
An assembler is a program that converts basic computer instructions into a pattern of bits. These bits
are used by computer's processor to perform its basic operations. Some people call these
instructions as assembler language and others use the term assembly language. This is how it
works:
Most computers come with a specified set of very basic instructions that corresponds to the basic
machine operations that the computer can perform. For example, a "Load" instruction moves a string
of bits from a location in the processor's memory to a special holding place called a register. In
computer architecture, a processor register is a small amount of storage available on the CPU and
the contents of register can be accessed more quickly. Most of the modern computer architectures
operate on the principle of shifting data from main memory into registers, operate on the data and
then move the result back into main memory. Assuming the processor has at least eight numbered
registers, the following instruction would move the value (string of bits of a certain length) at memory
location 2000 into the holding place called register 8:
L 8,2000
These assembler instructions, which are also known as the source code or
source program, is then specified to the assembler program when it is started.
The output of the assembler program is called the object code or object
program relative to the input source program. The object program consisting of
a sequence of 0's and 1's is also known as machine code.
Related Videos:
Next
Assembly Language
Ask a Doubt:
Misuse of 'Ask a Doubt' Section will be dealt as per the Terms & Conditions of Campus Commune
Note: Please do not use the doubts section for any quiz/quiz-content related queries.
Use the helpline () located above in top right corner for problems/queries related to quizzes.
Open Doubts
Closed Doubts
Nishi Aryan
My Doubts
about 13 hours ago
once we failed in course completion quiz, will I be permitted again for this quiz continuing my
previous scores????????
Madhusudhana KA
Reply
Reply
can any one tell me, how many times I can give a specific test?
Lali Vyshnavi
Reply
Ashish
Reply
Durgesh Tiwari
it is written that miles earned from stage 1 will not be added in final mile count....does it mean that
we just need to pass stage 1 and the amount of marks scored does not matter ??
Veera Yerraguntla
Reply
Shalu Priya
Ya the amount of marks scored does not matter..but from stage 2 it matters
Suganya Sivakumar
Reply
Buddh Singh
Reply
Assembly lang is symbolic lang so when you pass instructions written in assembly through an
assembler they get converted into machine code they represent. which is what the CPU and its
various co-processors interpret and execute (its generally taken down into smaller units by the CPU,
called micro-ops). if you have to learn more you can follow this link
http://proquest.safaribooksonline.com/book/engineering/032124656x
Prajakta Barhate
Mohd Aliyan
Application Software
Ravikishan Divvela
The software that provides access to internet is DRIVER for NIC(Network interface Card). Any
DRIVER is a "System software".
Subhajit Barh
Actually Browser(which is an Application Software) lets you visits the web pages and renders all the
html or java script to nice readable text or images but Operating System such as windows handles
all the nics(Network Adapters) and the protocols(Like TCP and UDP) and lets the data flow in and
out. So technically both lets you have internet connection
Subhajit Barh
Actually Browser(which is an Application Software) lets you visits the web pages and renders all the
html or java script to nice readable text or images but Operating System such as windows handles
all the nics(Network Adapters) and the protocols(Like TCP and UDP) and lets the data flow in and
out. So technically both lets you have internet connection
Likhitha Kurupati
System software
Abhishek Gupta
application software
Abhishek Gupta
application software
Abhishek Gupta
application software
Abhishek Gupta
application software
Abhishek Gupta
application software
Abhishek Gupta
application software
Abhishek Gupta
application software
Abhishek Gupta
Abhishek Gupta
application software
Suganya Pachiappan
Sankalp Bhatt
Yes. There value changes with the instructions that are being executed by the processor.
Sankalp Bhatt
Please correct.Their value changes with the instructions that are being executed by the processor.
Satish Prasad
Yes, it stores the value upto when there is no new instruction execution
Mohd Aliyan
Yes it is a temporary storage and for the fast execution of the resources we need it and it is a costly
memory unit so the size of register is limited.
Rajarshee Tribedi
Mohd Aliyan
Reply
object code is converted back to the original instruction so we need assembly listing for example for
ADD the code is 1 for sub it is 2 so for transition of source code to instructions we need this listing
Previous
CC India
Next
Campus Commune
My Channels
Home
Index
3.1.Assembler
3.2.Assembly Language
3.3.Loaders and Linkers
3.4.Compilers
3.5.Interpreters
Go to Doubts
Assembly language program consists of mnemonic codes which are easy to remember as they are
similar to words in English language. It consists of mnemonic codes for each of the different machine
code instructions that the machine understands. A mnemonic is an abbreviation of the actual
instruction. It is a programming code that is easy to remember because the codes resemble the
original words, for example, ADD for addition and SUB for subtraction. Examples of assembly
language program:
MOV EAX,2 ; set eax register to 2 (eax = 2)
SHL EAX,4 : shift left value in the register
MOV ECX,16 ; set ecx register to 16
SUB EAX,EBX ; substracts ecx from eax
An assembler converts this set of instructions into a series of 1s and 0s, also known as a executable
program, that the machine can understand.
Assembly language can be used for communication with the machine at the
hardware level and hence it is often used for writing device drivers.
Assembly language statements are written one on each line. A machine code program consists of a
sequence of assembly language statements in which each statement contains a mnemonic. A line of
an assembly language program can contain the following four fields:
i. Label
ii. Opcode
iii. Operand
iv. Comments
The label field is optional. A label is an identifier or a text. Labels are used in programs to reduce
reliance upon programmers remembering where data or code is located.A label is used to refer to
the following:
Memory location
A data value
The maximum length of a label differs for different types of assemblers. Some assemblers accept up
to 32 characters long, others only four characters. When a label is declared, it is suffixed by a colon,
and begins with a valid character (A..Z). Consider the following example.
LOOP: LDAA #24H
Here, the label LOOP is equal to the address of the instruction LDAA #24H. The label can be used
as a reference in a program, as shown below
JMP LOOP
When the above instruction is executed, the processor will execute the instruction associated with
the label LOOP, i.e.LDAA #24H. When a label is referenced later in a program, it is referenced
without the colon suffix.
An advantage of using labels is that inserting or re-arranging code statements do not require reworking actual machine instructions. It only requires a simple re-assembly. In hand-coding, changes
can take hours to perform.
The opcode field consists of a mnemonic. Opcode is the operation code, ie, a machine code
instruction. Opcode may also have additional information in the form of operands Operands are
separated from the opcode by using a space.
Operands consists of additional information or data that the opcode requires. Operands are used to
specify
Constants or labels
Immediate data
An address
Examples of operands
LDAA 0100H ; two byte operand
LDAA LOOP ; label operand
LDAA #1 ; immediate operand (i.e constant value as operand)
The comment field is optional, and is used by the programmer to explain how the coded program
works. The comments are prefixed by a semi-colon. Comments are ignored by the assembler when
the instructions are generated from the source file.
Related Videos:
Previous
Assembler
Next
Loaders and Linkers
Ask a Doubt:
Misuse of 'Ask a Doubt' Section will be dealt as per the Terms & Conditions of Campus Commune
Note: Please do not use the doubts section for any quiz/quiz-content related queries.
Use the helpline () located above in top right corner for problems/queries related to quizzes.
Submit
Open Doubts
Closed Doubts
My Doubts
Amol Baykar
Lokesh Khushwani
Reply
Lokesh Khushwani
Jayasuruthi Loganathan
Reply
about 5 days ago
Sankalp Bhatt
Java programs actual compile in a virtual environment known as Java Virtual Machine. JVM
understands byte codes(codes of a .class file) and convert them into machine code.. So, you see it
becomes independent of OS and processor as JVM has to do the conversion of byte codes to
machine code. Therefore, no matter what the OS or processor is just get JVM and execute any
.class file.
Gaurav Garg
Java code after compilation gets converted into Byte-code(highly optimized set of instructions). This
Byte code is the key behind platform independency of java. Byte code is platform independent
sequence of code ,Platform specific JVMs convert this byte code into runnable code , that's why java
is platform independent.
Nithin
JVM makes java platform independent. Because of JVM we say java is portable.
Suganya Pachiappan
Sankalp Bhatt
Reply
Sri Gollapudi
Aditi Dosi
NO , we can't.
Kajal Nayak
Sankalp Bhatt
Reply
Labels are like identifiers. So when we use them to identify any value or instruction, we actually give
easier names to them. When any change has to be made or new code has to be inserted we do it
using 'labels' not actual 'machine code instructions'. This definitely adds to our advantage.
Gaurav Garg
Rudramani Pandey
1. In C,C++ We used to give a label so that Goto Statements can be used. Similarly here it is used
with Jump statements. 2) For large programs , multiple labels can be used for n times if the
statements are repeating . Thus we don't need to rewrite the program codes. Also we don't need to
make changes in every code.
Vinay Avudapuram
what is the difference between high level language and low level language?please explain with
examples....
Reply
Abhinee Chavan
High level languages are those which have syntax to remember which coding, for example C, CPP,
Java, etc. Low level languages are those which have op code and operands in the instruction itself.
Low level programs communicate with the hardware directly, whereas its not the same in case of
high level programs.
about 7 days ago
Abhinee Chavan
High level languages are those which have syntax to remember which coding, for example C, CPP,
Java, etc. Low level languages are those which have op code and operands in the instruction itself.
Low level programs communicate with the hardware directly, whereas its not the same in case of
high level programs.
Yugant Nayak
Abhimit Ghosh
Reply
What is an opcode?
Reply
Venkat Thogaru
Venkat Thogaru
Hardik Rathod
Arnab Mondal
ADD A,B here A,B are operand and ADD is opcode... the main instraction what to do that is the
opcode
Arnab Mondal
ADD A,B here A,B are operand and ADD is opcode... the main instraction what to do that is the
opcode
Abhimit Ghosh
opcode also known as OPERATION CODE basically it specifies what instruction is to be performed
Khushboo Barde
http://www.onlinevideolecture.com/electronics-engineering/nptel-iit-kharagpur/microprocessors-andmicrocontrollers/index.php?course_id=385&lecture_no=8
http://www.onlinevideolecture.com/electronics-engineering/nptel-iit-kharagpur/microprocessors-andmicrocontrollers/index.php?course_id=385&lecture_no=9
These links are showing Error 404. I hope it gets fixed ASAP.
Hardik Rathod
Reply
Previous
CC India
Campus Commune
My Channels
Next
Home
Index
3.1.Assembler
3.2.Assembly Language
3.3.Loaders and Linkers
3.4.Compilers
3.5.Interpreters
Go to Doubts
A linker, also known as link editor is a computer program that takes one or more object files
generated by a compiler and combines them into a single executable program.
Computer programs comprise several parts or modules but all these parts/modules need not be
contained within a single object file. In such case they refer to each other by means of symbols. An
object file can have three kinds of symbols:
Undefined symbols, which call the other modules where the symbols are
defined.
Local symbols which are used internally within the object file to facilitate
relocation.
For most compilers, each object file is the result of compiling one input source code file. If a program
comprises multiple object files, then the linker combines these files into a unified executable program
by resolving the symbols as it goes along.
Linkers can take objects from a collection called a runtime library. A runtime library is a collection of
object files which will contain machine code for any external function used by the program file which
in turn is used by the linker. This machine code is copied by the linker into the final executable
output. Some linkers do not include the entire library in the output, they only include the symbols that
are referenced from other object files or libraries. The libraries exist for diverse purposes. The
system libraries are usually linked in by default.
The linker also arranges the objects in a program's address space. This involves relocating code that
assumes a specific base address to another base address. Since a compiler seldom knows where
an object will reside, it assumes a fixed base location (for example, zero). The relocation of machine
code may involve re-targeting of loads, stores and absolute jumps.
The executable output by the linker may need another relocation pass when it is finally loaded into
memory (just before the execution). This relocation pass is usually omitted on hardware offering
virtual memory in which every program is put into its own address space and so there is no conflict
even if all programs load at the same base address. This relocation pass may also be omitted if the
executable is a position independent executable.
Related Videos:
Previous
Assembly Language
Next
Compilers
Ask a Doubt:
Misuse of 'Ask a Doubt' Section will be dealt as per the Terms & Conditions of Campus Commune
Note: Please do not use the doubts section for any quiz/quiz-content related queries.
Use the helpline () located above in top right corner for problems/queries related to quizzes.
Open Doubts
Closed Doubts
My Doubts
Nishtha Vishwakarma
Reply
about 10 hours ago
Reply
about 10 hours ago
Lipi Barik
Reply
Rajeswari Lakshmanasamy
Reply
about 5 days ago
Object file itself is in executable format only right. then what linker do with them to turn it again into
executable one? need some explanations on linker functionalities.
Reply
Kavya Gangavarapu
Object files are not directly executable, linkers combines object files and makes into executable
file.... as far as I understood...
Divisha Mathur
Reply
Pradyumn Jain
If any program is loaded in main memory and another component is needed in that program then
that component can be load in main program.
Sunanda Betal
Neha Dhade
Reply
It gives time to each process so it can be execute without interrupting each other. Its like time slots.
Sangeetha E
Abhinee Chavan
Dispatcher is a program in an O.S. which manages the tasks in the program to be executed.
Sayan Basu
Linkers use runtime time library, then why is the another arrow from linker to runtime library in the
above diagram?
Reply
Previous
Next
CC India
Campus Commune
My Channels
Home
Index
3.1.Assembler
3.2.Assembly Language
3.3.Loaders and Linkers
3.4.Compilers
3.5.Interpreters
Go to Doubts
3.4. Compilers
A compiler is a special program that processes statements written in a particular programming
language and turns them into machine language or code that a computer's processor uses. A
programmer writes language statements in a language such as Pascal or C one line at a time using
an editor. The file created contains the source statements or source code. The programmer then
runs the appropriate compiler for the language, specifying the name of the file that contains the
source statements.
When executing (running), the compiler first parses (or analyzes) the language statements
syntactically one after the other and then builds the output code in one or more successive stages or
"passes" and makes sure that statements that refer to other statements are referred in the final code
correctly. The output of the compilation is called object code or sometimes an object module. The
object code is machine code that the processor can execute, one instruction at a time.
The Basic Structure of a Compiler
In the five stages of a compiler, the high level language is translated to a low level language which is
generally closer to that of the target computer. Each stage of the compiler fulfills a single task and
has one or more classic techniques for implementation. The following are the five stages of a
compiler:
Lexical Analyzer: Analyzes the source code, removes "white space" and
comments, formats it for easy access by creating tokens, then tags language
elements with type information and begins to fill the information in the SYMBOL
TABLE. The Symbol Table is a data structure that contains information about
symbols and groups of symbols in the program being translated.
Semantic Analyzer: Analyzes the parsed code for meaning, fills in assumed or
any missing information and tags the groups with the meaning.
Code Generator: Linearizes the qualified code and produces the object code.
Optimizer: Checks the object code to determine whether there are more
efficient means of execution.
http://nptel.ac.in/courses/106108052/
Related Videos:
Previous
Loaders and Linkers
Next
Interpreters
Ask a Doubt:
Misuse of 'Ask a Doubt' Section will be dealt as per the Terms & Conditions of Campus Commune
Note: Please do not use the doubts section for any quiz/quiz-content related queries.
Use the helpline () located above in top right corner for problems/queries related to quizzes.
Open Doubts
Closed Doubts
Nishi Aryan
My Doubts
Shalaka Bhutada
Reply
Reply
Deepak Gond
Reply
passed through lexical analyser , all comments and white space are removed and gets converted
into streams of tokens thus known as tokenised code
Vineet Pandya
Reply
Reply
Vikas Kumar
Reply
Vikas Kumar
It will gives the meaning and sense for the source code and fill some other words such that machine
can understand easily.Semantic analysis will actually convert the parsed code to qualified code.
Siddhartha Seal
Ravi Joshi
Reply
A parse tree for a string in L(G) is a tree where- the root is the start symbol for G the interior nodes
are the nonterminals of G the leaf nodes are the terminal symbols of G. the children of a node T
(from left to right) correspond to the symbols on the right hand side of some production for T in G.
Shubham Khandalkar
Saikiran Nedaganti
Reply
about 10 days ago
Reply
Previous
Next
CC India
Campus Commune
My Channels
Home
Index
3.1.Assembler
3.2.Assembly Language
3.3.Loaders and Linkers
3.4.Compilers
3.5.Interpreters
Go to Doubts
3.5. Interpreters
Interpreter is a program that executes instructions written in a high-level language. There are two
methods to run programs written in a high-level language. The most common method is to compile
the program and the other method is to pass the program through an interpreter.
An interpreter translates high-level instructions into an intermediate form and then executes it. In
contrast to the above method, a compiler translates high-level instructions directly into machine
language. The compiled programs generally run faster than interpreted programs. One of the
advantage of using an interpreter is that it does not need to go through the compilation stage during
which machine instructions are generated. This process of compilation can be time-consuming if the
program is very long. The interpreter, on the other hand, immediately execute high-level programs.
Hence interpreters are sometimes used during the development of a program in which the
programmer wants to add small sections at a time and test them quickly. In addition to this,
interpreters are often used in education because they allow students to program interactively.
Interpreter vs Compiler
The primary difference between a compiler and interpreter is the way in which a
program is executed. The compiler converts the source code to machine code
and then saves it as an object code before creating an executable file for the
same. The compiled program is executed directly using the machine code or
the object code. But an interpreter does not convert the source code to an
object code before execution.
An interpreter executes the source code, line by line and conversion to native
code is performed line by line while execution is going on (at runtime). Hence
the run time required for an interpreted program will be high compared to a
compiled program.
Even though the run time required for interpreted program is more, the
execution using an interpreter has its own advantages. For example interpreted
programs can modify themselves at runtime by adding or changing functions.
Compiled program has to be recompiled fully even for the small modifications
done in the program. But in the case of an interpreter there is no such problem
(only the modified section needs to be recompiled - refer Figure 3.6).
Glossary
Related Videos:
Previous
Compilers
Ask a Doubt:
Misuse of 'Ask a Doubt' Section will be dealt as per the Terms & Conditions of Campus Commune
Note: Please do not use the doubts section for any quiz/quiz-content related queries.
Use the helpline () located above in top right corner for problems/queries related to quizzes.
Open Doubts
Closed Doubts
My Doubts
Abhishek Soni about 12 hours ago
which will take long time when the program is long.
Tusarkant Swain
Reply
Narendra Singh
I don't think that's the case. Study and try hard next time.
Mala G
Chandu Mahasamudram
Reply
about 6 days ago
JIT means Just In Time Compiler.The JIT compiler is enabled by default, and is activated when a
Java method is called. The JIT compiler compiles the bytecodes of that method into native machine
code, compiling it "just in time" to run. When a method has been compiled, the JVM calls the
compiled code of that method directly instead of interpreting it.
Sankalp Bhatt
Java has an execution engine which consists of an interpreter and a compiler. Java compiler is
called JIT compiler. JIT first converts byte code into machine code and then pushes the machine
code into memory. While interpreter converts each instruction and gives it to processor. So,
interpreter is efficient when a single statement is to be executed while with loops JVM gives the code
to JIT. Both are used simultaneously and this technique is called adaptive optimizer.
Sushmitha Nannapaneni
Nidhi Kaushik
Semantic analysis judges whether the syntax structure constructed in the source program derives
any meaning or not.
Nidhi Kaushik
Raksha
semantic analysis is the last by one phase where compiler is allowed to remove the incorrect
program
Raksha
semantic analysis is the last by one phase where compiler is allowed to remove the incorrect
program
Kanika Narang
Nidhi Kaushik
debugging is difficult in compiler than interpreter because it generates the error message only after
the whole program is scanned.
Nidhi Kaushik
Narendra Singh
Hardik Rathod
Reply
Arnab Mondal
Narendra Singh
You can try till your death but with gap of 72 hours.
Gaurav Sharma
Ramesh Sah
Ashwani Pandey
Reply
It depends on situation my friend. What you want Like Java is an interpreted language while c++ is
compiled lang. both have been invented for different purpose and are effective in it. so according to
me it totally depends on your choice. But, if your doubt is regarding the run time. then compiled
languages have a better response time than interpreter language thats why today also drivers of
computer peripherals are made using basic languages like C, games involving quick responses like
shooting games, these modules are written using c or c++ or any other compiler based language..
Satyaranjan Behera
Kamini Singh
Compiler
Kamini Singh
Compiler
Kamini Singh
Compiler
Ripan Dey
Compiler
Supriya Roy
Compiler
Supriya Roy
Compiler
Asish Kumar
Compiler, because the compiled language consists of 0 and 1 which processor can easily execute at
runtime.
Pratyush Swain
Complier
Pratyush Swain
Complier
Narendra Singh
Compiler
Hameed Rahman
Dear sir,
In the study material it is written -- "An interpreter translates high-level instructions into an
intermediate form and then executes it. In contrast to the above method, a compiler translates highlevel instructions directly into machine language."
But if we analyze a java program then at first the compiler compiles java source code to produce an
intermediate code called Bytecode and then this Bytecode is interpreted by the Interpreter to
produce machine code.
Thus, a compiler translates high-level instructions into an intermediate form(object code). And an
interpreter translates high-level instructions directly into machine language.
Please explain.....
Ashwani Pandey
Reply
Previous
Next