Академический Документы
Профессиональный Документы
Культура Документы
SYSTEMS PROGRAMMING
Systems programs includes use of system software's which
were developed to make computers better adapted to the needs of the users. SP introduces the more formal aspects of computer science including the presentation of formal systems & their application to programming languages. System software contains a variety of programs that support the operation of computer. Some of the system programs are Compilers, Loaders, macros processors, assemblers and OS. The 2 important concepts in SP are:: 1) Learn procedure for the design of software systems. 2) Provide a basis for judgment in the design of software.
PEOPLE
APPLICATION PROGRAMMING MACRO ASSEMBLER COMPILERS PROCESSOR S S TEXT DEBUGGIN SEARCHING LOADERS EDITORS G AIDS & SORTING I/O PROG
FILE SYSTEM S SCHEDU LAR DEVICE LIBRA MEMORY MANAGEMEN RIES MANAGEMENT T
specific problem with the help of computer users. Developed by experts or software developer. System software provides a general programming environment to the user. Operating system is a subset of the system software. Provide functions used by the application software. Provides the mechanisms for application software to share the hardware in an orderly fashion.
4
software: 1) To achieve efficient performance of system. 2) To make effective execution of general user program. 3) To make effective utilization of human resource. 4) To make available new & better facilities for development of programs. 5) To interact between user & computer hardware. 6) To make effective utilization of resources. Some of the system programs are : 1) ASSEMBLER 2) COMPILER 3) LOADER 4) MACRO PROCESSOR.
5
The assembly language program must be translated into machine language program by a separate program called as ASSEMBLER. The following diagram represents the working of a Assembler as:
SOURCE CODE
ASSEMBLER
ASSEMBLER
OBJECT CODE
LINKER
EXECUTABLE CODE
DATABASE S
LOADER
6
FUNCTIONS OF AN ASSEMBLER
There are seven functions of an Assembler as: 1)Allows programmer to use mnemonics while writing source code & translate them into machine lang. 2)Convert symbolic operands to their machine locations. 3)Translates mnemonic operation codes to machine language. 4)Checks the syntax of assembly program and generates diagnostic messages on syntax screen. 5)Assembles all the instructions in main memory for execution. 6)In case of larger assembly programs, it also provides linking facility among the sub-routines. 7)Facilitates generation of output on required output medium.
7
ASSEMBLER DIRECTIVES
Assembler directives instruct the assembler to
perform certain actions during assembly of a program. They can be used to declare variables, create storage space for results, & to declare constants. The following are the assembler directives used in program:: START, END, BYTE, WORD.
COMPILER
Compiler is a system software that accepts source program a high-level language & produces a corresponding object code Compiler replaces single-level statement with a series of machine language instructions. Compiler resides on a disk or on other storage media. When a program is to be compiled, its compiler is loaded into the main memory. During the time of translation, the compiler reads the source program & checks Syntax(grammatical) errors. If any error is found, the compiler generates an error message. Once the program has been compiled, the resulting machine code is saved separately, and can run on its own at any time.
9
10
INTERPRETER
The following diagram represents the working of an interpreter.
RESULT OF THE EXECUTED STATEMENTS.
INTERPRETER
An Interpreter is a Language Translator, that translates high level language program into machine language program.
11
COMPILER -- Vs -- INTERPRETOR
BASIS
OBJECT CODE
COMPILER
SEPARATE OBJECT PROGRAM
INTERPRETER
NO PERMAMENTLY SAVED OBJECT CODE FILE. LINE BY- LINE TRANSLATION. DEBUGGING BECOMES EASIER & FAST.
TRANSLATION CONVERTS ENTIRE PROGRAM PROCESS INTO MACHINE LANGUAGE AT ONE GO. DEBUGGING ERASE IMPLEMENTATION REMOVAL OF ERRORS (DEBUGGING) IS SLOW.
COMPLEX PROGRAMS. LESS COMPLEX. REQUIRES REQUIRES MORE MEMORY TO LESS MEMORY TO EXECUTE A EXECUTE A PROGRAM. PROGRAM. FAST & EACH STMT. IS SLOWER & EACH STMT IS TRANSLATED ONLY ONCE & TRANSLATED EVERY TIME IT SAVED IN OBJ FILE, WHICH IS EXECUTED FROM THE CAN BE EXECUTED AGAIN SOURCE PROGRAM. WITHOUT TRANSLATING
12 12
EXECUTION TIME
LOADER
Loaders are part of OS that brings an executable file residing on disk into memory and starts running. A loader is a system program that performs the function of a linker and then immediately schedules the executables for execution, without creating the executable file as an output. There are 4 Functions of a Loader as: 1. ALLOCATION:- allocates memory space for prgs. 2. LINKING:- Resolve symbolic references between object code. 3. RELOCATION:- execute program from its storage area. 4. LOADING:- place data, machine instructions into memory 13
LOADING SCHEMES
following loading schemes: 1) Compile-And-Go loaders. 2)General Loading scheme. 3)Absolute Loader. 4)Subroutine Linkages. 5)Relocating Loaders. 6)Direct Linking loaders. Other loading Schemes contains :: 1)Binders. 2)Linking loaders. 3)Overlays. 4)Dynamic Binders.
14
MACROS
To relieve programmers of the need to repeat identical parts of their programs, OS provides a macro-processing facility. Macros permits the programmer to define an abbreviation for a part of his program and to use this abbreviation in the program. The macro-processor treats the identical parts of the program defined by the abbreviations as a macro-definitions & saves them. The macro-processor then substitutes the definition for all occurrences of the macro call in the program. Macro facilities have been used as a general text handlers & for specializing OS to individual computer installations. In system generation, the entire OS is written as a 15 series of macro-definitions.
An operating system is a collection of system programs that together controls the operation of a computer system. It acts as an interface between the user and a computer hardware. It has two objectives: 1. It controls computer hardware. 2. To provide an interactive interface to the user and interpret commands so that the user can communicate with the hardware. Most common OS are 1)Windows family of OS developed by Microsoft. 2)Macintosh operating systems developed by Apple. 3)UNIX family of operating systems & 4) LINUX family of operating system. 16
OPERATING SYSTEM
I/O DEVICES
2.Providing an Interface
END USER
APPLICATION PROGRAMS UTILITIES OPERATING SYSTEM COMPUTERS HARDWARE Fig: Computer System Components
18
1. 2. 3. 4. 5. 6.
Batch-Processing OS. Time-Sharing (or) Multi user OS. Multi Tasking OS. Real Time OS. (or) RTOS. Multi Processor OS. Embedded OS.
19
Resource Allocation Process Management. Memory Management. Device Management. Security Management. Error handling. I/O programming.
20
FORMAL SYSTEMS
A formal system is an un-interpreted calculus which consists of an alphabet, a set of axioms(words) & a finite set of relations called rules of interference. Ex:: - Set theory, Boolean algebra etc. Formal systems are used to specify the syntax & semantics of the programming languages. They have been used in syntax-directed compilations, compiler verification & complexities studies of programming languages.
21
are the system programs that translates the source language into machine understandable code. There are 2 types of translators::1) Single pass translator. 2) Multi pass translator.
22
STRUCTURE OF AN ASSEMBLER
DATA STRUCTURES Sourc e PASS - I
Target PASS - II
Intermediate code Data access Control Transfer Fig:: Overview of two pass assembly.
24
Can handle forward references easily. LC processing is performed in the first pass & symbols
defined in the program are entered in the symbol table. The Second pass synthesizes the target program using the address information in Symbol table. First pass performs analysis of source program & Second pass performs synthesis of target program. First pass builds an intermediate representation (IR) of source, that can be used in Pass 2. This representation contains 2 main components:: Data structures.
26
27
1. Analysis phase:Determine address of symbol names & build up the Symbol table. Memory allocation is done using LC. LC points to the next memory word in target code even when machine instructions have variable lengths.
28
we need ::1) Address of memory word. (depends on source pgm.) 2) Machine Op-code corresponding to mnemonics. (assembly language) The data-structures used during synthesis are::1) Symbol Table 2) Mnemonics table. The following diagram represents these data structures as :
29
Mnemonics Table
Target
ASSEMBLER TYPES
1) Single pass assembler. 2) Multi-pass assembler. 3) Cross pass assembler.
TARGET LISTING
DB DB N M M
1 2 M
LOAD
10 FORWARD: STORE N
1006
NULL
called as Back-patching. APPLICATION OF ONE-PASS ASSEMBLER One pass assemblers are useful where external storage is slow or inconvenient to use.
33
MULTI-PASS ASSEMBLER
Multi-pass assembler is a solution to problem of
forward reference. Example: : ALPHA EQU BETA BETA EQU DELTA DELTA EQU 1
Can perform multiple passes.(usually 2 passes). Allows to use forward references in ORIGIN
statement tools.
34
CROSS-PASS ASSEMBLER
ASSEMBLY LANGUAGE CODE FOR MACHINE A CROSS ASSEMBLER MACHINE LANGUAGE CODE OF MACHINE A
MACHINE B
35
ASSEMBLER
The following steps should be followed by the
designer:: 1)Specify the problem. 2)Specify the data structures. 3)Define format of Data-structures. 4)Specify Algorithm. 5)Look for modularity (i.e. capability of 1 prg, to be subdivided into independent programming units) 6)Repeat steps 1 through 5 on modules.
36
FIG :: - Intermediate steps in Assembling a Program. FIRST PASS defines the symbols. SECOND PASS Generates instructions & addresses.37
produce its machine code. b)Evaluate the sub-fields. find values of each symbol, process literals & assign addresses. 2) Process Pseudo-ops.
38
39
40
INITIALIZE READ LABE L ON CARD YES NO SEARCH PSEUDO-OP FOUND TABLE (POT) POTGET NOT FOUND SEARCH MACHINE-OP TABLE (MOT) MOTGET GET LENGTH OF INSTRUCTION
FIG: PASS
INITIALIZE READ POTGET NOT FOUND MOTGET GET LENGTH ON LENGTH, TYPE & BINARY CODE STGET ASSEMBLE TOGETHER PARTS OF INSTRUCTION
FIG: PASS
TYPE ?
DS USING
INDICATE AVAILABLE BASE REGISTER (BT) INDICATE UNAVAILABLE BASE REGISTER (BT)
DROP
42