ALCCS
NOTE:
· Question 1 is compulsory and carries 28 marks. Answer any FOUR questions from the rest. Marks are indicated against each question.
· Parts of a question should be answered at the same place.
Q.1 a. Bring out the difference between program translator and interpreter.
b. Differentiate two categories of language processors-compilers and interpreters.
c. How literal references are handled in Pass I and Pass II assembler?
d. Discuss Chomsky hierarchy of grammar.
e. Explain Recursive descent parser.
f. Give a regular expression of all strings of 0’s and 1’s that begin with 0 and ends in 011.
g. Discuss in brief a linkage editor for the IBM PC. (7 4)
Q.2 a. Assemble the following part of the program manually, showing the resultant object code and symbol table using Load-and-Go assembler.( Instruction set table is given at the end)
Location |
Label |
Operation |
Operand |
12 |
|
READ |
PV |
-- |
|
-- |
|
47 |
|
LOAD |
PV |
49 |
|
ADD |
THERM+1 |
51 |
|
STORE |
PV |
-- |
|
-- |
|
92 |
PV |
SPACE |
|
93 |
THERM |
CONST |
386.2 |
94 |
|
CONST |
374.9 |
b. List the tasks performed by the analysis and synthesis phases of an assembler. (10+8)
Q.3 a. What is meant by optimizing transformations? Discuss five optimizing transformations commonly used in compilers.
b. Explain two compiler writing tools. (10+8)
Q.4 a. Perform “Top-Down parsing without backtracking” of expression <id>+<id>*<id> by rewriting the grammar rules
E::=T+E|T
T::=T *V|V
V::= <id>
What problems one may face due to the possibility of backtracking?
b. Explain directives ORIGIN and EQU with examples. (12+6)
Q.5 a. How does debug monitor facilitate dynamic debugging? List sequence of steps involved in dynamic debugging?
b. What is a software tool? Discuss in brief the software tools used in various steps of a program development. (9+9)
Q.6 a. Define:
(i) Translation time address, Linked address and Load time address.
(ii) Translated origin, Linked origin and load origin.
b. Explain the similarities and differences between the use of Macros and the use of subroutines.
c. What is automatic allocation and program controlled allocation? (6+6+6)
Q.7 a. Give the design of a relocating loader.
b. What for and how is transfer vector used by a loader? (10+8)
Instruction Set Table
Symbol |
Machine code |
Length |
No. of operands |
ADD |
02 |
2 |
1 |
BR |
00 |
2 |
1 |
BRNEG |
05 |
2 |
1 |
BRPOS |
01 |
2 |
1 |
BRZERO |
04 |
2 |
1 |
COPY |
13 |
3 |
2 |
DIVIDE |
10 |
2 |
1 |
LOAD |
03 |
2 |
1 |
MULT |
14 |
2 |
1 |
READ |
12 |
2 |
1 |
STOP |
11 |
1 |
0 |
STORE |
07 |
2 |
1 |
SUB |
06 |
2 |
1 |
WRITE |
08 |
2 |
1 |