Download - Marking Scheme SS

Transcript
  • 8/2/2019 Marking Scheme SS

    1/4

    JSPMs

    Rajarshi Shahu College of EngineeringTathawde, Pune 33

    Department of Information Technology

    2011-12

    Mid Term Test Marking SchemeClass: 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. Define the following terms 4

    i. Compilerii. Loader

    iii. Interpreteriv. Macro-processorAns: Definition and Explanation carries one mark for each term.

    Q.2. 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 105 MOVEM 1

    06 BC 1Generate Literal table, symbol table, intermediate code (using variant I) and target

    code, for the assembly language code given below: 16START 200

    MOVER AREG, = SMOVEM AREG, A

    LOOP MOVER AREG, A

    MOVER CREG, B

    ADD CREG, = 1

    BC ANY, NEXTLTORG

    NEXT SUB AREG, = 1BC LT, BACK

    LAST STOP

    ORIGIN LOOP + 2

  • 8/2/2019 Marking Scheme SS

    2/4

    MULT CREG, B

    A DS 1

    BACK EQU LOOPB DS 1

    END

    OR

    Ans:

    Literal Table showing literal and its address 4 M

    symbol table Showing Symbol and its Address 4 M

    Intermediate code in the format of Varient I 4 M

    Q.1. Say true or false and justify your answer : 08i. Single pass assembler can handle forward references.

    ii. Error, symbol used but not defined can be detected during pass I of two passassembler.

    iii. Assembler directives get translated into object code.iv.

    The literals used in assembly language get memory allocated only after END.Ans:

    i. False, Justify 2 Mii. True, Justify 2 M

    iii. False, Justify 2 Miv. False, Justify 2 M

    Q.2. Draw the flowchart of activities of pass I of two pass assembler. 12Ans:

    Activities of Pass I

    Symbol Table Generation 3 MLiteral Table Generation 3 MProcessing of the IS, AD, DS 3 MIntermediate code Generation 3 M

    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

    Ans:

    Explain what is MACRO with an example 1 M

    Explain Subroutine with an example 1 MDifferentiate between both by considering there processes ofdefinition and call.

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

    processor. 4

    Ans:

  • 8/2/2019 Marking Scheme SS

    3/4

    Enlist all Parameters

    Explain Keyword Parameter 2 MExplain Positional Parameter 2 M

    Q.5. Show macro name table, macro definition table and final expanded code for theassembly language code given below : 12MACRO

    XYZ & AST 1, & A

    MEND

    MACROMPLS & Z

    MACRO

    &Z & W

    AR 4, & WXYZ ALL

    MENDST & Z, ALLMEND

    PROG START

    USING *, 15

    MPLS HELLOST 2,3

    HELLO YALE

    YALE EQU 5ALL 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 3 M

    Macro Definition Table containing definition of all MACRO 3 MExpanded Source File which will have replaced all macro calls

    with is definition having actual parameters.

    3 M

    OR

    Q.3.

    Explain the processing of all phases of compiler with respect to the assignmentstatement 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

    Ans:

    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.

  • 8/2/2019 Marking Scheme SS

    4/4

    Q.4. Distinguish between top down and bottom up parsers. 4Ans:

    Differentiate between Top Down and Bottom UP Parse 1 mark for

    each point 4 points are expected.

    Q.5. Explain with example the term ambiguous grammar. 4Ans:

    Explain Ambiguous grammar with an example. 4 M

    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 ;} 10

    Ans:

    Display the output as contents of each table.

    .

    Uniform Symbol Table 4 M

    Literal Table 3M

    Identifier Table 3M


Top Related