0% found this document useful (0 votes)
93 views

SP-2150708 - Assignments 2019

This document contains an assignment for a system programming course. It includes 12 questions covering topics like assemblers, macro processing, parsing and grammars. Some of the questions ask students to: 1) Define key terms related to system programming like assemblers, macros, grammars and parsing. 2) Explain concepts like single and two-pass assemblers, macro facilities, and the different phases of a language processor. 3) Complete tasks like generating symbol tables, writing macros, building parsing tables and parsing strings. 4) Compare concepts like problem-oriented vs procedure-oriented languages and single vs two-pass assemblers. The assignment requires students to demonstrate their understanding of fundamental system

Uploaded by

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

SP-2150708 - Assignments 2019

This document contains an assignment for a system programming course. It includes 12 questions covering topics like assemblers, macro processing, parsing and grammars. Some of the questions ask students to: 1) Define key terms related to system programming like assemblers, macros, grammars and parsing. 2) Explain concepts like single and two-pass assemblers, macro facilities, and the different phases of a language processor. 3) Complete tasks like generating symbol tables, writing macros, building parsing tables and parsing strings. 4) Compare concepts like problem-oriented vs procedure-oriented languages and single vs two-pass assemblers. The assignment requires students to demonstrate their understanding of fundamental system

Uploaded by

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

Institute of Technology,

Computer Science and Engineering

Assignment 1 - Unit 1 & 2


Submission Date:

1. Define Following
a. System Program h. Detranslator
b. System Software i. Interpreter
c. Specification gap j. Language Migrator
d. Execution gap k. Token
e. Language processor l. Pass
f. Language translator m. Semantic gap
g. Language preprocessor
2. Fill in the Blanks
a. _________ Phase performs type checking task.
(1) Lexical Analysis (2) Syntax Analysis (3) Semantic Analysis
b. A _____________________bridges an execution gap to the machine language of a
computer system(1) Detranslator, (2) Preprocessor, (3) Language translator
c. A _____________________bridges the specification gap between two programming
languages. (1) Interpreter (2) Language Migrator (3) Compiler
d. Syntax analysis processes the string of tokens built by _______________ to determine
the statement class. (1) Semantic Analysis (2) Lexical Analysis (3) Itself
3. State whether the following statements are true or false. Justify your answer.
1) An interpreter is a language translator.
2) Knowledge of software engineering helps us to bridge the semantic gap.
4. Brief note about address space.
5. Explain the various stages of the life cycle of a source program with a neat diagram
6. Explain different kinds of system software. Compare user-centric view and system-centric view of
system software.
7. List phases of a language processor. Explain roles of first two phases of it. Explain Symbol table.
8. Compare Problem oriented and Procedure oriented languages.
9. Explain language processing activities.
10. Perform lexical, syntax and semantic analysis on below C statement a=b+c*d*100+e/f
Where data type of b, c & e are integers and remaining all variables are float.

System Programming (2150708) – June 2019


Institute of Technology,
Computer Science and Engineering

Assignment 2 - Unit 3 & 4


Submission Date:

1. Define Following:
a. Assembler e. Macro
b. Literals f. Constant
c. Back patching g. Macro Assembler
d. Forward Reference
h. State True/False : Symbol table is used to store mnemonics and opcodes
i. State True/False: “Single pass assemblers cannot handle forward references.”
2. Compare single pass assembler and two pass assembler. Explain both type of assemblers in
detail with suitable example.
3. Explain in brief: Assembly Language Statements .What is assembler directive? List out and
explain all assembler directives.
4. Compare Variant I and Variant II of intermediate code generation for assembler?
5. Explain use of various data structures (tables) needed in PASS I of the assembler. Also
give details of their fields.
6. Explain advanced macro facilities with suitable example.
7. What is macro processor? Explain Design of Macro Preprocessor.
8. Explain positional parameters, keyword parameters and default value parameters for macros.
9. Explain various data structures of Macro definition processing with example.
10. Write and explain an algorithm for macro definition & Macro expansion.
11. Explain Nested Macro using example.
12. Consider the following assembly program

START 500 Instruction op codes:


READ N READ-09,
MOVER CREG, ZERO MOVER-04,
BK READ A MOVEM-05,
MOVER AREG, A ADD-01,
COMP AREG, MAX COMP-06,
BC LE, NT BC-07,
MOVEM AREG, MAX PRINT-10,
NT ADD CREG, ONE STOP-00
COMP CREG, N

BC LT, BK Assembler directive codes:


PRINT MAX START 01,
STOP END-02
N DS 1 Register code:
A DS 1 AREG-01,
CREG-03

System Programming (2150708) – June 2019


Institute of Technology,
Computer Science and Engineering

ZE‘O DC
ONE DC
MAX DC
END
(i) Identify task performed by above program.
(ii) Generate symbol table

