0% found this document useful (0 votes)
4 views44 pages

Chapter 1 A-System Programming Intro

The document provides an overview of system programming and application programming, defining their roles and responsibilities in software development. It explains the components of system programming, including interpreters, assemblers, compilers, and loaders, and discusses the functions of operating systems and the need for system software. Additionally, it covers various types of translators and assembly language statements, along with the design procedure for two-pass assemblers.

Uploaded by

ikush.misc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views44 pages

Chapter 1 A-System Programming Intro

The document provides an overview of system programming and application programming, defining their roles and responsibilities in software development. It explains the components of system programming, including interpreters, assemblers, compilers, and loaders, and discusses the functions of operating systems and the need for system software. Additionally, it covers various types of translators and assembly language statements, along with the design procedure for two-pass assemblers.

Uploaded by

ikush.misc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

System

Programming
Introduction

• What is System?
System is the collection of various
components
Ex:- College is a system
• What is Programming?
Art of designing and implementingthe
programs.
System programming
 Def: System programming focuses on developing software that
interacts closely with the hardware and the operating system. It
is responsible for managing and controlling the resources of a
computer system, such as memory, CPU, devices, and file
systems.
 Scope: System programming is concerned with the lower-level
aspects of software development and often deals with low-level
languages, like C and assembly language.
 Responsibilities:
1. Developing operating systems (e.g., Linux kernel, Windows
kernel).
2. Writing device drivers to interface with hardware components.
3. Creating system utilities and tools for system administrators.
4. Managing memory allocation and deallocation.
5. Implementing process and thread management.
Application programming
 Def: Application programming focuses on creating software
applications or programs that are used by end-users to
perform specific tasks or solve particular problems. These
programs run on top of an operating system and leverage its
services.
 Scope: Application programming is concerned with
developing high-level software using programming
languages like Python, Java, C#, or JavaScript.
 Responsibilities:
1. Building user interfaces for desktop, web, or mobile
applications.
2. Developing software applications such as word processors,
web browsers, games, and productivity tools.
3. Implementing business logic and algorithms specific to the
application's domain.
4. Interacting with databases, external services, and APIs.
What is Software ?

• Software is collection of many programs


• Two types of software
– System software
These programs assist general use application
programs
Ex:- Operation System , Assembler etc.
– Application software
These are the software developed for the specific
goal
• System Program:-
“These are programs which are required for
the effective execution of general user
programs on computer system.”
• System Programming:-
“ It is an art of designing and implementing
system programs.”
Components of System
Programming
1. Interpreter-software that examines a computer
program one instruction at a time and calls on
code to execute the machine operations required
by that instruction
2. Assembler-a program that takes basic computer
instructions and converts them into a pattern of
bits that the computer's processor can use to
perform its basic operations
Cont’

3. Compiler-a special program that translates a programming language's source code into machine
code, bytecode or another programming language. The source code is typically written in a
high-level, human-readable language such as Java or C++.
4. Macros -a rule or pattern that specifies how a certain input should be mapped to a replacement output
5. Microprocessors-any of a type of miniature electronic device that contains the arithmetic, logic,
and control circuitry necessary to perform the functions of a digital computer's central processing
unit
6. Formal systems-used to define the form (the syntax) of a programming language.
7. Debugger-a software tool that can help the software development process by identifying coding
errors at various stages of the operating system or application development
8. Linkers-an important utility program that takes the object files, produced by the assembler and
compiler, and other code to join them into a single executable file.
9. Operating system-the program that, after being initially loaded into the computer by a boot
program, manages all of the other application programs in a computer
Need Of System Software

The basic need of system software is to achieve the


following goals :-

• To achieve efficient performance of the system


• To make effective execution of general user
program
• To make effective utilization of human
resources
• To make available new, better facilities
Operating
System
• It is the collection of system programs which
acts as an interface between user and the
computer and computer hardware.
• The purpose of an operating system is to
provide an environment in which A user can
execute programs in a convenient manner
Functions of Operating
System
• File handling and management.
• Storage management (Memory management).
• Device scheduling and management.
• CPU scheduling.
• Information management.
• Process control (management).
• Error handling
• Protecting itself from user & protecting user from
other users.
Translators

• These are the system programs that converts the


source program into computer
understandable fashion
• An interpreter is a type of translator that
converts high-level code into machine
code line by line as it's executed.
Python, JavaScript, and Ruby use
interpreters.
• Types of translators
– Single Pass translator
Translators
• Assembler:-
• Assemblers are specific translators that
convert assembly language program code in to
the machine language program code.

Source program Target program /


Assembler M/C Lang. Prog.
Assembly Lang.
Prog.

Database

• Assembly language is a low-level human-


readable representation of machine code
Compiler:-
• Compilers are translators that convert high-level
programming languages (e.g., C, C++, Java) into
machine code or an intermediate code that can be
executed by a computer.e.g GCC(GNU compiler
collection)
Source program Compiler Target program /
High level Lang. M/C Lang. Prog.
Prog.

Database

• A compiler reads the entire source code of a


program and translates it into an intermediate code
or directly into machine code. It performs lexical
analysis, syntax analysis, optimization, and code
generation.

Cross Assembler:-
• type of assembler that runs on one computer
platform but generates machine code for a
different target computer architecture or
platform.
• Cross-assemblers are commonly used in
embedded systems development and for
programming microcontrollers or other Target program /
Source program
specialized hardware. M/C Lang. Prog.
Assembly Lang. Cross Assembler
Compatible with
Prog. Compatible M/C A
with M/C A

