System Programming

Transcription

System Programming
PESIT Bangalore South Campus
Department of MCA
Course Information for
System Programming (13MCA24)
1.GENERAL INFORMATION
Semester(s): 2nd
Academic Year: 2015
2.
Title
Code
System Software
13MCA24
Duration (hrs)
Lectures
48 Hrs
Seminars
4 Hrs
Total:
52 Hrs
PRE REQUIREMENT STATEMENT
Students taking this subject should have knowledge of Assembly language
programming and sound knowledge about Computer organization and architecture.
3.
COURSE RELEVANCE
Understanding System Software is essential for any computer professional to do a
software projects which are system based . As detailed in the preface of the prescribed
text, even simple software systems are inherently quite complex.
System software trains engineers to use different system software programs such as
Assemblers, compilers, Loaders, Linkers, Compilers , Editors, debuggers from
computer science to solve the inherently difficult problems cost-effectively.
System Software was developed to address issues of large projects in system side
such as the Telecom, Avionics industry. Today they are pervasive in various domains
from specialized consoles telecom -based applications.
Although there have been drastic changes in the hardware and thereby software
products used in the last decade or so, the fundamental principles governing these
systems is the same.
This course focuses on the broad Concepts of System Software such as Basic
Machine architectures such as VAX, SIC, SIC/XE, RISC, CISC, PENTIUM PRO,
CRAY T3. And also different system software programs such as Assemblers,
Loaders, Linkers, Compilers, Lexical Analyzer, YACC parser, Debuggers, Editors
e.t.c.
4.
LEARNING OUTCOMES
• What is difference between System software and Application software
• To learn assembly language programming
• To construct the compilers
• To understand the concepts of Loaders, Linkers
• To understand the features of Editors and Debuggers
• To understand the architecture of compilers
• To learns the macro processor programming
5.
FACULTY DETAILS
Details
Name
D.Somashekhara Reddy
Department
MCA
Room
Number
516
E-mail
address
[email protected]
Contact
Hours
Office Hours
6. VENUE AND HOURS/WEEK
All lectures will normally be held in Conference room, 5th Floor.
Lecture Hours/week: 4Hrs
7. Module Map
Class
Chapter Title/
Reference
Literature
Topics Covered
Covered
1
Introduction to system software
2
Introduction to machine architecture
3
Machine Architecture Simplified Instructional Computer (SIC) - SIC Machine
Architecture
4
SIC Programming Examples.
5
Simplified Instructional Computer with Extra
Equipment (SIC/XE) – SIC/XE Machine Architecture
6
SIC/XE Programming Examples.
8
Basic Assembler Function.
9
A Simple SIC Assembler.
10
Assembler Algorithm and Data Structures,
11
Machine Dependent Assembler Features
12
Instruction Formats & Addressing Modes, Program
Relocation.
Assemblers
% of Portion
13
Machine Independent Assembler Features.
14
Literals, Symbol-Definition.
15
Statements, Expression, Program Blocks, Control
Sections.
16
One-Pass Assembler.
17
Multi-Pass Assembler.
6Hrs
11%
34%
12Hrs
18
Implementation Examples – MASM Assembler.
19
Basic Loader Functions - Design of an Absolute Loader
20
A Simple Bootstrap Loader.
21
Machine-Dependent Loader Features
22
Loaders and Linkers
Algorithm and Data Structures for a Linking Loader;
24
Machine-Independent Loader Features - Automatic
Library Search.
25
Loader Options, Loader Design Options - Linkage
Editor, Dynamic Linkage,
26
Boot Strap Loaders, Implementation Examples - MSDOS Linker.
27
Text Editors
Editors and
Debugging Systems
Editor Structure
30
Interactive Debugging Systems - Debugging Functions
and Capabilities.
31
Relationship With Other Parts Of The System.
32
User-Interface Criteria
33
Basic Macro Processor Functions - Macro Definitions
and Expansion.
34
Macro Processor Algorithm and Data Structures.
35
Machine-Independent Macro Processor Features Concatenation of Macro Parameters.
36
Generation of Unique Labels, Conditional Macro
Expansion.
37
Keyword Macro Parameters, Macro Processor Design
Options.
Macro Processor
61%
Overview of Editing Process, User Interface
29
38
50%
Relocation, Program Linking
23
28
8 Hrs
Recursive Macro Expansion, General-Purpose Macro
6Hrs
76%
8Hrs
Processors.
39
Macro Processing Within Language Translators.
40
Implementation Examples - MASM
Macro Processor, ANSI C Macro Processor.
41
Basic Compilers Functions
42
Grammars, Lexical Analysis
43
Syntactic Analysis
44
Code Generation
45
Machine Dependent Compiler Features
46
Intermediate Form of the Program
47
Machine dependent code Optimization
48
Machine Independent Compiler Features
49
Structured variables
50
Machine Independent code Optimization
51
Compilers
52
Compiler Design Options- Division into passes,
Interpreters
P-code Compilers, Compiler-Compilers
E S In
f logy – Education for the Real World – Course Information – B.E. 6th Semester CS 1
12Hrs
8.
RECOMMENDED BOOKS
Text Books:
1. Leland.L.Beck: System Software, 3rd Edition, Addison-Wesley, 1997.
(Chapters 1.1 to 1.3, 2 (except 2.5.2 and 2.5.3), 3 (except 3.5.2 and
3.5.3), 4 (except 4.4.3))
2. John.R.Levine, Tony Mason and Doug Brown: Lex and Yacc, O'Reilly,
SPD, 1998.
(Chapters 1, 2 (Page 2-42), 3 (Page 51-65))
Reference Books:
1. D.M.Dhamdhere: System Programming and Operating Systems, 2nd
Edition, Tata McGraw - Hill, 1999.
9.
ASSIGNMENT
1 Differentiate system software and application software.
2 Explain the architecture of SIC.
3 Briefly discuss the various instruction formats available in SIC/XE machine architecture.
4 Explain the addressing modes of SIC with an example each.
5 Explain the addressing modes of SIC/XE with an example each.
6 Explain the 2-pass algorithm of assembler.
7 Explain any three possible data structure for assembler implementation.
8 Explain the concept of relocation with an example.
9 Explain the machine independent features of an assembler.
10 Explain multi-pass assembler.
11 Briefly explain a simple boot-strap loader, with an algorithm or a source program.
12 Explain machine dependent loader features.
13 Explain a relocating loader.
14 Explain the concept program linking.
15 Write and explain the algorithm used for the design of linking loader.
A. WRITTEN EXAMINATION
No. Of
Questions
Exams date
Total Marks
8 Main
Questions
Paper Structure
No. of questions to be answered 5
Paper Duration
Pass Marks
100
B. CONTINUOUS ASSESSMENT
Assignment(s):
Seminar(s):
Test(s):
Total Marks:
Weighting
(%)
5 Marks (10%)
5 Marks (10%)
40 Marks
(80%)
50 Marks
3 Hrs
40
11 QUESTION BANK
Introduction and Machine architecture
1 Differentiate system software and application software.
2 Explain the architecture of SIC.
3 Briefly discuss the various instruction formats available in SIC/XE machine architecture.
4 Explain the addressing modes of SIC with an example each.
5 Explain the addressing modes of SIC/XE with an example each.
6 Differentiate between RISC and CISC machines.
7 Explain with the help of an example each the following instructions
a. ADDF b. COMPF c. COMPR d. DIVF e. DIVR
8 Explain with the help of an example each the following instructions
a. FIX b. FLOAT c. HIO d. NORM e. SIO
9 Explain with the help of an example each the following instructions
a. STCH b. LDT c. LDL d. JEQ e. RMO
10 Explain with the help of an example each the following instructions
a. STF b. RSUM c. SHIFTL d. TD e. WD
11 Explain how input and output operations take place in SIC using sample code.
12 Explain with the help of an example each the following instructions
a. TIO b. COMP c. LPS d. SVC e. TIX
13 Bring out the differences between traditional CISC machines and RISC machines.
14 Explain the VAX architecture with respect to the following:
(i)Memory (ii) Registers (iii) Instruction formats (iv) Addressing modes
(v) Input and output (vi)Data formats
15 With reference to Pentium Pro architecture, explain the following:
(i) Memory (ii) Registers (iii) Instruction formats (iv) Addressing modes
(v) Input and output
16 With reference to Ultra SPARC architecture, explain the following:
(i) Memory (ii) Registers (iii) Instruction formats (iv) Addressing modes (v) Input and
output
17 With reference to Cray T3E architecture, explain the following:
(i) Memory (ii) Registers (iii) Instruction formats (iv) Addressing modes (v) Input and
output
18 With reference to PowerPC architecture, explain the following:
(i) Memory (ii) Registers (iii) Instruction formats (iv) Addressing modes (v) Input and
output
ASSEMBLERS
OBJECTIVE: This unit discusses the basic assembler for SIC. It deals with the fundamental
operations of the assembler. Further it discusses some typical extensions to the basic
assembler. It discusses some of the most commonly encountered machine independent
language features and their implementation. Finally it deals with some important alternative
design schemes for an assembler
19 What are assembler directives? Explain with an example.
20 What are the functions of an assembler?
21 Explain the machine dependent features of an assembler.
22 Explain the 2-pass algorithm of assembler.
23 Explain any three possible data structure for assembler implementation.
24 Enlist the various assembler features that are machine-dependent and machineindependent. Explain any one of them from each.
25 Explain the concept of relocation with an example.
26 Explain the machine independent features of an assembler.
27 Explain control sections.
28 Explain one-pass assembler.
29 Explain multi-pass assembler.
30 Write a note on MASM assembler.
31 Write a note on SPARC assembler.
32 Write a note on AIX assembler.
33 Briefly explain the data structures required for a simple assembler.
34 What are assembler directives? Explain the START and LTORG. 4*
35 Describe how the symbol table and the operation table are used in a two pass assembler
with an example.
36 Generate object code for the below SIC/XE assembly language program. Also show the
contents of symbol table at the end of assembly process.
SUM START 4000
LDX #O
LDA #0
BASE COUNT
ADD TABLE,X
TIX COUNT
JLT LOOP
STA TOTAL
RSUB
TOTAL RESW 1
TABLE RESW 4000
COUNT RESW 1
END
Assume below OP codes(in hexadecimal)
LDX-04 JLT-38
LDA-00 STA-0C
ADD-18 RSUB-4C
TIX-2C
LOADERS AND LINKERS.
OBJECTIVE: This chapter aims in explaining the reader the three important processes:
• Loading, this brings the object program into memory for execution.
• Relocation, which modifies the object program so that it can be loaded at an address
different from the location originally specified.
• Linking, this combines two or more separate object programs and supplies the information
needed to allow references between them.
37 Explain the basic loader functions with the help of the algorithm show the design of
absolute loader.
38 Briefly explain a simple boot-strap loader, with an algorithm or a source program.
39 Explain machine dependent loader features.
40 Explain a relocating loader.
41 Explain the concept program linking.
42 Write and explain the algorithm used for the design of linking loader.
43 Explain the data structures used for linking loader.
44 Explain the machine independent loader features.
45 Explain linkage editors.
46 Write a note on dynamic linking.
47 Briefly describe the significant features of the Microsoft MS-DOS linker for Pentium and
other X86 systems.
48 Explain SunOS linker.
49 Explain Cray MPP linker.
EDITORS AND DEBUGGING SYSTEMS
OBJECTIVE: This section introduces some of the interactive debugging systems. It
discusses interactive text editing systems from the points of both the user and the system. It
gives a general overview of the editing process. it discusses the various types of user
interfaces and i/o devices. Finally it describes the structure of a typical text editor.
50 List the important four tasks to be accomplished by a text editor for an interactive usercomputer dialogue.
51 Write a note on the aspect of user-interface criteria in a text editor.
52 Explain the overview of editing process.
53 Explain user interface.
54 Explain editor structures.
55 Define debugging facilities in text editors.
56 Describe debugging functions and capabilities.
57 With the help of a neat block diagram describe a typical editor structure.
MACROPROCESSORS
OBJECTIVE: This chapter deals with design and implementation of Macro processors.
• It tells that a Macro represents a commonly used group of statements in the source
programming language and how a macro processor replaces each Macroinstruction with
corresponding group of statements.
• It also tells how the Macro processor is related to other pieces of system software such as
assemblers and compilers.
• Finally, it briefly presents three examples of actual Macro processors.
58 Define a macro.
59 Explain the concept of macro definition and macro.
60 Explain the terms with examples.
i) Macro Definition
ii) Macro Invocation
iii) Macro Expansion
61 With regard to the machine-independent macro processor features, explain the following:
(i) Concatenation of macro parameters
(ii) Generation of unique labels
(iii) Conditional macro expansion
(iv) Keyword macro parameters
62 Write and explain the macro processor algorithm.
63 What are the data structures used in the macro processor design?
64 Explain machine independent macro processor features.
65 Explain conditional macros with an example.
66 Explain keyword macro parameters.
67 Explain macro processor design.
68 Write a note on recursive macro.
69 Explain general-purpose macro processors.
70 Explain macro processing in compilers.
71 With an illustrative example, describe the macro processing features of Microsoft MASM
Macro processor.
72 Explain ANSI C macro language.
73 Explain ELENA macro processor.
74 Describe the salient features of ELENA Macro processor.
75 Write SIC assembly level language program to clear a 20-byte string to all blanks.
76 Write SIC/XE assembly level language program to clear a 20-byte string to all blanks.
Use
immediate addressing and register-to-register instruction to make the program efficient.
Write an assembly language program for instructions for SIC to initialize an array of 100
elements to 0.
78 Write an assembly language program for instructions for SIC/XE to initialize an array of
100 elements to 0.
79.Write an assembly language program for SIC machine that will read a 100 byte record and
write it into an output whose address is C0H. Use subroutine.
80 Write an assembly language program for SIC/XE machine that will read 100-byte record
and write it into an output whose address is C0H. Use subroutine.
81 Write an assembly language program to find the largest element in an array Recursively.
82
Write an assembly language program to sort in ascending order using bubble sort
algorithm, a given set of bytes sized unsigned numbers in memory. The sorted elements
should replace the original unsorted elements in memory.
83 Write an assembly language program to compute nCr given n and r using recursion.