0% found this document useful (0 votes)
95 views13 pages

System Software Solve Paper

The document discusses various topics related to system programming: 1. It defines a linker as a program that combines object files into a single executable file. It defines a macro as a named group of instructions or parameters. 2. It discusses assemblers and how they interpret assembly language into machine language. It also discusses loaders and their functions of allocation, linking, relocation, and loading. 3. The document describes different programming concepts like overlays, which allow programs to be larger than memory, and formal systems which are abstract structures for inference according to rules. It also defines siblings and pool tables.

Uploaded by

Arthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views13 pages

System Software Solve Paper

The document discusses various topics related to system programming: 1. It defines a linker as a program that combines object files into a single executable file. It defines a macro as a named group of instructions or parameters. 2. It discusses assemblers and how they interpret assembly language into machine language. It also discusses loaders and their functions of allocation, linking, relocation, and loading. 3. The document describes different programming concepts like overlays, which allow programs to be larger than memory, and formal systems which are abstract structures for inference according to rules. It also defines siblings and pool tables.

Uploaded by

Arthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Internal text paper:

System Programming:

Part – A

1. What is a linker.
 Linker is a computer system program that takes one or more object files and
combines them into a single executable file.
2. Define formal system.
 Formal system is an abstract structure used for inferring thermos from
axioms according to set of rules.
3. What is an assembler.
 Assembler is a type of computer program that interprets software programs
written in assembly language into machine language.
4. Give the syntax of a macro.
 macro – name (arg1, arg2 …. argN) or name macro parameters
5. Define overlays.
 Overlays is a programming method that allows programs to be larger than
the computer’s main memory.
6. What is a pool table.
 Pool table is a lookup table used to hold literals during assembly and
execution.
7. What are the function of loader.
 Allocation, Linking, Relocation, Loading.
8. How many bytes are used in RR and SS instruction registers.
 RR – 2 bytes, SS – 6bytes.
9. Define siblings.
 The node which belongs to the same parent are called as siblings.
Part – B
10. Explain compile and go loader.
 In this type of loader, the machine code in obtained and it is directly put in
the main memory at some known address. That means the assembler runs in one
part of memory and the assembled machine instructions and data is directly put
in to their assigned memory locations. After completion, the assembly process
assigned the starting address of the program to the location counter. The typical
example ie WATFUR – 77 , a FORTRAN compiler which user such “load and
go scheme. This loading scheme is called as “assemble and go.

Compiler Compiler and Go loader


User Program
and
Executable code of user
Go loader program

Main memory

11. Mention assembler directives.


 Assembly code and data into specified sections.
Reserve space in memory for uninitialized variables.
Control the appearance of listings.
Initialize memory.
Assembly conditional blocks.
Define global variables.
Specify libraries from which the assembler can obtain macros.
12. Different between interpreter and compiler.

Compiler Interpreter

Compiler scans the whole program in Translates program one statement at


one go. a time.
As it scans the code in one go, the Considering it scans code one line at
errors if any are shown at the end a time, errors are shown line by line.
together
Main advantage of compilers is its Due to interpreters being slow in
execution time. executing the object code, it is
preferred less.
It converts the source code into It does not converts source code into
object code. object code instead it scans it line by
line.
It does not require source code for It requires source code for later
later execution. execution.
Ex: c, c++, c# etc. Ex: python, ruby, perl, SNOBAL,
MATLAB etc.

13. What is assembly language.


 assembly language is a type of low level programming language that is
intended to communicate directly with a computers hardware.
14. Draw the parse tree for the expression: A= (B+C) – (D*E).

-

+ *

B C D E

Part – C
15. Draw pass I of an assembler.

16. Explain the structure of a compiler with a help of neat
diagram.

High level
Language

Lexical Analyzer

Syntax Analyzer

Semantic Analyzer
Symbol Error
table handling

Intermediate code generator

Code optimizer

Target code generation

