GTU Computer Engineering (Semester 6)
System Programming
June 2014
Total marks: --
Total time: --
INSTRUCTIONS
(1) Assume appropriate data and state your reasons
(2) Marks are given to the right of every question
(3) Draw neat diagrams wherever necessary


1 (a) (i) List and explain various types of grammar.
3 M
1 (a) (ii) Compare Problem oriented and Procedure oriented languages.
4 M
1 (b) Given following expression = - (a+b) *(c+d) + (a+b+c)
1. Draw a Syntax tree for the expression.
2. Write a three-address code for the expression.
3. Give triple representation for the three address code of the expression.
7 M

2 (a) 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.
7 M
2 (b) Define Simple Phrase and Handle. Using Handle and Simple Phrase trace the bottom up parsing algorithm. Grammar is :
E→T+E| T-E|T
T→T*V|T/V|V
V&rar;a|b|c|d
String is : a-b*c+d.
7 M
2 (c) When Left- factoring on a grammar is applied? Apply left- factoring on the below given grammar and perform Predictive Parsing. Grammar is
S→i E t S | i E t S e S | a
E→B
String is : i b t a e i b t a.
7 M

3 (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.
7 M
3 (b) Explain use and field of following tables of a macro
KPDTAB, MDT, EVTAB, SSTAB.
7 M
3 (c) Explain lexical and semantic expansion of macro with example.
7 M
3 (d) Explain with example expansion time sequencing symbols and expansion time Variable.
7 M

4 (a) Define forward references. How it can be solved using back-patching? Explain with example.
7 M
4 (b) List out the tasks performed by the analysis and synthesis phase of a 'Simple Assembly Language'.
7 M
4 (c) Consider the following assembly program
START 500
READ N
MOVER CREG, ZERO
BK READ A
MOVER AREG, A
COMP AREG, MAX
BC LE, NT
MOVEM AREG, MAX
NT ADD CREG, ONE
COMP CREG, N
BC LT, BK
PRINT MAX
STOP
N DS 1
A DS 1
ZERO DC '0'
ONE DC '1'
MAX DC '0'
END
Instruction opcodes:
READ-09, MOVER-04,MOVEM-05, ADD-01,COMP-06, BC-07, PRINT-10,
STOP-00
Assembler directive codes: START 01, END-02
Register code: AREG-01, CREG-03
1. Identify task performed by above program.
2. Generate symbol table.
3. Show intermediate code generated by above program.
7 M
4 (d) Explain operand and register descriptor with example. Also give best evaluation order for arithmetic expression: a+b*c+d*e↑f.
7 M

5 (a) Define static pointer. Find Register Requirement (RR) for the below given expression f+(x+y)*((a+b)/(c-d)).
7 M
5 (b) Prepare Symbol Table & Quadruple Table using Value Numbers method
Stmt No Statement
5 A = 29.3 * D
17 B=24.5
31 C=A*B +W
49 X=A*B + Y.
7 M
5 (c) Explain program relocation with example.
7 M
5 (d) Write a short note on MS-DOS Linker.
7 M



More question papers from System Programming
SPONSORED ADVERTISEMENTS