Solve any one question from Q.1(a,b) &Q.2(a,b)
1(a)
Give the various data structures in the design of pass-1 of Two-pass direct linking loader.
4 M
1(b)
What are the assembler directives? Explain how assembler directives LTORG, ORIGIN and EQU are processed in first pass.
6 M
2(a)
For the 'C' code given below, give the different tables that would be generated as output of lexical analysis.
main ( )
{ Float average;
int i, sum, n=10;
sum = 0;
clrscr();
printf("Average of 10 nos. : % f" avg);
for (i -1; i<=10;i++)
Sum = sum+i;
avg = sum / (float) n;
}
main ( )
{ Float average;
int i, sum, n=10;
sum = 0;
clrscr();
printf("Average of 10 nos. : % f" avg);
for (i -1; i<=10;i++)
Sum = sum+i;
avg = sum / (float) n;
}
8 M
2(b)
Define macoprocessor and assembler.
2 M
Solve any one question from Q.3(a,b) &Q.4(a,b)
3(a)
For the following piece of assembly language code, show the contents of MDT, MNT, IC and EC
MACRO
INCR & ARG
LOAD 1, & ARG
ADD 1, = F'1'
STORE 1, & ARG
MEND
MACRO
DECR & NUM
LOAD 2, &NUM
SUB2, = F'1'
STORE 2, & NUM
MEND
START
DECR D1
STORE AREG, D1
INCR D2
D1 DC '50'
D2 DC '100'
END
MACRO
INCR & ARG
LOAD 1, & ARG
ADD 1, = F'1'
STORE 1, & ARG
MEND
MACRO
DECR & NUM
LOAD 2, &NUM
SUB2, = F'1'
STORE 2, & NUM
MEND
START
DECR D1
STORE AREG, D1
INCR D2
D1 DC '50'
D2 DC '100'
END
5 M
3(b)
Define loader and enlist the basic functions of loader.
5 M
4(a)
Using the algorithm convert following regular expression to DFA: (a.b)*.a.#
6 M
4(b)
Explain different parameter passing mechanisms in macro-processor.
4 M
Solve any one question from Q.5(a,b,c) &Q.6(a,b,c)
5(a)
Consider the grammar
E→E-E
E→
E→
Perform shift Reduce parsing of i/p string "id-id/id"
E→E-E
E→
E→
Perform shift Reduce parsing of i/p string "id-id/id"
4 M
5(b)
Explain recursive descent parser for the given grammar to derive the string cad S→cAd
A→ab/a
A→ab/a
6 M
5(c)
Compare bottom UP and top down parser.
6 M
6(a)
Consider the following grammar
\[S\rightarrow S(S)S/\varepsilon \]
Construct SLR parser and parse for the string (a,(a,a))
\[S\rightarrow S(S)S/\varepsilon \]
Construct SLR parser and parse for the string (a,(a,a))
10 M
6(b)
Explain YACC fiel structure.
4 M
6(c)
Compare SLR, CLR and LALR parsers.
4 M
Solve any one question from Q.7(a,b,c) & Q.8(a,b,c)
7(a)
Write down Syntax Directed Translation for assignment statement.
6 M
7(b)
For the grammar D→TL
T→int/real
L→L,id/id
Draw an annotated parse tree for the statement x1, x2;
T→int/real
L→L,id/id
Draw an annotated parse tree for the statement x1, x2;
6 M
7(c)
Write the method of generating intermediate code for the expression If (condition) then p = q Else x = y+z
4 M
8(a)
Define Syntax directed definition and syntax directed translation.
4 M
8(b)
Design dependency graph for the following grammar \( \begin{align*}&E\rightarrow E+T/T\\
&T\rightarrow T*F/F\\
&F\rightarrow id\end{align*} \)/
The expression given is: 5*8-10
The expression given is: 5*8-10
6 M
8(c)
For the following expression write its postfix expression, draw DAG and write three address code: \[((x+y)-((x+y)*(x-y)))+((x+y)*(x-y))\]
6 M
Solve any one question from Q.9(a,b,c) & Q.10(a,b)
9(a)
Compare between static, stack and heap allocation.
4 M
9(b)
With examples explain code generation issues.
6 M
9(c)
What are the different techniques of storage allocation.
6 M
10(a)
With examples explain at least four machine independent code optimization issues.
8 M
10(b)
Which are the machine dependent code optimization issues.
8 M
More question papers from Systems Programming