SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
System Programming
Introduction: System Software, Application
Software, components of a programming
system: Assembler, Loader, Linker, Macros,
Compiler
2
Software
Software is basically classified into two
categories, System Software and Application
Software. Where System Software acts as an
interface between Application Software and
hardware of the computer. The Application
Software acts an interface between user and
System Software. We can distinguish System
Software and Application Software on account
of the purpose of their design.
3
• System software is general purpose software
which is used to operate computer hardware.
It provides platform to run application
software.
• Application software is specific purpose
software which is used by user for performing
specific task.
4
5
Differences
System Software Application Software
System software is used for operating
computer hardware.
Application software is used by user to
perform specific task.
System software are installed on the
computer when operating system is
installed.
Application software are installed
according to user’s requirements.
In general, the user does not interact with
system software because it works in the
background.
In general, the user interacts with
application software.
System software can run independently. It
provides platform for running application
software.
Application software can’t run
independently. They can’t run without the
presence of system software.
Some examples of system software are
compiler, assembler, debugger, driver, etc.
Some examples of application software
are word processor, web browser, media
player, etc.
6
System Software Application Software
System Software is written in a low-level
language, i.e. assembly language.
Application Software is written in a high-
level language like Java, C++, .net, VB, etc.
System Software starts running when the
system is turned on, and runs till the
system is shut down.
Application Software runs as and when
the user requests.
A system is unable to run without system
software.
Application software is even not required
to run the system; it is user specific.
System Software is general-purpose. Application Software is specific-purpose.
Ex. Operating system. Ex. Microsoft Office, Photoshop,
Animation Software, etc.
7
Conclusion:
• Both, the System Software and the Application
Software together make a system useful for
the end user. The System Software is
compulsory for the system to work. Similarly,
the Application Software are necessary for the
user to perform their specific task.
8
Components of System Programming
• Interpreter
• Assembler
• Compiler
• Macros and Microprocessors
• Formal systems
• Debugger
• Linkers
• Operating system
9
Assembler
An assembler is a program that converts assembly
language into machine code. It takes the basic
commands and operations from assembly code and
converts them into binary code that can be
recognized by a specific type of processor.
10
Source Code or Machine Code?
• The actual program which the runs in a CPU consists of
instructions in machine code ; patterns of 0's and 1's stored
in words of memory. In the end, whatever means is used to
achieve it, the machine code has to be placed in the right
addresses for the dispatch unit of the CPU to run the
instructions.
• Human programmers find it difficult to write program in
machine code; it is difficult to understand, difficult to read,
difficult to remember. Instead, they may write in assembly
language ; this will be represented as a list of ASCII
characters, forming the letters of words which are easier to
understand, easier to read, easier to remember; but they
correspond precisely to the instructions which the CPU
executes, and can be translated into such instructions.
11
Example
• So, for example, INC COUNTER (which means,
increase the value of the number stored in the
register which has been given the label COUNTER"
is easier to understand and remember than
00101010001100; even if this is written in Hex
(0A8C) it may be easier to write, but no easier to
understand. (A language like C is a little different; it
also is represented by a string of ASCII characters;
but each word or line usually does not correspond
to a single instruction, but to a whole series of
such instructions).
In order to be useful, assembly language has to be precise; there has to
be no doubt how to translate the words into instructions; in order to do
this, it is important to follow a set of rules for a particular language
precisely.
12
Loader
A loader is a major component of an operating system that ensures all
necessary programs and libraries are loaded, which is essential during the
startup phase of running a program.
It places the libraries and programs into the main memory in order to
prepare them for execution.
Loading involves reading the contents of the executable file that contains
the instructions of the program and then doing other preparatory tasks
that are required in order to prepare the executable for running, all of
which takes anywhere from a few seconds to minutes depending on the
size of the program that needs to run.
13
As the program that has to be
executed currently must reside in
the main memory of the computer.
It is the responsibility of the loader,
a program in an operating system,
to load the executable file/module
of a program, generated by the
linker, to the main memory for
execution. It allocates the memory
space to the executable module in
main memory.
There are three kinds of loading
approaches:
• Absolute loading
• Relocatable loading
• Dynamic run-time loading
14
The following are the responsibilities of a loader:
• Validate the program for memory requirements,
permissions, etc.
• Copy necessary files, such as the program image or
required libraries, from the disk into the memory
• Copy required command-line arguments into the stack
• Link the starting point of the program and link any
other required library
• Initialize the registers
• Jump to the program starting point in memory
15
Linker
The Assembler generates the object code of a source program and hands it over to the linker. The
linker takes this object code and generates the executable code for the program, and hand it over
to the Loader.
The high-level language, programs have some built-in libraries and header files. The source
program may contain some library functions whose definition are stored in the built-in libraries.
The linker links these function to the built-in libraries. In case the built-in libraries are not found it
informs to the compiler, and the compiler then generates the error.
Sometimes the large programs are divided into the subprograms which are called modules. Now
when these modules are compiled and assembled, the object modules of the source program are
generated. The linker has the responsibility of combining/linking all the object modules to
generate a single executable file of the source program. We have two types of linkers.
16
Linking Types
Static Linking –
It is performed during the compilation of source program. Linking is
performed before execution in static linking. It takes collection of
relocatable object file and command-line argument and generate fully
linked object file that can be loaded and run.
Static linker perform two major task:
• Symbol resolution – It associates each symbol reference with
exactly one symbol definition .Every symbol have predefined task.
• Relocation – It relocate code and data section and modify symbol
references to the relocated memory location.
The linker copy all library routines used in the program into executable image. As a result, it
require more memory space. As it does not require the presence of library on the system when
it is run . so, it is faster and more portable. No failure chance and less error chance.
17
Dynamic linking –
• Dynamic linking is performed during the run time. This linking is
accomplished by placing the name of a shareable library in the executable
image. There is more chances of error and failure chances. It require less
memory space as multiple program can share a single copy of the library.
• Here we can perform code sharing. it means we are using a same object a
number of times in the program. Instead of linking same object again and
again into the library, each module share information of a object with
other module having same object. The shared library needed in the linking
is stored in virtual memory to save RAM. In this linking we can also
relocate the code for the smooth running of code but all the code is not
relocatable. It fixes the address at run time.
18
Linker Vs Loader
BASIS LINKER LOADER
Basic It generates the executable
module of a source
program.
It loads the executable
module to the main
memory.
Input It takes as input, the object
code generated by an
assembler.
It takes executable module
generated by a linker.
Function It combines all the object
modules of a source code
to generate an executable
module.
It allocates the addresses to
an executable module in
main memory for
execution.
Type/Approach Linkage Editor, Dynamic
linker.
Absolute loading,
Relocatable loading and
Dynamic Run-time loading.
19
Macros
A macro (which stands for "macroinstruction")
is a programmable pattern which translates a
certain sequence of input into a preset
sequence of output.
Macros can be used to make tasks less repetitive
by representing a complicated sequence
of keystrokes, mouse movements, commands,
or other types of input.
20
Example
In computer programming, macros are a tool
that allows a developer to re-use code. For
instance, in the C programming language, this is
an example of a simple macro definition which
incorporates arguments:
21
#define square(x) ((x) * (x))
After being defined like this, our macro can be
used in the code body to find the square of a
number. When the code is preprocessed
before compilation, the macro will be expanded
each time it occurs. For instance, using our
macro like this:
22
int num = square(5);
is the same as writing:
int num = ((5) * (5));
Assembly - Macros
Writing a macro is another way of ensuring modular
programming in assembly language.
• A macro is a sequence of instructions, assigned
by a name and could be used anywhere in the
program.
• In NASM, macros are defined
with %macro and %endmacro directives.
• The macro begins with the %macro directive and
ends with the %endmacro directive.
23
Assembly language macro definitions can be predefined and
placed in a macro library, or can be included "in-line" with the
assembly language program.
24
Syntax
%macro macro_name number_of_params
<macro body>
%endmacro
25
Where, number_of_params specifies the number
parameters, macro_name specifies the name of
the macro.
Example
For example, a very common need for programs
is to write a string of characters in the screen.
For displaying a string of characters, you need
the following sequence of instructions −
26
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
27
Meanings of the Code
Assembly code Machine code
MOV EAX, 10000h B8 00010000
(Move 10000h into EAX)
ADD EAX, 40000h 05 00040000
(Add 40000h to EAX)
SUB EAX, 20000h 2D 00020000
(SUB 20000h from EAX)
27
Operand in instruction
28
Fetched MOV EAX, 10000h
28
…
ALU
MemoryRegister
EAX
EBX
address
00
…
MOV EAX, 10000h
SUB EAX, 20000h
data
PC
0000011B8 00010000
IR
B8
00
01
00
00
ADD EAX, 40000h
05
00
04
00
29
Execute MOV EAX, 10000h
29
…
ALU
Register
EAX
EBX
data
PC
0000011B8 00010000
IR
00010000
00
…
MOV EAX, 10000h
SUB EAX, 20000h
B8
00
01
00
00
ADD EAX, 40000h
05
00
04
00
Memory
address
30
Fetched ADD EAX, 40000h
30
…
ALU
Register
EAX
EBX
data
PC
000100005 00040000
IR
00010000
Memory
address
00
…
MOV EAX, 10000h
SUB EAX, 20000h
B8
00
01
00
00
ADD EAX, 40000h
05
00
04
00
31
Execute ADD EAX, 40000h
31
…
ALU
Register
EAX
EBX
data
PC
000100005 00040000
IR
0001000000050000
Memory
address
00
…
MOV EAX, 10000h
SUB EAX, 20000h
B8
00
01
00
00
ADD EAX, 40000h
05
00
04
00
Compiler
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. Typically,
a programmer writes language statements in a
language such as Pascal or C one line at a time using
an editor. The file that is created contains what are
called the source statements. The programmer then
runs the appropriate language compiler, specifying
the name of the file that contains the source
statements.
32
33
Compiler is a program that translates source code into
object code. The compiler derives its name from the way
it works, looking at the entire piece of source code and
collecting and reorganizing the instructions. Thus, a
compiler differs from an interpreter, which analyzes and
executes each line of source code in succession, without
looking at the entire program. The advantage of
interpreters is that they can execute a program
immediately. Compilers require some time before an
executable program emerges. However, programs
produced by compilers runmuch faster than the same
programs executed by an interpreter.
34
35

Mais conteúdo relacionado

Mais procurados (20)

Introduction to Compiler design
Introduction to Compiler design Introduction to Compiler design
Introduction to Compiler design
 
Software tools
Software toolsSoftware tools
Software tools
 
Importance of software engineering
Importance of software engineeringImportance of software engineering
Importance of software engineering
 
Unit 4 sp macro
Unit 4 sp macroUnit 4 sp macro
Unit 4 sp macro
 
Linkers
LinkersLinkers
Linkers
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Chapter 1 2 - some size factors
Chapter 1   2 - some size factorsChapter 1   2 - some size factors
Chapter 1 2 - some size factors
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
 
Introduction of java
Introduction  of javaIntroduction  of java
Introduction of java
 
Android resource
Android resourceAndroid resource
Android resource
 
Language processors
Language processorsLanguage processors
Language processors
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Shell programming
Shell programmingShell programming
Shell programming
 
Requirement specification (SRS)
Requirement specification (SRS)Requirement specification (SRS)
Requirement specification (SRS)
 
Loaders and Linkers
Loaders and LinkersLoaders and Linkers
Loaders and Linkers
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
 
Files in java
Files in javaFiles in java
Files in java
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
Android resources
Android resourcesAndroid resources
Android resources
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 

Semelhante a Hm system programming class 1

Loaders ( system programming )
Loaders ( system programming ) Loaders ( system programming )
Loaders ( system programming ) Adarsh Patel
 
Linker and Loader Explained
Linker and Loader  ExplainedLinker and Loader  Explained
Linker and Loader ExplainedAdarsh Kr Sinha
 
Mba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer softwareMba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer softwareRai University
 
Introduction to system programming
Introduction to system programmingIntroduction to system programming
Introduction to system programmingsonalikharade3
 
Ch 1.pptx
Ch 1.pptxCh 1.pptx
Ch 1.pptxwoldu2
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution pptKeerty Smile
 
System software module 1 presentation file
System software module 1 presentation fileSystem software module 1 presentation file
System software module 1 presentation filejithujithin657
 
System programming note
System programming noteSystem programming note
System programming noteSANTOSH RATH
 
SPCC:System programming and compiler construction
SPCC:System programming and compiler constructionSPCC:System programming and compiler construction
SPCC:System programming and compiler constructionmohdumaira1
 
Bba i-introduction to computer-u-2- application and system software
Bba  i-introduction to computer-u-2- application and system softwareBba  i-introduction to computer-u-2- application and system software
Bba i-introduction to computer-u-2- application and system softwareRai University
 
System Programming VV Notes.pdf
System Programming VV Notes.pdfSystem Programming VV Notes.pdf
System Programming VV Notes.pdfbharathreddy223930
 
Bca i-fundamental of computer-u-2- application and system software
Bca  i-fundamental of  computer-u-2- application and system softwareBca  i-fundamental of  computer-u-2- application and system software
Bca i-fundamental of computer-u-2- application and system softwareRai University
 
Mca i-fundamental of computer-u-2- application and system software
Mca  i-fundamental of  computer-u-2- application and system softwareMca  i-fundamental of  computer-u-2- application and system software
Mca i-fundamental of computer-u-2- application and system softwareRai University
 
The role of the cpu in the operation
The role of the cpu in the operationThe role of the cpu in the operation
The role of the cpu in the operationmary_ramsay
 
Bsc cs 1 fit u-2 application and system software
Bsc cs 1 fit u-2 application and system softwareBsc cs 1 fit u-2 application and system software
Bsc cs 1 fit u-2 application and system softwareRai University
 
System software module 3 presentation file
System software module 3 presentation fileSystem software module 3 presentation file
System software module 3 presentation filejithujithin657
 
System software module 3 presentation file
System software module 3 presentation fileSystem software module 3 presentation file
System software module 3 presentation filejithujithin657
 

Semelhante a Hm system programming class 1 (20)

Loaders ( system programming )
Loaders ( system programming ) Loaders ( system programming )
Loaders ( system programming )
 
linkerloader ss-2.pptx
linkerloader ss-2.pptxlinkerloader ss-2.pptx
linkerloader ss-2.pptx
 
Linker and Loader Explained
Linker and Loader  ExplainedLinker and Loader  Explained
Linker and Loader Explained
 
Mba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer softwareMba i-ifm-u-2-computer software
Mba i-ifm-u-2-computer software
 
Introduction to system programming
Introduction to system programmingIntroduction to system programming
Introduction to system programming
 
Ch 1.pptx
Ch 1.pptxCh 1.pptx
Ch 1.pptx
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
 
report
reportreport
report
 
System software module 1 presentation file
System software module 1 presentation fileSystem software module 1 presentation file
System software module 1 presentation file
 
System programming note
System programming noteSystem programming note
System programming note
 
SPCC:System programming and compiler construction
SPCC:System programming and compiler constructionSPCC:System programming and compiler construction
SPCC:System programming and compiler construction
 
Bba i-introduction to computer-u-2- application and system software
Bba  i-introduction to computer-u-2- application and system softwareBba  i-introduction to computer-u-2- application and system software
Bba i-introduction to computer-u-2- application and system software
 
System Programming VV Notes.pdf
System Programming VV Notes.pdfSystem Programming VV Notes.pdf
System Programming VV Notes.pdf
 
Bca i-fundamental of computer-u-2- application and system software
Bca  i-fundamental of  computer-u-2- application and system softwareBca  i-fundamental of  computer-u-2- application and system software
Bca i-fundamental of computer-u-2- application and system software
 
Mca i-fundamental of computer-u-2- application and system software
Mca  i-fundamental of  computer-u-2- application and system softwareMca  i-fundamental of  computer-u-2- application and system software
Mca i-fundamental of computer-u-2- application and system software
 
The role of the cpu in the operation
The role of the cpu in the operationThe role of the cpu in the operation
The role of the cpu in the operation
 
Bsc cs 1 fit u-2 application and system software
Bsc cs 1 fit u-2 application and system softwareBsc cs 1 fit u-2 application and system software
Bsc cs 1 fit u-2 application and system software
 
Loaders
LoadersLoaders
Loaders
 
System software module 3 presentation file
System software module 3 presentation fileSystem software module 3 presentation file
System software module 3 presentation file
 
System software module 3 presentation file
System software module 3 presentation fileSystem software module 3 presentation file
System software module 3 presentation file
 

Mais de Hitesh Mohapatra

Virtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud ComputingVirtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud ComputingHitesh Mohapatra
 
Automating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine ProvisioningAutomating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine ProvisioningHitesh Mohapatra
 
Harnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and ApplicationsHarnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and ApplicationsHitesh Mohapatra
 
Scheduling in Cloud Computing
Scheduling in Cloud ComputingScheduling in Cloud Computing
Scheduling in Cloud ComputingHitesh Mohapatra
 
Load balancing in cloud computing.pptx
Load balancing in cloud computing.pptxLoad balancing in cloud computing.pptx
Load balancing in cloud computing.pptxHitesh Mohapatra
 
ITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment modelITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment modelHitesh Mohapatra
 
Reviewing basic concepts of relational database
Reviewing basic concepts of relational databaseReviewing basic concepts of relational database
Reviewing basic concepts of relational databaseHitesh Mohapatra
 
Advanced database protocols
Advanced database protocolsAdvanced database protocols
Advanced database protocolsHitesh Mohapatra
 
Involvement of WSN in Smart Cities
Involvement of WSN in Smart CitiesInvolvement of WSN in Smart Cities
Involvement of WSN in Smart CitiesHitesh Mohapatra
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its FundamentalsHitesh Mohapatra
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGHitesh Mohapatra
 
Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Hitesh Mohapatra
 

Mais de Hitesh Mohapatra (20)

Virtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud ComputingVirtualization: A Key to Efficient Cloud Computing
Virtualization: A Key to Efficient Cloud Computing
 
Automating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine ProvisioningAutomating the Cloud: A Deep Dive into Virtual Machine Provisioning
Automating the Cloud: A Deep Dive into Virtual Machine Provisioning
 
Harnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and ApplicationsHarnessing the Power of Google Cloud Platform: Strategies and Applications
Harnessing the Power of Google Cloud Platform: Strategies and Applications
 
Scheduling in Cloud Computing
Scheduling in Cloud ComputingScheduling in Cloud Computing
Scheduling in Cloud Computing
 
Cloud-Case study
Cloud-Case study Cloud-Case study
Cloud-Case study
 
RAID
RAIDRAID
RAID
 
Load balancing in cloud computing.pptx
Load balancing in cloud computing.pptxLoad balancing in cloud computing.pptx
Load balancing in cloud computing.pptx
 
Cluster Computing
Cluster ComputingCluster Computing
Cluster Computing
 
ITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment modelITU-T requirement for cloud and cloud deployment model
ITU-T requirement for cloud and cloud deployment model
 
Leetcode Problem Solution
Leetcode Problem SolutionLeetcode Problem Solution
Leetcode Problem Solution
 
Leetcode Problem Solution
Leetcode Problem SolutionLeetcode Problem Solution
Leetcode Problem Solution
 
Trie Data Structure
Trie Data Structure Trie Data Structure
Trie Data Structure
 
Reviewing basic concepts of relational database
Reviewing basic concepts of relational databaseReviewing basic concepts of relational database
Reviewing basic concepts of relational database
 
Reviewing SQL Concepts
Reviewing SQL ConceptsReviewing SQL Concepts
Reviewing SQL Concepts
 
Advanced database protocols
Advanced database protocolsAdvanced database protocols
Advanced database protocols
 
Measures of query cost
Measures of query costMeasures of query cost
Measures of query cost
 
Involvement of WSN in Smart Cities
Involvement of WSN in Smart CitiesInvolvement of WSN in Smart Cities
Involvement of WSN in Smart Cities
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its Fundamentals
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
 
Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...Basic commands for powershell : Configuring Windows PowerShell and working wi...
Basic commands for powershell : Configuring Windows PowerShell and working wi...
 

Último

High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfDrew Moseley
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Communityprachaibot
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfalene1
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdfsahilsajad201
 
70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical trainingGladiatorsKasper
 
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...Amil baba
 
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...IJAEMSJORNAL
 
ADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studyADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studydhruvamdhruvil123
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...KrishnaveniKrishnara1
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
Indian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfIndian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfalokitpathak01
 
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...arifengg7
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Romil Mishra
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionSneha Padhiar
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 

Último (20)

High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdf
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
Prach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism CommunityPrach: A Feature-Rich Platform Empowering the Autism Community
Prach: A Feature-Rich Platform Empowering the Autism Community
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdf
 
70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training
 
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
 
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
 
ADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain studyADM100 Running Book for sap basis domain study
ADM100 Running Book for sap basis domain study
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
 
ASME-B31.4-2019-estandar para diseño de ductos
ASME-B31.4-2019-estandar para diseño de ductosASME-B31.4-2019-estandar para diseño de ductos
ASME-B31.4-2019-estandar para diseño de ductos
 
Indian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfIndian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdf
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________
 
Cost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based questionCost estimation approach: FP to COCOMO scenario based question
Cost estimation approach: FP to COCOMO scenario based question
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 

Hm system programming class 1

  • 2. Introduction: System Software, Application Software, components of a programming system: Assembler, Loader, Linker, Macros, Compiler 2
  • 3. Software Software is basically classified into two categories, System Software and Application Software. Where System Software acts as an interface between Application Software and hardware of the computer. The Application Software acts an interface between user and System Software. We can distinguish System Software and Application Software on account of the purpose of their design. 3
  • 4. • System software is general purpose software which is used to operate computer hardware. It provides platform to run application software. • Application software is specific purpose software which is used by user for performing specific task. 4
  • 5. 5
  • 6. Differences System Software Application Software System software is used for operating computer hardware. Application software is used by user to perform specific task. System software are installed on the computer when operating system is installed. Application software are installed according to user’s requirements. In general, the user does not interact with system software because it works in the background. In general, the user interacts with application software. System software can run independently. It provides platform for running application software. Application software can’t run independently. They can’t run without the presence of system software. Some examples of system software are compiler, assembler, debugger, driver, etc. Some examples of application software are word processor, web browser, media player, etc. 6
  • 7. System Software Application Software System Software is written in a low-level language, i.e. assembly language. Application Software is written in a high- level language like Java, C++, .net, VB, etc. System Software starts running when the system is turned on, and runs till the system is shut down. Application Software runs as and when the user requests. A system is unable to run without system software. Application software is even not required to run the system; it is user specific. System Software is general-purpose. Application Software is specific-purpose. Ex. Operating system. Ex. Microsoft Office, Photoshop, Animation Software, etc. 7
  • 8. Conclusion: • Both, the System Software and the Application Software together make a system useful for the end user. The System Software is compulsory for the system to work. Similarly, the Application Software are necessary for the user to perform their specific task. 8
  • 9. Components of System Programming • Interpreter • Assembler • Compiler • Macros and Microprocessors • Formal systems • Debugger • Linkers • Operating system 9
  • 10. Assembler An assembler is a program that converts assembly language into machine code. It takes the basic commands and operations from assembly code and converts them into binary code that can be recognized by a specific type of processor. 10
  • 11. Source Code or Machine Code? • The actual program which the runs in a CPU consists of instructions in machine code ; patterns of 0's and 1's stored in words of memory. In the end, whatever means is used to achieve it, the machine code has to be placed in the right addresses for the dispatch unit of the CPU to run the instructions. • Human programmers find it difficult to write program in machine code; it is difficult to understand, difficult to read, difficult to remember. Instead, they may write in assembly language ; this will be represented as a list of ASCII characters, forming the letters of words which are easier to understand, easier to read, easier to remember; but they correspond precisely to the instructions which the CPU executes, and can be translated into such instructions. 11
  • 12. Example • So, for example, INC COUNTER (which means, increase the value of the number stored in the register which has been given the label COUNTER" is easier to understand and remember than 00101010001100; even if this is written in Hex (0A8C) it may be easier to write, but no easier to understand. (A language like C is a little different; it also is represented by a string of ASCII characters; but each word or line usually does not correspond to a single instruction, but to a whole series of such instructions). In order to be useful, assembly language has to be precise; there has to be no doubt how to translate the words into instructions; in order to do this, it is important to follow a set of rules for a particular language precisely. 12
  • 13. Loader A loader is a major component of an operating system that ensures all necessary programs and libraries are loaded, which is essential during the startup phase of running a program. It places the libraries and programs into the main memory in order to prepare them for execution. Loading involves reading the contents of the executable file that contains the instructions of the program and then doing other preparatory tasks that are required in order to prepare the executable for running, all of which takes anywhere from a few seconds to minutes depending on the size of the program that needs to run. 13
  • 14. As the program that has to be executed currently must reside in the main memory of the computer. It is the responsibility of the loader, a program in an operating system, to load the executable file/module of a program, generated by the linker, to the main memory for execution. It allocates the memory space to the executable module in main memory. There are three kinds of loading approaches: • Absolute loading • Relocatable loading • Dynamic run-time loading 14
  • 15. The following are the responsibilities of a loader: • Validate the program for memory requirements, permissions, etc. • Copy necessary files, such as the program image or required libraries, from the disk into the memory • Copy required command-line arguments into the stack • Link the starting point of the program and link any other required library • Initialize the registers • Jump to the program starting point in memory 15
  • 16. Linker The Assembler generates the object code of a source program and hands it over to the linker. The linker takes this object code and generates the executable code for the program, and hand it over to the Loader. The high-level language, programs have some built-in libraries and header files. The source program may contain some library functions whose definition are stored in the built-in libraries. The linker links these function to the built-in libraries. In case the built-in libraries are not found it informs to the compiler, and the compiler then generates the error. Sometimes the large programs are divided into the subprograms which are called modules. Now when these modules are compiled and assembled, the object modules of the source program are generated. The linker has the responsibility of combining/linking all the object modules to generate a single executable file of the source program. We have two types of linkers. 16
  • 17. Linking Types Static Linking – It is performed during the compilation of source program. Linking is performed before execution in static linking. It takes collection of relocatable object file and command-line argument and generate fully linked object file that can be loaded and run. Static linker perform two major task: • Symbol resolution – It associates each symbol reference with exactly one symbol definition .Every symbol have predefined task. • Relocation – It relocate code and data section and modify symbol references to the relocated memory location. The linker copy all library routines used in the program into executable image. As a result, it require more memory space. As it does not require the presence of library on the system when it is run . so, it is faster and more portable. No failure chance and less error chance. 17
  • 18. Dynamic linking – • Dynamic linking is performed during the run time. This linking is accomplished by placing the name of a shareable library in the executable image. There is more chances of error and failure chances. It require less memory space as multiple program can share a single copy of the library. • Here we can perform code sharing. it means we are using a same object a number of times in the program. Instead of linking same object again and again into the library, each module share information of a object with other module having same object. The shared library needed in the linking is stored in virtual memory to save RAM. In this linking we can also relocate the code for the smooth running of code but all the code is not relocatable. It fixes the address at run time. 18
  • 19. Linker Vs Loader BASIS LINKER LOADER Basic It generates the executable module of a source program. It loads the executable module to the main memory. Input It takes as input, the object code generated by an assembler. It takes executable module generated by a linker. Function It combines all the object modules of a source code to generate an executable module. It allocates the addresses to an executable module in main memory for execution. Type/Approach Linkage Editor, Dynamic linker. Absolute loading, Relocatable loading and Dynamic Run-time loading. 19
  • 20. Macros A macro (which stands for "macroinstruction") is a programmable pattern which translates a certain sequence of input into a preset sequence of output. Macros can be used to make tasks less repetitive by representing a complicated sequence of keystrokes, mouse movements, commands, or other types of input. 20
  • 21. Example In computer programming, macros are a tool that allows a developer to re-use code. For instance, in the C programming language, this is an example of a simple macro definition which incorporates arguments: 21 #define square(x) ((x) * (x))
  • 22. After being defined like this, our macro can be used in the code body to find the square of a number. When the code is preprocessed before compilation, the macro will be expanded each time it occurs. For instance, using our macro like this: 22 int num = square(5); is the same as writing: int num = ((5) * (5));
  • 23. Assembly - Macros Writing a macro is another way of ensuring modular programming in assembly language. • A macro is a sequence of instructions, assigned by a name and could be used anywhere in the program. • In NASM, macros are defined with %macro and %endmacro directives. • The macro begins with the %macro directive and ends with the %endmacro directive. 23
  • 24. Assembly language macro definitions can be predefined and placed in a macro library, or can be included "in-line" with the assembly language program. 24
  • 25. Syntax %macro macro_name number_of_params <macro body> %endmacro 25 Where, number_of_params specifies the number parameters, macro_name specifies the name of the macro.
  • 26. Example For example, a very common need for programs is to write a string of characters in the screen. For displaying a string of characters, you need the following sequence of instructions − 26 mov edx,len ;message length mov ecx,msg ;message to write mov ebx,1 ;file descriptor (stdout) mov eax,4 ;system call number (sys_write) int 0x80 ;call kernel
  • 27. 27 Meanings of the Code Assembly code Machine code MOV EAX, 10000h B8 00010000 (Move 10000h into EAX) ADD EAX, 40000h 05 00040000 (Add 40000h to EAX) SUB EAX, 20000h 2D 00020000 (SUB 20000h from EAX) 27 Operand in instruction
  • 28. 28 Fetched MOV EAX, 10000h 28 … ALU MemoryRegister EAX EBX address 00 … MOV EAX, 10000h SUB EAX, 20000h data PC 0000011B8 00010000 IR B8 00 01 00 00 ADD EAX, 40000h 05 00 04 00
  • 29. 29 Execute MOV EAX, 10000h 29 … ALU Register EAX EBX data PC 0000011B8 00010000 IR 00010000 00 … MOV EAX, 10000h SUB EAX, 20000h B8 00 01 00 00 ADD EAX, 40000h 05 00 04 00 Memory address
  • 30. 30 Fetched ADD EAX, 40000h 30 … ALU Register EAX EBX data PC 000100005 00040000 IR 00010000 Memory address 00 … MOV EAX, 10000h SUB EAX, 20000h B8 00 01 00 00 ADD EAX, 40000h 05 00 04 00
  • 31. 31 Execute ADD EAX, 40000h 31 … ALU Register EAX EBX data PC 000100005 00040000 IR 0001000000050000 Memory address 00 … MOV EAX, 10000h SUB EAX, 20000h B8 00 01 00 00 ADD EAX, 40000h 05 00 04 00
  • 32. Compiler 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. Typically, a programmer writes language statements in a language such as Pascal or C one line at a time using an editor. The file that is created contains what are called the source statements. The programmer then runs the appropriate language compiler, specifying the name of the file that contains the source statements. 32
  • 33. 33
  • 34. Compiler is a program that translates source code into object code. The compiler derives its name from the way it works, looking at the entire piece of source code and collecting and reorganizing the instructions. Thus, a compiler differs from an interpreter, which analyzes and executes each line of source code in succession, without looking at the entire program. The advantage of interpreters is that they can execute a program immediately. Compilers require some time before an executable program emerges. However, programs produced by compilers runmuch faster than the same programs executed by an interpreter. 34
  • 35. 35