System Programming - Question Bank Unit I and II (2024)
System Programming - Question Bank Unit I and II (2024)
Question Bank
Language Processors
1. Explain following.
(i) Execution Gap (iii) Phases of Compiler
(ii) Interpreter (iv) Language Migrator
2. List various phases of a language processor. Explain roles of first two phases of it.
Also explain symbol table.
3. Fill in the Blanks
(i) A _____________________bridges an execution gap to the machine language of a
Computer system.
(1) Detranslator, (2) Preprocessor, (3) Language translator
(ii) A _____________________bridges the specification gap between two programming
languages.
(1) Interpreter (2) Language Migrator (3) Compiler
(iii) _____________________ is designed to hold the value of formal parameters during
Expansion of macro call.
(1) Actual Parameter Table (2) Macro Name Table (3) Expansion time variable table
(iv) Syntax analysis processes the string of tokens built by _______________ to determine the
statement class.
(1) Semantic Analysis (2) Lexical Analysis (3) Itself
Page 1 of 5
Assemblers
Page 3 of 5
Macro Processors
1. (i) Write a macro that moves n numbers from the first operand to the second operand,
where n is specified as third operand of the macro.
(ii) Write a macro which takes B, C, and D as parameters and calculates B*C + C*D.
2. Compare the features of subroutine and macros with respect to following.
(i) Execution speed
(ii) Processing requirement by assembler.
(iii) Flexibility and generality
3. Explain advanced macro facilities with suitable example.
4. Explain design specification tasks for macro preprocessor with suitable example.
5. Explain following terms with suitable example.
(i) Expansion time variable (iii) Semantic Expansion
(ii) Positional parameter (iv) Macro Preprocessor
6. Do as directed
(i) A macro is a unit of specification for _________through expansion. (Fill in the blank)
(ii) Macro definition is enclosed between a __________statement and a_____________
statement. (Fill in the blank)
(iii) A _______________________________ is designed to hold the names of all macro
defined in a program. (Fill in the blank)
(iv) An ___________________________ counter is maintained to count the number of
nested macro calls. (Fill in the blank)
(v) A lexical expansion is typically employed to replace occurrence of formal parameters
by corresponding actual parameters. (State True/False)
(vi) Default specification of parameters is useful in situations where a parameter has the
different value in most calls. (State True/False)
Page 4 of 5
(vii) Macro definition table is maintained to hold value of sequencing symbols. (State
True/False)
7. Explain with examples - expansion time variables, expansion time statements - AIF
and AGO for macro programming. Show their usage for expansion time loop by giving
example.
8. Describe tasks and data structures considered for the design of a macro preprocessor.
9. Define two macros of your choice to illustrate nested calls to these macros. Also show their
corresponding expansion.
10. Explain attributes of formal parameters, default specifications of parameter and semantic
expansion for macro by giving examples.
11. What is macro in programming language. Write an algorithm to process macro definitions.
12. Draw a flow chart and explain simple one pass macro processor.
13. Explain macro expansion in details.
14. (i) Define a macro taking A and B as parameters to compute A = A * B + B * B + A + B
(ii) Explain positional parameters, keyword parameters and default value parameters for
macros.
15. (i) Define a macro taking starting_location and N as parameters to find summation of all
N numbers stored at locations starting from starting_location. The result is to be stored
at starting_location.
(ii) Illustrate expansion of nested macro calls by giving example.
16. What is Macro-Preprocessor? Explain steps of macro-preprocessor design.
Page 5 of 5