Gujarat Technological University
Gujarat Technological University
___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER–VI • EXAMINATION – WINTER • 2014
Subject Code: 160706 Date: 08-12-2014
Subject Name: System Programming
Time: 02:30 pm - 05:00 pm Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
Q.2 (a) Explain left recursion and left factoring with suitable example. 07
(b) Given a grammar 07
S→XS | dS | ε
X→Y | Zb | aY
Y→cZ
Z→e
Develop an LL(1) parsing table and check whether the string “dace” is accepted or
not?
OR
(b) Write a regular expression for the language consisting of all strings ending with 1 07
and does not contain substring 00. Convert the resultant regular expression into
Deterministic Finite Automata.
Q.3 (a) Which are the different assembly language statements? Explain each of them with 07
suitable example.
(b) Explain use of various data structures needed in pass-I of the assembler and give 07
details of their fields.
OR
Q.3 (a) List out various assembler directives. Explain any three with example. 07
(b) Given the following source program and code for mnemonics 07
1. Show the content of the symbol table at the end of pass-I of a two pass
assembler.
2. Show the intermediate code generated for program using variant-I of
intermediate code representation.
Assume that each instruction is one word.
1
Source Program Mnemonics code
START 100 START 01
A DS 3 END 02
L1 MOVER AREG,B ORIGIN 03
ADD AREG,C EQU 04
MOVEM AREG,D STOP 00
D EQU A+1 ADD 01
L2 PRINT D MOVER 04
ORIGIN A-1 MOVEM 05
C DC ‘5’ PRINT 10
ORIGIN L2+1 DC 01
STOP DS 02
B DC ‘25’ Ordinal number for AREG is 1
END L1
Q.4 (a) Explain default value parameter for macro and nested macro call with example. 07
(b) Explain following facilities for expansion time loop with example. 07
1. REPT statement 2. IRP statement
OR
Q.4 (a) Describe tasks and data structures considered for the design of a macro 07
preprocessor.
(b) What are advanced macro programming facilities? Explain with example. 07
Q.5 (a) What is program relocation? How relocation is performed by linker. Explain with 07
example.
(b) Consider the statement a=b+c*10.where a, b, c are of type float. Show the 07
translation of the given statement by different phases of compiler to produce
assembly language statement.
OR
Q.5 (a) What is code optimization? Explain with example various optimizing 07
transformations.
(b) Write a short note on absolute loader. 07
*************