Assembly code
Lexical analyzer: it is also called scanner. It takes the output of the preprocessor
as the input which is in a pure high level language, it also removes lexical
errors.
Syntax analyzer: it is sometimes called a parser. It constructs the parse tree. It
takes all the tokens one by one and uses context free grammar to construct the
parse tree.
Semantic analyzer: it verifies the parse tree, whether its meaningful or not. It
furthermore produces a verified parse tree. It also does type checking , label
checking, and flow control checking.
Intermediate code generator: it generates intermediate code which is a from that
can be readily executed by a machine we have many popular intermediate
codes. Intermediate code is converted to machine language using the last two
phases which are platform dependent.
Code optimizer: it transforms the code so that it consumes fewer resources and
produces more speed. The meaning of the code being transformed is not altered.
Optimization can be categorized in two types: machine dependent and machine
independent.
Target code generator: the main purpose of the target code generator is to write
a code that the machine can understand and also register allocation, instruction
selection, etc.

17. Explain code optimizer and target code in detail.


 Code optimizer: it transforms the code so that it consumes fewer resources
and produces more speed. The meaning of the code being transformed is not
altered. Optimization can be categorized in two types: machine dependent and
machine independent.
Target code generator: the main purpose of the target code generator is to write
a code that the machine can understand and also register allocation, instruction
selection, etc. the output is dependent on the type of assembler. This is the final
stage of compilation. The optimized code is converted into relocatable machine
code which then forms the input to the linker and loader.

18. Explain symbol table, literal table.


 Symbol table: it is a data structure being used and maintained by the
compiler, consisting of all the identifiers names along with their types. It helps
the compiler to function smoothly by finding the identifiers quickly.
Literal table: is used for keeping track of literals that are encountered in the
programs, We directly specify the value, literal is used to give a location for the
value, Literals are always encountered in the operand field of an instruction, it
created for storing the literals which are used in the program.

Part – D
19. Explain IBM 360 machine structure with a help of neat
diagram.

The instruction interpreter hardware is basically a group pf circuits that


performs the operation specified by the instructions fetched from the memory.
The location counter can also be called as program / instruction counter simply
points to the current instruction being executed.
The working register are often called as the “scratch pads” because they are
used to store temporary values while calculation is in progress.
This CPU interface with memory through MAR & MBR
MAR (Memory Address Register) contains address of memory location (to be
read from or stored into)
MBR (Memory Buffer Register) contains copy of address specified by MAR
Memory controller is used to transfer data between MBR & the memory
location specified by MAR.
The role of I/O channels is to input or output information from memory.

20. Explain lexical and syntax analyzer phase in detail.


 Lexical analyzer is also called a scanner. It takes the output of the
preprocessor (which performs file inclusion and macro expansion) as the input
which is in a pure high level language. It reads the characters from the source
program and group them into lexemes (sequence of characters that “go
together”). Each lexeme corresponds to a token. Tokens are defined by regular
expression which are understood by the lexical analyzer. It also removes lexical
errors (e.g. Erroneous characters) comments, and white space.
Syntax analyzer: is sometimes called a parser. It constructs the parse tree. It
takes all the tokens one by one and uses context free grammar to construct the
parse tree.
21. Explain direct linking loader.
 Direct linking loader is a general relocating loader and is the most popular
loading scheme presently used.
This scheme has an advantage that it allows the programmer to use multiple
procedure and multiple data segments.
In addition, the programmer is free to reference data or instructions that are
contained in other segments.
The direct linking loaders provide flexible intersegment referencing and
accessing ability.
Sep / oct 2021
Part – A
1. Define macros.
 Macros represents a group of commonly used statement in the source
programming language.
2. What is interpreter.
 Interpreter is a program that directly executes the instructions in a high level
language without converting it into machine code.
3. Assembler directives begins with which symbol.

4. What is forward reference.
 Forward reference occurs when a label is used as an operand.
5. Which pseudo ops were used for conditional macro expansion.
 AIF and AGO
6. Write any one different between macro and procedure.
 Macros requires more memory, Procedure requires less memory.
7. Define overlays.
 Overlays is a programming method that allows programs to be larger than
the computer’s main memory.
8. What is subroutine linkage.
 Subroutine linkage method is a way in which computers call and return the
