21CSE161 ModelQP
21CSE161 ModelQP
Note: 1. Answer one full question from each Module 1,2,3,4,5 (5Q x 20M=100 Marks)
Module 1
Q. Cognitives
Questions Marks CO PO
No Level
Generate the object code for the following SIC/XE program.
Also write the symbol table and calculate the program length.
Assume starting address 1000H
LDX #0
LDT #100
LOOP TD INDEV
JEQ LOOP
RD INDEV
1 (a) 10 1 1,2,3,4 Apply
STCH RECORD, X
TIXR T
JLT LOOP
INDEV BYTE X’F1’
RECORD RESB 100
END
OPCODE values are LDX=04, LDT=74, TD=E0, JEQ=30,
RD=D8, STCH=54, TIXR=B8, JLT=38, (X)=0000
Apply the concept of program blocks to a suitable code
1 (b) snippet and explain how program blocks helps us achieve 10 1 1,2,3,4 Apply
logical rearrangement of source program
OR
Apply program relocation to suitable example and show how
2 (a) 10 1 1,2,3,4 Apply
loader is informed about the relocation information
Write the algorithm for a pass-1 of two-pass assembler and
2 (b) 10 1 1,2,3,4 Apply
simple bootstrap loader
Module 2
Illustrate the structure of a compiler with neat diagram. Also
3 (a) apply the output of each phase for the expression given below 10 2 1,2,3,4 Apply
position=initial + rate*60
Write the transition diagram for specifying (i) identifiers
3 (b) 10 2 1,2,3,4 Apply
(ii) Signed numbers
OR
Apply input buffering strategy for any input and explain the
4 (a) 10 2 1,2,3,4 Apply
working of the same
4 (b) Illustrate the specification of tokens with suitable examples 10 2 1,2,3,4 Apply
1
USN:
Module 3
Make use of an example to explain the process of
identifying ambiguous grammar. Check whether the grammar
given below is ambiguous and if yes eliminate ambiguity for
5 (a) the following dangling-else grammar: 5 3 1,2,3,4,7 Apply
stmt -> if expr then stmt
| if expr then stmt else stmt
|other
2
USN:
(3+4)*(5+6)n
Signature of Chief
Signature of MQP Setter Signature of HoD Controller of
Examination
3
USN: