Solve any one question from Q1 and Q2
1 (a)
Explain how forward reference is handled in Single Pass assembler
and solve it for the given example
START 202 | |
MOVER AREG, = 5 | |
MOVEM AREG, A | |
LOOP | MOVER AREG, A |
MOVER CREG, B | |
ADD CREG, ='1' | |
MOVEM CREG, B | |
SUB CREG, A | |
BC ANY, NEXT | |
LTORG | |
ADD CREG, B' | |
BC LE LOOP | |
NEXT | SUB AREG, = '1' |
BC LT, BACK | |
STOP | |
ORIGIN 219 | |
MULT CREG, B | |
A | DS 1 |
BACK | EQU LOOP |
B | DS 1 |
END |
6 M
1 (b)
Explain different parameter passing mechanisms in Macro-processor.
4 M
2 (a)
Compare how the four basic tasks of loader are performed in BSS
loading scheme and DLL scheme.
4 M
2 (b)
Explain various advanced macro facilities like AIF, AGO, LCL, GBL,
REPT and IRP statements with syntax and example.
6 M
Solve any one question from Q3 and Q4
3
For the code given below, show macro name table, macro definition table,
Expanded code and the stack frame.
MACRO |
XYZ &A, &B, &C |
READ &A |
ADD&B, ='5' |
PRINT & C |
MEND |
MACRO |
MIT &Z |
MACRO |
&z&W |
SUB &W, ='6' |
XYZ AREA, BREG, CR |
ADD &W, ='5' |
MEND |
ADD CREG, ='5' |
MEND |
START 200 |
MIT HELLO |
MULT BREG, ='4' |
HELLO BREG |
C DS 1 |
END |
10 M
4 (a)
List down various phases of compiler. What are functions of Lexical
Analyzer? Explain patterns, tokens and lexemes with examples.
6 M
4 (b)
Give the flowchart for pass I of DLL scheme.
4 M
Solve any one question from Q5 and Q6
5 (a)
Differentiate between top down parser and bottom up parser.
4 M
5 (b)
Generate SLR parsing table for the grammar given below and parse
the string id1 + id2 + id3 * id4
Grammar:
E→ E+T/T
T→T* F/F
F→id.
Grammar:
E→ E+T/T
T→T* F/F
F→id.
10 M
5 (c)
Explain operator precedence parser.
4 M
6 (a)
Design LR( 1) parser for the given grammar. Also show the moves by the parser for input string ?ab?.
S→aABb.
A→c/ε
B→ d/ε.
S→aABb.
A→c/ε
B→ d/ε.
10 M
6 (b)
Compare SLR and LALR parsing methods.
4 M
6 (c)
Define Handle and handle pruning w.r.t. bottom up parser. For the grammar given, S→0S1/01
Identify the handles at each step and parse the string 000111.
Identify the handles at each step and parse the string 000111.
4 M
Explain the following:
7 (a) (i)
Dependency graph of Type expression.
4 M
7 (a) (ii)
Synthesized and inherited attributes.
4 M
7 (b)
Write the context free grammar for following and also perform syntax directed translation for the same into three address code. while condition do S.
8 M
8 (a)
Explain the need of Intermediate code generation in compiler. Generate quadruple and triple for the given expression: a = b + c * d.
8 M
8 (b)
Write the method of generating intermediate code for the Boolean
Expression.
8 M
Solve any one question from Q9 and Q10
9 (a)
Obtain the TAC for the following code before and after applying the
optimization techniques using.
i) Removal of Loop Invariants
ii) Elimination of common sub expressions
for (i=1; i<=10; i++)
X[i][2*j-1] = y[i][2*j-1]
i) Removal of Loop Invariants
ii) Elimination of common sub expressions
for (i=1; i<=10; i++)
X[i][2*j-1] = y[i][2*j-1]
12 M
9 (b)
Explain different intermediate code generation techniques.
4 M
10 (a)
Discuss code generation issues.
4 M
10 (b)
Discuss with suitable example machine dependent code optimization.
8 M
10 (c)
Write a short note on activation record.
4 M
More question papers from Systems Programming