System Programming Question List
System Programming Question List
System Programming Question List
6 Define the following: Specification gap, Execution gap, Alphabet, Production, Binding, Non- terminal symbol,
Tokens.
7 Generate IR (Intermediate Representation) for the following program and show the steps for doing lexical
analysis, syntax analysis and semantic analysis:
int i;
float a, b;
a=b + i ;
8 Define programming language grammar.
9 What are the main activities of synthesis phase?
10 Which grammar is suited for programming language specification? Define it.
11 Define: Translator, System software, Non terminal symbol
12 What is grammar? Give classification of the grammar along with its example.
13 State True or false and justify:
1. A preprocessor is a language processor that bridges execution gap by generating an object code.
2. Syntax analysis is performed to check the validity of a production rule.
3. A non terminal symbol always appears as a leaf node of AST.
4. The term binding is an association of, a value of an entity with its attribute.
E = T E’
E’ = , T E’ | ε T = V T’
T’ = / V T’ | ε V = < id >
And also give the sequence of prediction made by parser for the source string like
├ < id > / < id > , < id > ┤.
2 How can you differentiate DFA with FSA? Build the DFA for regular expression (a|b)*bb(a|b)*.
3 What do you understand by operator precedence parsing? Parse the following string giving the Diagrammatic
trace of the algorithm.
<id>a + <id>b * <id>c
4 Write note on LL(1) parser
5 What is Parsing? Differentiate between parse tree and abstract syntax tree.
6 How continuation check and backtracking is performed in top down parsing?
7 List bottom up parsing algorithm. Also discuss drawbacks of this algorithm.
8 Define finite state automaton.
9 What is parsing? What are the basic problems faced by the Top-down parser? Explain in brief.
10 Differentiate top-down parsing and bottom-up parsing.
11 Write a regular expression for a real number with optional fraction.
12 Define: DFA and Regular Expression.
13 True/False. Justify : The term CSF in parsers refer to current sentential form.
14 Explain the significance of parsing. Given a string |- a - b * c + d -| draw operator precedence table for the symbols
present in the string. Using this table check the validity of the string.
Show all the intermediate steps of generating an AST.
Important Questions: Gujarat Technological University Questions
16 State true or false and justify your answer: RD parser is a top-down parser.
17 Using the following grammar of RD Parser show whether the following strings are valid or not:
E ::= T {+ T}*
T ::= V {* V}* V ::= <id>
Input String:
1) <id> * <id> * <id>
2) <id> + <id> * <id> <id>
18 Using the following LL(1) grammar show whether the following strings are valid or not:
E ::= TE’
E’ ::= -T E’ | ε T ::= VT’
T’ ::= /V T’ | ε V ::= <id>
Input String:
1) <id> - <id> / <id> 2) <id> / <id> - <id>
Assembler
1 Explain ORIGIN, EQU and LTORG assembler directives in detail.
2 Discuss Pass I of the assembler in detail.
3 What will be effect of statement A DS 200
1) 1 word will reserve for A with value 200.
2) 200 words will reserve and associate with name A
4 Describe the architecture of 8088 microprocessor in detail.
Important Questions: Gujarat Technological University Questions
6 What do you mean by forward reference? How single pass assembler take care of forward- reference?
START 300
B DC 3
MOVER AREG, =’5’
MOVEM AREG, A
L1 MOVER CREG, B ADD CREG, =’1’
COMP CREG, AREG
BC NE, NX
LTORG
=’5’
=’1’
NX SUB AREG, =’1’
COMP CREG, AREG
BC LT, LS
LS STOP
ORIGIN L1 + 2
MULT CREG, B
A DS 1
END
MACRO
CLEAR &X, &Y, &Z = AREG LCL &A
&A SET 5
MOVER &Z, 0
.MORE MOVEM &Z , &X + &A &A SET &A + 1
AIF ( &A NE &Y) .MORE MEND
15 True/False? Justify : Whenever a macro is called the macro code gets executed.
16 What is a macro? Give the various types of parameters used in macro definition.
17 Write a brief account on Expansion time variables.
Important Questions: Gujarat Technological University Questions
MACRO
INCR &MEM_VAL, &INCR_VAL, ®
MOVER ®, &MEM_VAL
ADD ®, &INCR_VAL
MOVEM ®, &MEM_VAL MEND
Compiler
1 What is an overall procedure for compilation of expression? Briefly explain the use of Operand Descriptors and
Register Descriptors in expression compilation.
2 Explain with example , The role of static and dynamic pointer for accessing local and nonlocal variable in block
structured language.
3 Write a short note on “Code Optimization”.
4 True/False? Justify : For accessing non local variable which pointer will be used?
1) Static Pointer
2) Dynamic Pointer
5 For evaluation of expression (a+b) / (c+d) which operation should perform first so that fewer MOVEM/MOVER
instructions required in generated code.
1) (a+b)
2) (c+d)
3) Any one of above
6 Explain allocation and access of local and non-local variable for a block structured language with below
given code.
void main()
{
int i=5;
{
int j=7;
{
int k=10, l=15; k=i;
}
}
}
19 Format of quadruple
20 Consider the following expression: a + b * c ^ d / e.
Construct the corresponding triple and quadruple format of the above expression.
21 Write a short note on code optimization
Loader and Linker
1 What is Program Relocation? Explain the use of EXTRN and ENTRY statements in linking.
2 What is the advantage of Overlay? How it works? Explain in detail.
3 A compiler typically generates a .OBJ file, which is later converted into .EXE or a .COM File.
Clearly describe the difference between the three files.