subroutine.
9. What is dynamic loading.
 Dynamic loading is the technique through which a computer program at
runtime load a library into memory, retrieve the variable and function address,
executes the function and uploads the program from the memory.
10. What is lexical analysis.
 Lexical analysis is the first phase of the compiler also known as a scanner, it
converts the high level input program into a sequence of tokens.
11. What is YACC in compiler construct.
 YACC (yet another compiler compiler) is the standard parse generator for
the unix operating system.
12. List the type of translator.
 Compiler, Interpreter, Assembler.

Part – B
13. Write any three different between assembler and compiler.

Assembler Compiler
Assembler coverts the assembler Compiler converts the source code
code into the machine code. written by the programmer to a
machine level language.
Assembler input assembly language Compiler input source code.
code.

Assembler is less intelligent then a Compiler is more intelligent than an


compiler. assembler.

Assembler makes two phases over Compilation phases lexical, syntax,


the given input, first phases and the semantic, intermediate code generate,
second phase. code optimizer, code generator.
The output of assembler is binary The output of compiler of is a
code. mnemonic version of machine code.

GAS, GNU is an example of C, C++, Java and C# are example of


assembler. compiled languages.

14. Explain assembler directives.


 Assembler directives supply data to the program and control the assembly
process.
Assembly code and data into specified sections.
Reserves space in memory for uninitialized variables.
Initialization memory.
Assemble conditional blocks.
Define global variables.
Specify libraries from which the assembler can obtain macros.
15. Explain macro calls within macro.
 Macros calls consists of a name optionally followed by an actual parameter
list. The number of parameter list must be the actual parameter list must be the
same as the number of formal parameters specified in the definition of the
macros. If the macros has no formal parameter list, its call must have no actual
parameter list.
16. Explain the function of loader.
 Allocation: the loader determines and allocated the required memory space
for the program to execute properly.
Linking: the loader analyses and resolve the symbolic references made in the
object modules.
Relocating: the loader maps and relocates the address references to correspond
to the newly allocated memory space during execution.
Loading: the loader actually loads the machine code corresponding to the object
modules into the allocated memory space and makes the program ready to
execute.
17. Explain interpretation phase in compiler.

18. Explain dynamic linking.
 Dynamic linking is a process of loading the external shared libraries into the
program and then bind those shared libraries dynamically to the program.
The real linking occurs at run time when the executable file and libraries load to
the memory. It takes less load time.
The size of the executable file is lower. It is possible to update and recompile
the external libraries.
19. What are the different cards used by direct linking loader.

Part – C

20. Explain assembler language with its advantages and


disadvantages.
 Assembly language is a low level programming language, it helps in
understanding the programming language to machine code in.
21. What is an assembler. Explain different types of assembler.
 Assembler is a type of computer program that interprets software programs
written in assembly language into machine language and instructions that can be
executed by a computer.
Or
Assembler is a program for converting instruction written in low level assembly
code into relocatable machine code and generating along information for the
loader.
Types of assembler:
One pass assembler perform the whole conversion of assembly code to
machine code in one go.
Multi pass / two pass assembler first process the assembly code and store
values in the opcode table and symbol table. And then in the second step, they
generate the machine code using these table
22. Explain the implementation macro with in assembler.

23. Explain the design of direct linking loader.

24. Explain the database used in pass 1 and pass 2 loader scheme.

25. With an example. Explain the optimization phase.

26. What is the input and output of macro – processor? Explain
with an example.

27. Draw the flow chart for pass -1 assembler and explain.

Part – D

28. (a) Different between linking and loader.


(b) Explain the components of formal system.

29. Given the overview of two pass assembler with flowchart,
advantages and disadvantages.

30. Explain macro instructions defining macro with
implementation two pass algorithm.

31. (a) Explain complier and go loader scheme with diagram.
(b) Explain absolute loader.

32. With diagram explain general model of complier.

33. Explain the database used in compiler design.

34. Write a note on:
(a) General machine structure.
(b) Relocating loader.

You might also like