SYSTEM PROGRAMMING & SYSTEM ADMINISTRATION UNIT-1 What Is System Program System Programs were developed to make computers better adapted to the needs of their users. Some examples of system program are: • Compliers • Loaders • Macro processors • Operating systems Brief Introduction Complier:- They are systems programs that accept people-like languages & translate them into machine language. Loaders:- They prepare machine language program for execution. Macro processors:- They allow programmers to use abbreviations. Operating Systems & file system:-They allow flexible storing & retrieval of information. ASSEMBLERS It is difficult for programmers to write or read programs in machine language. So they began to use a mnemonic (symbol) for each machine instruction ,which they would subsequently translate into machine language. Such a mnemonic language is known as ASSEMBLY LANGUAGE. ASSEMBLERS cont…. Assemblers are programs written to automate the translation of assembly language in to machine language. The input to an assembler program is called the source program. The output is a machine translation (object program). ASSEMBLERS cont…. 1. 2. 3. An assembly language is a machine dependent, low level programming language which is specific to a certain computer system . Three basic features which simplify programming : Mnemonic operation codes Symbolic operands Data declarations Execution of program written in a language L involves the following steps 1. 2. 3. 4. Translation of the program- by translator Linking of the program with other programs needed for its execution-by linker Relocation of the program to execute from the specific memory area allocated to it Loading of the program in the memory for the purpose of execution-by loader Program Execution Data Translator Linker Loader Binary Program Results Source Program Objects Modules Binary Programs Data flow Control flow LOADERS A loader is a program that places programs into memory & prepares them for execution. In a simple loading scheme, the assembler outputs the machine language translation of a program on a secondary device & a loader is placed in core (memory). Subroutines:- It is a body of computer instruction designed to be used by others routines to accomplish a task. LOADERS cont…. Two types of subroutines are Closed subroutines: It can be stored outside the main routine &control transfers to the subroutine. Open subroutines : It is one whose code is inserted into main program. MACROS Macro processing facility which permits the programmer to define an abbreviation for a part of his program & to use the abbreviation in his program. The macro processor treats the identical parts of program defined by the abbreviation as a macro definition & saves the definition. COMPLIERS A complier is a program that accepts a program written in a high level language & produces an object program. Example of high-level language are: FORTRAN COBOL ALCOL Interpreter : It is a program that appears to execute a source program as if it were machine language. SOFTWARE TOOLS Program that help in developing & using other programs. These programs, called software tools. Definition:- A software tool is a system program which 1. Interfaces a program with the entity generating its input data. 2. Interfaces the results of a program with the entity consuming them. A Software tool Originator Software Raw Program or Data Consumer Transformed Program or Data A Software tool Software Tools For Program Development 1. 2. 3. 4. 5. 6. Program design, coding, & documentation Preparation of programs in machine readable form Program translation, linkage & loading Program testing & debugging Performance tuning Reforming the data and/or results of a program to suit other programs. 1. Program Design & Coding 1. 2. Two categories of tools used in program design & coding are Program generators:- It generates a program which performs a set of functions described in its specification Programming environments:-It supports program coding by incorporating awareness of the programming language syntax & semantics in the lang. editor 2. Program Entry & Editing 1. 2. These are text editors or more sophisticated programs with text editors as front ends. The editor functions in 2 modes:Command mode Data mode Program Testing & Debugging 1. 2. 3. 4. Main steps in this are selection of test data for the program, analysis of test results to detect errors,& debugging i.e. localization & removal of errors. Software tools to assist the programmer in these steps are:Test data generators Automated test drivers Debug monitors Source code control systems EDITORS 1. 2. 3. 4. 5. Forms of Editors Line Editors Steam Editors Screen Editors Word Processors Structure Editors EDITORS cont… Line Editors:- The scope of edit operations in a line editor is limited to a line of text. The line is designed positionally,e.g. by specifying its serial number in the text, or contextually, e.g. by specifying a context which uniquely identifies it. EDITORS cont… Stream Editors:- A stream editor views the entire text as a stream of characters. They typically supports characters, line, & context oriented commands based on the current editing context indicated by the position of a text pointer. EDITORS cont… Screen Editors: - A line or stream editors does not display the text in the manner it would appear if printed. A screen editor uses the what-you –see-is-whatyou-get principle in editor design. This is very useful while formatting the text to produce printed documents. EDITORS cont… Word processors:- They are document editors with additional features to produce well formatted hard copy output. Essentials features are commands for moving sections of text from one place to another, merging of text, & searching & replacement of words. Many word processor support a spell-check option. EDITORS cont… Structures Editors:- A structure editor incorporates an awareness of the structure of a document. This is useful in browsing through a document ,e.g. if a programmer wishes to edit a specific function in a file. DEBUG MONITORS 1. 2. 3. 4. 5. It provide the following facilities for dynamic debugging : Setting breakpoints in the program Initiating a debug conversation when control reaches a breakpoint Display values of variables Assigning new values to variables Testing user defined assertions & predicates involving program variables. DEBUG MONITORS 1. 2. The sequence of steps involved in dynamic debugging of a program is as follows: The user complies the program under the debug option. The compiler produces two files- the compiled code file & the debug information file. The user activates the debug monitor & indicates the name if the program to be debugged . DEBUG MONITORS cont… 2. 3. The debug monitor opens the compiled code & debug information files for the program. The user specifies his debug requirements – a list of breakpoints & actions to be performed at breakpoints. The debug monitor instruments the program, & builds a debug table containing the pairs . DEBUG MONITORS cont… 4. 5. The instrumented program gets control & executes up to a breakpoints. A software interrupt is generated when the <SI_instrn> is executed. Control is given to the debug monitor which consults the debug table & performs the debug actions specified for the breakpoints . DEBUG MONITORS cont… 6. A debug conversation is now opened during which the user may issue some debug commands or modify breakpoints & debug actions associated with breakpoints. Steps 4 & 5 are repeated until the end if the debug session. PROGRAMMING ENVIRONMETS 1. 2. 3. 4. A programming environment is a software system that provides integrated facilities for program creation, editing, execution , testing, & debugging. It consists of the following components : A syntax directed editor (which is a structure editor) A language processor –a complier, interpreter, or both A debug monitor A dialog monitor