Professional Documents
Culture Documents
Ques. Max
Question
No. Marks
For the following piece of assembly language code, show the contents of symbol table,
literal table, pool table and IC (Variant I and Variant II). Assume machine opcodes and
size of instruction as 1.
START 100
A DC 10
MOVER AREG,B
MOVEM BREG, = '1'
ADD AREG, = '2'
1-a SUB BREG, = '1' 07
B EQU A + 20
LTORG
STORE AREG, NUM
MOVER CREG, LOOP
ADD BREG, = '1'
NUM DS 5
LOOP DC 10
END
Pool Table :
Page 1 of 10
Literal
Pool Table
table: :
Pune Institute of Computer Technology, Pune-43
DEPARTMENT OF INFORMATION TECHNOLOGY
(Academic Year – 2019-20 Sem-II)
SAMPLE SOLUTION UNIT TEST - I
2-a Explain basic functions of loader. Also explain the working of compile and go loader. 04
Sol:- A loader is a system program that performs the loading function. It brings object
program into memory and starts its execution. The role of loader is as shown in the
following figure. In figure, translator may be assembler/complier, which generates the
object program and later loaded to the memory by the loader for execution.
With format explain the following macro directives: MACRO, MEND, AIF, AGO, LBL
2-b 06
and GBL.
Sol: Macro and MEND:
“A macro is a unit of specification for program generation through expansion.
Macro definition consist of name, a set of formal parameters and a body of code.
It replaces macro call into macro definition.
“The use of macro name with a set of actual parameters (macro call) is replaced
by some code generated from its body (macro definition), this is called macro
expansion.”
MEND Statement describes end of Macro.
AIF:
• Syntax:
AIF (<expression>) <sequencing symbol>
• Where <expression> is a relational expression consists of:
1. Ordinary strings.
2. Formal parameters with their attributes.
3. Expansion time variables.
• If the relational expression evaluates to true, expansion time control is transferred
to the statement containing <sequencing symbol> in its label field.
• Sequencing symbol(SS) has syntax
.<ordinary string>
Page 4 of 10
Pune Institute of Computer Technology, Pune-43
DEPARTMENT OF INFORMATION TECHNOLOGY
(Academic Year – 2019-20 Sem-II)
SAMPLE SOLUTION UNIT TEST - I
AGO:
• Syntax:
AGO <sequencing symbol>
• It unconditionally transfers expansion time control to the statement containing
<sequencing symbol> in its label field.
Page 5 of 10
Pune Institute of Computer Technology, Pune-43
DEPARTMENT OF INFORMATION TECHNOLOGY
(Academic Year – 2019-20 Sem-II)
SAMPLE SOLUTION UNIT TEST - I
Sol:
Lexical Analysis: Lexical Analyzer divides the given source statement into the
tokens.
Syntax Analysis: The syntax analyzer checks each line of the code and spots
every tiny mistake. If code is error free then syntax analyzer generates the tree.
Page 6 of 10
Pune Institute of Computer Technology, Pune-43
DEPARTMENT OF INFORMATION TECHNOLOGY
(Academic Year – 2019-20 Sem-II)
SAMPLE SOLUTION UNIT TEST - I
Page 7 of 10
Pune Institute of Computer Technology, Pune-43
DEPARTMENT OF INFORMATION TECHNOLOGY
(Academic Year – 2019-20 Sem-II)
SAMPLE SOLUTION UNIT TEST - I
Code Generation: The intermediate code instructions are translated into sequence
of machine instruction.
Using RE to DFA algorithm generate the DFA for the given Regular Expression.
3-b 05
(a+b)*a*b.
Sol:- Syntax Tree For RE:- (a+b)*a*b#
Page 8 of 10
Pune Institute of Computer Technology, Pune-43
DEPARTMENT OF INFORMATION TECHNOLOGY
(Academic Year – 2019-20 Sem-II)
SAMPLE SOLUTION UNIT TEST - I
Page 9 of 10
Pune Institute of Computer Technology, Pune-43
DEPARTMENT OF INFORMATION TECHNOLOGY
(Academic Year – 2019-20 Sem-II)
SAMPLE SOLUTION UNIT TEST - I
State a b
A={1,2,3,4} A B
B={1,2,3,4,5} A B
DFA:
-----------******-----------
Page 10 of 10