2150708
2150708
___________
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.
*************