Vous êtes sur la page 1sur 4

JSPMs Rajarshi Shahu College of Engineering

Tathawde, Pune 33

Department of Information Technology 2011-12


Mid Term Test Marking Scheme Class: T.E Date: 06 /02/12 Subject: System Software Max Marks: 50 Time: 9.00 am to 10.30 am Instructions:
1) Draw neat diagrams wherever necessary. 2) Assume suitable data if necessary.

Q.1. i. ii. iii. iv. Ans: Q.2.

Define the following terms Compiler Loader Interpreter Macro-processor Definition and Explanation carries one mark for each term.

Assume the instruction op-codes for assembly mnemonic as given below. Instruction op-code Mnemonic Length 00 STDP 1 01 ADD 1 02 SUB 1 03 MULT 1 04 MOVER 1 05 MOVEM 1 06 BC 1 Generate Literal table, symbol table, intermediate code (using variant I) and target code, for the assembly language code given below: 16 START 200 MOVER AREG, = S MOVEM AREG, A LOOP MOVER AREG, A MOVER CREG, B ADD CREG, = 1 BC ANY, NEXT LTORG NEXT SUB AREG, = 1 BC LT, BACK LAST STOP ORIGIN LOOP + 2

A BACK B

MULT DS EQU DS END

CREG, B 1 LOOP 1 OR

Ans: Literal Table showing literal and its address symbol table Showing Symbol and its Address Intermediate code in the format of Varient I Q.1. i. ii. iii. iv. Ans: i. ii. iii. iv. Q.2. Ans: False, Justify True, Justify False, Justify False, Justify 2M 2M 2M 2M 12 4M 4M 4M

Say true or false and justify your answer : 08 Single pass assembler can handle forward references. Error, symbol used but not defined can be detected during pass I of two pass assembler. Assembler directives get translated into object code. The literals used in assembly language get memory allocated only after END.

Draw the flowchart of activities of pass I of two pass assembler. Activities of Pass I Symbol Table Generation Literal Table Generation Processing of the IS, AD, DS Intermediate code Generation

3M 3M 3M 3

Q.3.

In an assembly language program certain action is required at ten different places. Under what conditions would you code this as i) Macro ii) Subroutine? Justify your answer. 4 Explain what is MACRO with an example 1M Explain Subroutine with an example 1M Differentiate between both by considering there processes of 2 M definition and call.

Ans:

Q.4. Ans:

Explain with example, different types of parameters that are used in macro processor. 4

Enlist all Parameters Explain Keyword Parameter Explain Positional Parameter

2M 2M

Q.5.

Show macro name table, macro definition table and final expanded code for the assembly language code given below : 12 MACRO XYZ &A ST 1, & A MEND MACRO MPLS &Z MACRO &Z &W AR 4, & W XYZ ALL MEND ST & Z, ALL MEND PROG START USING *, 15 MPLS HELLO ST 2,3 HELLO YALE YALE EQU 5 ALL DC F3 END name table, macro definition table and final expanded code for the assembly language code

Ans: Macro Name Table with Macro name and MNTC and MDTP 3M Macro Definition Table containing definition of all MACRO 3M Expanded Source File which will have replaced all macro calls 3 M with is definition having actual parameters.

Q.3.

OR Explain the processing of all phases of compiler with respect to the assignment statement given below. Clearly mention input and output of each phase. p = i * r / 30 where i is integer variable while p and r are float type variables. 12 Give the detailed output of every phase and explain how it is generated as there are six phases each phase will carry 2 marks each.

Ans:

Q.4. Ans:

Distinguish between top down and bottom up parsers. Differentiate between Top Down and Bottom UP Parse 1 mark for each point 4 points are expected.

Q.5. Ans:

Explain with example the term ambiguous grammar. Explain Ambiguous grammar with an example.

4 4M

Question no. 06 is compulsory: Q.6. For the C code given below, give the different tables that would be generated as output of lexical analysis. main () { int i, sum, n; float avg; for (i = 1; i < = 10; i + +) sum = sum + i ; avg = sum / (float) n ; } Ans: Display the output as contents of each table. . Uniform Symbol Table Literal Table Identifier Table 4M 3M 3M

10

Vous aimerez peut-être aussi