SPCC-Practical Questions
SPCC-Practical Questions
PG1 START 0
** USING *,15
** L 1,FIVE
** A 1,FOUR
** ST 1,TEMP
FIVE DC F'5'
FOUR DC F'4'
TEMP DS 1F
** END PG1
MOT
A 5A
L 6A
ST 7A
END
POT
DS
DC
START
USING
Assemblers : Pass2 of Assembler .
Input: Assembly language program, MOT, POT, ST
Output: M/C code
Input
PG1 START 0
** USING *,15
** L 1,FIVE
** A 1,FOUR
** ST 1,TEMP
FIVE DC F'5'
FOUR DC F'4'
TEMP DS 1F
** END PG1
MOT
A 5A
L 6A
ST 7A
END
POT
DS
DC
START
USING
ST
FIVE 12
FOUR 16
TEMP 20
Macroprocessor : pass1 Macro processor.
Input: Assembly language program with Macro, Output: MNT, MDT
Input1:
MACRO
INCR
AR 2,3
MR 1,2
ST 1,2
MEND
PG1 START
USING *,15
L 1,FIVE
A 1, FOUR
INCR
ST 1,TEMP
M 1,FIVE
INCR
FIVE DC F’5’
FOUR DC F’4’
TEMP DS 1F
END
----------------------------------------------------------------------------------------------
Macroprocessor : Pass2 Macro processor.
Input: Assembly language program with Macro, MNT, MDT
Output: Expanded source code
Input1:
MACRO
INCR
AR 2,3
MR 1,2
ST 1,2
MEND
PG1 START
USING *,15
L 1,FIVE
A 1, FOUR
INCR
ST 1,TEMP
M 1,FIVE
INCR
FIVE DC F’5’
FOUR DC F’4’
TEMP DS 1F
END
Design Lexical Analyzer using C/ Java/Python
Input: HLL
Output: Collection of tokens
-----------------------------------------------------------------------------------------------------------
Design recursive descent parser for the grammar given below( Grammar may change)
E→TE’
E’→ +TE’ | epsilon
T→ FT’
T’→ *FT’ | epsilon
F→ (E) | id
---------------------------------------------------------------------------------------------------------------
Write program to generate three address code for given assignment, arithmetic and
relational statement
-----------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------