SPOS QB
Unit 1: Introduction
1. Create a detailed flowchart that illustrates the logic and processing steps of Pass I of a two-pass
assembler. Explain the purpose of each step in the flowchart using a representative assembly
language code example.
2. Describe the step-by-step algorithm for Pass I of a two-pass assembler. Your explanation
should detail how it processes source code to build the symbol table, literal table, and generate
intermediate code.
3. Identify and explain the essential data structures and databases required for the design of a
two-pass assembler. For each data structure (e.g., Symbol Table, Mnemonic Opcode Table,
Pseudo Opcode Table, Literal Table), describe its format and contents with illustrative
examples.
4. Provide a detailed comparison between a literal and an immediate operand in the context of
assembly language programming, highlighting their differences in syntax, processing by the
assembler, and memory allocation.
5. Explain how a two-pass assembler processes different types of assembly language statements.
Specifically, describe the handling of imperative statements, declaration statements, and
assembler directives, providing clear examples for each category.
6. Using a variant of your choice for intermediate code representation, generate the complete
intermediate code for the following assembly language program snippet:
START 100
READ VAL1
MOVER AREG, VAL1
ADD AREG, ='5'
MOVEM AREG, RESULT
VAL1 DS 1
RESULT DS 1
END
7. Consider the following assembly code. Show the complete output after Pass I of a two-pass
assembler by detailing the final state of the Symbol Table, Literal Table, Pool Table, and the
generated intermediate code.
START 500
ENTRY LOOP
MOVER BREG, ='2'
MOVEM BREG, X
LOOP READ X
LTORG
SUB BREG, ='1'
BC GT, LOOP
X DS 1
END
8. Justify the necessity of each of the key data structures used in Pass I of a two-pass
assembler. Explain the specific problem that the Symbol Table, Literal Table, and Opcode Table
solve during the assembly process.
9. Provide a clear distinction between system software and application software, giving two
examples for each category. Additionally, list and explain at least four significant benefits of
programming in Assembly Language.
10.Construct a comprehensive diagram that illustrates the complete workflow of a two-pass
assembler, clearly showing the data flow and interaction between Pass I and Pass II. Explain
the primary function of each pass.
11.What is Systems Programming, and why is its study important for computer engineers?
12.Describe the software hierarchy using a neat diagram, showing the relationship between
hardware, system software, and application software.
13.Explain the typical machine structure, including components like memory, registers, and the
instruction set, from the perspective of a systems programmer.
14.Trace the evolution of key components of systems programming, including Text Editors,
Assemblers, Compilers, and Operating Systems.
15.What is a Text Editor, and what is its fundamental role in the software development process?
16.Define an Assembler and outline its two primary functions in translating assembly code to
machine code.
17.Describe the general structure of an Assembly Language statement, including its components
like label, opcode, and operand.
18.What is the pass structure of an assembler, and why is a two-pass design a common approach?
19.Explain the purpose and usage of Advanced Assembler Directives such as ORIGIN and EQU.
20.What are the different intermediate code forms that can be used by an assembler, and what are
the advantages of using them?
21.Describe the main tasks performed during Pass II of a two-pass assembler.
22.Write a short explanatory note on the roles of Loaders and Linkers in the program execution
sequence.
23.Explain the fundamental differences between how an assembler and a compiler process source
code.
24.What is a Debugger, and how does it assist a programmer in the software development
lifecycle?
25.Define Device Drivers and explain why they are classified as system software.
26.Explain the role of an Operating System as the ultimate form of system software that manages
hardware and software resources.
27.Explain the function and importance of the LTORG and END assembler directives with
examples.
28.How does a two-pass assembler effectively handle the problem of forward references in the
source code?
29.Explain the role and functionality of the Location Counter (LC) within an assembler.
30.Differentiate between machine-dependent and machine-independent features of an assembler.
Unit 2: Macro Processor and Compilers
1. Define what a Macro is in the context of systems programming. Discuss its main advantages
and explain how it differs from a traditional function or subroutine.
2. Explain the concepts of Macro Definition, Macro Call, and Macro Expansion using a single,
clear assembly language example to illustrate all three concepts.
3. What are the different data structures required for a Two-Pass Macro Processor? Justify the
need for each data structure during the processing of a macro definition, a macro call, and its
subsequent expansion.
4. Describe the detailed algorithm for Pass I of a two-pass macro processor, explaining how it
identifies and processes macro definitions.
5. Illustrate and explain all the phases of a compiler. Trace the complete compilation process for
the expression result = initial + rate * 60, showing the output of each phase
from lexical analysis to code generation.
6. Provide a comprehensive comparison between a Compiler and an Interpreter, highlighting
differences in their execution model, speed, error reporting, and use cases.
7. Differentiate between a Macro and a subroutine (or function) based on factors like expansion,
parameter passing, and execution overhead.
8. Explain the different mechanisms for passing arguments to macros, such as positional and
keyword parameters, using suitable examples for each.
9. What is the purpose of the AIF and AGO conditional assembly pseudo-operations in a macro?
Explain their functionality with a suitable macro definition example.
10.Using a clear example, explain the process of macro expansion with positional parameters.
Show the macro definition and how a macro call with specific arguments is expanded.
11.Describe the essential features of a macro facility, such as lexical substitution and argument
handling.
12.Explain the concept of conditional macro expansion and provide an example of a macro that
uses it.
13.How are macro calls handled when they are nested inside another macro definition? Provide a
code example to illustrate this scenario.
14.Explain the design and motivation behind a single-pass Macro processor. What are its primary
limitations?
15.What are macro instructions? Provide examples and explain how they are processed.
16.Detail the syntax and structure used to define a macro in a typical assembly language.
17.Draw a flowchart that illustrates the complete design of a two-pass macro processor, showing
both Pass I and Pass II.
18.What are the primary tasks performed in Pass II of a two-pass macro processor?
19.What is lexical substitution, and how does it form the core principle of macro expansion?
20.Explain the role and importance of the Lexical Analysis phase of a compiler in detail.
21.Explain the role and importance of the Syntax Analysis (or Parsing) phase of a compiler.
22.Explain the role and importance of the Semantic Analysis phase of a compiler.
23.Explain the purpose of the Intermediate Code Generation phase in a compiler and list two types
of intermediate representations.
24.Explain the primary goal of the Code Optimization phase in a compiler.
25.Explain the role of the final Code Generation phase in a compiler.
26.What is the function of the Symbol Table, and how is it used across the different phases of a
compiler?
27.Compare the working principles of a compiler and an interpreter from the perspective of a
developer and an end-user.
28.How does a two-pass macro processor handle nested macro definitions (i.e., defining one macro
inside another)?
29.Write a short note on the challenges of handling macro calls that appear within the body of
another macro.
30.What is a preprocessor, and how is a macro processor a type of preprocessor?