M/C B
Translators
• Cross Compiler:-
• These are the system programs which will automatically
translate the HLL program compatible with M/C A, in to the
machine language program compatible with M/C A , but the
underlying M/C is M/C B
Source program Target program /
HLL Prog. Cross Compiler M/C Lang. Prog.
Compatible with
M/C A

M/C B
Translators
• Interpreter
– It is the language translator which execute source
program line by line with out translating them into
machine language.
Types of Interpreter
– Pure Interpreter
• In this case no preprocessing is required on source
program before an interpretation starts.
• Some preprocessing is required on source program
before an interpretation starts.
Loader

• A Loader is system program that place the


object program into main memory and
prepares it for execution.
• Basic functions of loader
– Allocation
– Linking
– Relocation
– Loading
Types of Loader

• Compile-and-go Loader
• Relocating Loader
• Direct Linking Loader
• Absolute Loader
• General Loader
• Dynamic Loader
Macro & Macro processor

• Macro
– Macro is a single line abbreviation for a group of
instruction.

MACRO --------Start of definition


INCR -------- Macro name
A 1,DATA
A Sequence of instructions to
2,DATA be abbreviated.
A 3,DATA
MEND -------- End of definition
Linking and
Linker
• Linking
– The Process of merging many object modules to
form a single object program is called as linking.
• Linker
• The Linker is the software program which binds
many object modules to make a single object
program.
Formal
System
• A formal system is an un interpreted calculus.
It consists of
– Alphabets
– A set of words called Axioms.
– Finite set of relations called rules of inference or
production rules.
– Ex Boolean algebra.
Types of Assembly
Language
statements
• Imperative statements
–An imperative statement in assembly
language indicates the action to be
performed during execution of
assembly statement
Ex:- A 1,FOUR
• Declarative Statement:-
– These statements declares the storage area or
declares the constant in program.

– EX A DS 1
ONE DC “1”
• Assembler Directives
– These are the statements used to indicate certain
thing regarding how assembly of input program is
to be performed.

– Ex START 100
USING *, 15
Types of Assembler

• Single pass Assembler

• Multi pass Assembler


Problem of Forward Reference

• When the variables are used before their


definition at that time problem of forward
reference accurse.
Problem of Forward Reference

JOHN START 0
U S I N G *, 15
L 1,
FIVE A
1 , F O U R ST
F O U R D C F’4’
FIVE D C 1, F’5’
TEMP DTEMPS 1F
END
General Design Procedure of Two Pass
Assembler
1. Specify the problem
2. Specify data structures
3. Define format of data structures
4. Specify algorithm
5. Look for modularity [capability of one
program to be subdivided into independent
programming units.]
6. Repeat 1 through 5 on modules.
SOURCE PROGRAM FIRST PASS SECOND PASS
RAM START 0
U S I N G *, 15
L 1, 0 L 1,_(0,15) 0 L 1, 16(0,15)
FIVE
A 4 A 1,_(0,15) 4 A 1, 12(0,15)
1,FOUR
ST 1, TEMP 8 ST 1,_(0,15) 8 ST 1, 20(0,15)
F O U R D C F’4’ 12 4 12 4
FIVE D C F’5’ 16 5 16 5
TEMP D S 1F 20 -- 20 --
END
Specify the problem
Pass1: Define symbols & literals.

1) Determine length of m/c


instruction
2) Keep track of Location Counter
4)
3) Process
Remembersome pseudo
valuesops[EQU,DS
of symbols etc]
[POTGET1]
5) Remember Literals [LITSTO]

[MOTGET1
] [LC]
[STSTO]
Pass2: Generate object program
1) Look up value of symbols [STGET]
2) Generate instruction
[MOTGET2]
3) Generate data (for DS, DC & literals)
4) Process pseudo ops[POTGET2]
Step 2. Data structure:-

Pass1: Databases
• Input source program
• “LC” location counter used to keep track of each
instructions addr.
• M/c operation table (MOT) [Symbolic mnemonic
& length]
• Pseudo operation table [POT], [Symbolic mnemonic &
action]
• Symbol Table (ST) to store each lable & it’s value.
• Literal Table (LT), to store each literal (variable) & it’s
location.
• Copy of input to used later by PASS-2.
Step 2. Data structure:-

• Pass2: Databases
• Copy of source program input to Pass1.
• Location Counter (LC)
• MOT [Mnemonic, length, binary m/c op code, etc.]
• POT [Mnemonic & action to be taken in Pass2
• ST [prepared by Pass1, label & value]
• Base Table [or register table] indicates which registers
are currently specified using ‘USING’ pseudo op & what
are contents.
• Literal table prepared by Pass1. [Lit name & value].
Format of Data
Structures
• Machine Operation Table
– The op-code is the key and it’s value is the binary
op code equivalent, which is used for use in
generating machine code.
– The instruction length is stored for updating the
location counter.
– Instruction format is use in forming the m/c
language equivalent
Pseudo Operation Table
Symbol table & Literal table:-
Base table
Pass – I of
ASSEMBLER
Pass-II
Assemble
r
Machine Dependent and
Machine Independent
features
• M/C ofFeatures
Dependent Assembler
– A] Instruction format & addr. mode:-
– B] Program Relocation
• Machine Independent Assembler Features
– 1) Literals
– 2) Symbol defining statements
– 3) Expressions

You might also like