12. Let us consider a two pass assembler and assume that each instruction is one word. Given an
assembly program and code for Mnemonics.

START 101 Mnemonics CODE


READ A STOP 00
READ B MULT 03
MOVER BREG, A MOVER 04
MULT BREG, B MOVEM 05
MOVEM BREG, D READ 09
STOP DS 02
A DS 1 START 01
B DS 1 END 02
D DS 1 Ordinal number of BREG is 2
END
Show content of symbol table at the end of pass-one of an assembler. Write intermediate code
representation of the assembly program. Use variant-II of intermediate code representation.
Write equivalent machine program.
1. Write Macro for following:
a. Write general purpose macro to move the contents of one area of memory into another area of
memory. Assume that destination area is larger in size, remaining part of it should be padded
with zeroes at the end of the area .
b. Define a macro taking starting_location and N as parameters to find summation of all N
numbers stored at locations starting from starting_location. The result is to be stored at
starting_location.
c. Write a macro which takes A, B, C and D as parameters and calculates A*B+C*D in AREG.

System Programming (2150708) – June 2019


Institute of Technology,
Computer Science and Engineering

Assignment 3 - Unit -6
Submission Date:

1. Define Following:
a. Scanning
b. Regular Grammar OR Regular h. Simple phrase grammar
Expressions i. Left recursion
c. FSA(Finite State Automaton) j. Top down parsing
d. Abstract Syntax trees k. operator grammar
e. Parsing l. Handle
f. Parse tree m. State True
g. Pattern.
/False : Top Down parsers can never work with left recursive grammar
2. Write regular expression for the following.
a. Real number with optional b. Identifier
fraction
c. For the language consisting of all strings ending with 1 and does not contain substring 00.
d. For a language containing a binary string which does not contain two consecutive 0s or
two consecutive 1s anywhere.
e. The language consists of all strings of a’s and b’s which ends with a and does not contain
bb.
f. A language consists of all strings of a’s and b’s which ends with b and does not contain
aa. Write regular expression for the language.
3. Build NFA & DFA for following regular expression
a. (a | b)* aba# e. (1*)* 0 (0|1)*#
b. (a | b)*abb# f. (0 | 1)*001#
c. a* (b* | c*) (a | c)* # g. (1+110)* 0#
d. (a* | b* )a*ab #
h. String ends with 1 but does not contain 00 as a substring
i. String with next to last symbol 0.
j. String that contain 101 as substring
4. What is grammar? List and explain various types of grammar. OR Discuss Classification of Grammar.
5. Construct LL(1) parsing table for following grammar.
1. S = iCtSeS | iCtS | a
C=b
2. E -> TA B -> *VB | ε
A -> +TA | ε V -> id | (E)
T -> VB
Parse following string using the parsing table.id * ( id + id) using 2nd grammar.

System Programming (2150708) – June 2019


Institute of Technology,
Computer Science and Engineering

6. What is Ambiguity in Grammatical Specification? How is it eliminated? Consider following grammar


S ->aSbS | bSaS | epsilon
Derive the string abab. Draw corresponding parse tree. Are these rules ambiguous? Justify.
7. Explain Left recursion, Left factoring and backtracking in top down parsing
with example.
8. Explain recursive decent parser with suitable example. Also state its drawbacks.
9. What is operator precedence parsing? Show operator precedence matrix for
following Operators +, - , * , ( , ) Parse following string: |- <id> + <id> * <id> -|
10. Compare top-down and bottom-up parser.Write unambiguous production rules to produce
arithmetic expression consisting of +, -, *, / , ^ (exponent), id.Use them for parsing id ^ id ^ id * id +
id / id using shift -reduce parser (Naïve bottom up parsing). Also lists limitation(s) of the method.

System Programming (2150708) – June 2019


Institute of Technology,
Computer Science and Engineering

Assignment 4 - Unit 5 & 7 & 8


Submission Date:

1. Define the following terms:


a. Translation time address f. Indirect triples
b. Linked time address g. Frequency reduction and triples
c. Load time address h. Linked origin
d. Translated origin i. Load origin
e. intermediate code j. Interpreter
2. What is Overlay? Explain the execution of an overlay structured program.
3. What is program relocation? How relocation is performed by linker? Explain self
relocating program.
4. Explain Absolute Loader & BSS Loader with example.
5. Explain dynamic linking. Draw the flaw chart for dynamic linking.
6. Write a brief note on MS-DOS linker.
7. In brief explain relocating loader.
8. Explain pure & impure interpreters. Explain benefits of interpreter. Compare interpreter and
compiler.
9. What is Peephole optimization? Describe various optimizing transformations used in compilers
10. Define and explain different intermediate code representations. Generate Quadruple,
Triple, Indirect Triple for following expression: ans=a+b*c/2.0
11. What is Memory Allocation? Differentiate Static and Dynamic memory allocation.

System Programming (2150708) – June 2019

You might also like