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

2150708

Uploaded by

Kacha Jaydeep
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)
19 views

2150708

Uploaded by

Kacha Jaydeep
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/ 2

Seat No.: ________ Enrolment No.

___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–V (NEW) EXAMINATION – WINTER 2018
Subject Code:2150708 Date:20/11/2018
Subject Name:System Programming
Time: 10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
MARKS
Q.1 (a) Remove left recursion from following grammar 03
A → Ac | Aad | bd | ε
(b) Consider a grammar S → aa | aSa, How a top down backtracking 04
parser can generate six occurrences of a?
(c) Construct an LL(1) parsing table for the following grammar. 07
S → aBDh
B → cC
C → bC | ε
D → EF
E→g|ε
F→f|ε

Q.2 (a) If the string a9b had been identified as identifier, but if in the 03
further use 9ab is written, which phase of compiler would
identify as an error? How?
(b) How a lexical analyzer recognizes unsigned numbers such as 04
12,12.3,12.3E4?
(c) Consider the assembly program fragment 07
START 200
READ A
LOOP MOVER AREG,A
SUB AREG,=’1’
BC GT,LOOP
STOP
A DS 1
What will be the intermediate code for the above program
fragment? What does START directive do? What will be the
difference if ORIGIN directive is used in place of START?
OR
(c) Consider the assembly program fragment, 07
MOVER CREG, B
ADD CREG, =’1’
BC ANY,NEXT
LTORG
=’5’
=’1’
SUB AREG,=’1’
END
=’1’
(i) Explain LTORG directive.
1
(ii)Explain the entries in mnemonic opcodes table as per
above code fragement.
(iii) How table of literals will be manipulated?
Q.3 (a) Which type of gap makes the software buggy or unreliable? 03
Which methods can be used to overcome this situation?

(b) How the use of programming language can help in making the 04
software reliable?
(c) Write Macro definition with following and explain. 07
(i) Macro using expansion time loop
(ii) Macro with REPT statment
OR
Q.3 (a) Write Macro definition for adding two numbers that uses 03
positional and keyword parameters.

(b) Write a macro definition for adding two numbers 10 times. Use 04
nested macro call to increment numbers by 1 every time in 10
iterations.
(c) Consider the following grammar for expressions 07
E → EAE | (E) | -E | id
A → + | - | * | / | ^ where ^ represents exponent. Generate operator
precedence relation matrix and show how id * id ^ id will be
parsed?
Q.4 (a) Justify “Postfix string is a popular intermediate code in non 03
optimizing compilers”
(b) Which are the methods used for identifying free memory area? 04
(c) Define program relocation. How address is corrected in address 07
sensitive instructions in case of program relocation.
OR
Q.4 (a) A program computes i*5 for 10 times. What type of optimization 03
can be applied?
(b) What is the structure of LEX program? 04
(c) Explain common sub expression elimination using value 07
numbers.
Q.5 (a) What is ambiguity in grammatic specification? 03
(b) Describe the facilities for dynamic debugging. 04
(c) Write a code fragment to find out whether number is odd or even. 07
Draw control flow graph. Perform control flow analysis.
OR
Q.5 (a) Describe three components of the interpreter. 03
(b) Define linking. How external reference is resolved in linking? 04
(c) What is memory binding? Explain dynamic memory allocation 07
using extended stack model.

*************

You might also like