Get Latest Exam Updates, Free Study materials and Tips

[MCQ] System Programming And Compiler Construction

Module 1

1. Which of the following system software resides in main memory always ?
a. Text editor
b. Assembler
c. Linker
d. Loader
Answer: (d).
Loader

2. Daisy chain is a device for ?
a. Interconnecting a number of devices to number of controllers
b. Connecting a number of devices to a controller
c. Connecting a number of controller to devices
d. All of above
Answer: (b).
Connecting a number of devices to a controller

3. Which of the following type of software should be used if you need to create,edit and print document ?
a. Word processing
b. Spreadsheet
c. Desktop publishing
d. UNIX
Answer: (a).
Word processing

4. Producer consumer problem can be solved using ?
a. semaphores
b. event counters
c. monitors
d. all of above
Answer: (d).
all of above

5. What is bootstraping?
a. A language interpreting other language program
b. A language compiling other language program
c. A language compile itself
d. All of above
Answer: (c).
A language compile itself

6. Shell is the exclusive feature of
a. UNIX
b. DOS
c. System software
d. Application software
Answer: (a).
UNIX

7. A program in execution is called
a. Process
b. Instruction
c. Procedure
d. Function
Answer: (a).
Process

8. Which of the following can be used as a criterion for classification of data structures used in language processing.
a. nature of a data structure
b. purpose of a data structure
c. lifetime of a data structure
d. all of the above
Answer: (d).
all of the above

9. A UNIX device driver is
a. Structured into two halves called top half and bottom half
b. Three equal partitions
c. Unstructured
d. None of the above
Answer: (a).
Structured into two halves called top half and bottom half

10. Memory
a. is an device that performs a sequence of operations specified by instructions in memory
b. is the device where information is stored
c. is a sequence of instructions
d. is a computational unit to perform specific functions
Answer: (b).
is the device where information is stored

11. In which addressing mode, the operand is given explicitly in the instruction itself
a. absolute mode
b. immediate mode
c. indirect mode
d. index mode
Answer: (b).
immediate mode

12. In which addressing mode the effective address of the operand is generated by adding a constant value to the context of register
a. absolute mode
b. immediate mode
c. indirect mode
d. index mode
Answer: (c).
indirect mode

13. A garbage is
a. un-allocated storage
b. allocated storage with all across path to it destroyed
c. allocated storage
d. uninitialized storage
Answer: (b).
allocated storage with all across path to it destroyed

14. Which of the following program is not a utility?
a. Debugger
b. Editor
c. Spooler
d. All of the above
Answer: (c).
Spooler

15. A development stategy whereby the executive control modules of a system are coded and tested first, is known as
a. Bottom-up development
b. Top-down development
c. Left-Right development
d. All of the above
Answer: (b).
Top-down development

16. Systems software is a program that directs the overall operation of the computer, facilitates its use and interacts with the users. What are the different types of this software?
a. Operating system
b. Languages
c. Utilities
d. All of the above
Answer: (d).
All of the above

17. Which of the following systems software does the job of merging the records from two flies into one?
a. Documentation system
b. Utility program
c. Networking software
d. Security software
Answer: (b).
Utility program

18. A computer can not boot if it does not have the
a. compiler
b. loader
c. operating system
d. assembler
Answer: (b).
loader

19. The Process Manager has to keep track of:
a. the status of each program
b. the priority of each program
c. the information management support to a programmer using the system
d. both a and b
Answer: (d).
both a and b

20. A sequence of instructions, in a computer language, to get the desired result, is known as
a. Algorithm
b. Decision Table
c. Program
d. All of the above
Answer: (c).
Program

21. Action implementing instruction’s meaning are a actually carried out by
a. Instruction fetch
b. Instruction decode
c. Instruction execution
d. Instruction program
Answer: (c).
Instruction execution

22. Running time of a program depends on
a. The way the registers and addressing modes are used
b. The order in which computations are performed
c. The usage of machine idioms
d. All of these
Answer: (d).
All of these

23. A bottom up parser generates
a. Right most derivation
b. Right most derivation in reverse
c. Left most derivation
d. Left most derivation in reverse
Answer: (b).
Right most derivation in reverse

24. Object program is a
a. Program written in machine language
b. Program to be translated into machine language
c. Translation of high-level language into machine language
d. None of the mentioned
Answer: (c).
Translation of high-level language into machine language

25. Which of the following system software resides in main memory ?
a. texteditor
b. assembler
c. linker
d. all of these
Answer: (d).
all of these

26. Software that allows your computer to interact with the user, applications, and hardware is called
a. application software
b. word processor
c. system software
d. database software
Answer: (c).
system software

27. Programs that coordinate computer resources, provide an interface between users and the computer,
and run applications are called
a. utilities
b. operating systems
c. device drivers
d. language translators
Answer: (b).
operating systems

28. Specialized programs that allow particular input or output devices to communicate with the rest of
the computer system are called
a. operating systems
b. utilities
c. device drivers
d. language translators
Answer: (c).
device drivers

29. Also known as a service program, this type of program performs specific tasks related to managing
computer resources.
a. utility
b. operating system
c. language translator
d. device driver
Answer: (a).
utility

30. In order for a computer to understand a program, it must be converted into machine language by
a(n)__________.
a. operating system
b. utility
c. device driver
d. language translator
Answer: (d).
language translator

31. Which of the following is not a function of the operating system?

a.Manage resources
b.Internet access
c.Provide a user interface
d.Load and run applications
Answer: (b).
Internet access

32. The items that a computer can use in its functioning are collectively called its
a. resources
b. stuff
c. capital
d. properties
Answer: (a).
resources

33. Programs that coordinate all of the computer’s resources including memory, processing, storage, and
devices such as printers are collectively referred to as
a. language translators
b. resources
c. applications
d. interfaces
Answer: (b).
resources

34.A compiler is a software tool that translates ___________that the computer can understand.
a. Algorithm into data
b. Source code into data
c. Computer language into data
d. None of the above
Answer: (b).
Source code into data

35. The object code is then passed through a program called a ___________ which turns it into
an executable program.
a. Integer
b. Source code
c. Linker
d. None of the above
Answer: (c).
Linker

36. When a computer is first turned on or restarted, a special type of absolute loader is executed, called a
a. Compile and Go loader
b. Boot loader
c. Bootstrap loader
d. Relating loader
Answer: (c).
Bootstrap loader

37. What is memory in Computer ?
a. is a sequence of instructions
b. is the device where information is stored
c. is an device that performs a sequence of operations specified by instructions in memory
d. none of these
Answer: (b).
is the device where information is stored

38. A program –
a. is a sequence of instructions
b. is the device where information is stored
c. is a device that performs a sequence of operations specified by instructions in memory
d. none of these
Answer: (a).
is a sequence of instructions

39.The __ of a system includes the program s or instructions.
a. icon
b. software
c. hardware
d. information
Answer: (b).
software

40. E-mail addresses separate the user name from the ISP using the __ symbol.
a. @
b. *
c. .
d. %
Answer: (a).
@

Module 2

1. In a two pass assembler the object code generation is done during the ?
a. Second pass
b. First pass
c. Zeroeth pass
d. Not done by assembler
Answer: (a).
Second pass

2. Which of the following is not a type of assembler ?
a. one pass
b. two pass
c. three pass
d. load and go
Answer: (c).
three pass

3. In a two pass assembler, adding literals to literal table and address resolution of local symbols are done using ?
a. First pass and second respectively
b. Both second pass
c. Second pass and first respectively
d. Both first pass
Answer: (d).
Both first pass

4. In a two pass assembler the pseudo code EQU is to be evaluated during ?
a. Pass 1
b. Pass 2
c. not evaluated by the assembler
d. None of above
Answer: (a).
Pass 1

5. Which of the following system program foregoes the production of object code to generate absolute machine code and load it into the physical main storage location from which it will be executed immediately upon completion of the assembly ?
a. Macro processor
b. Load and go assembler
c. Two pass assembler
d. Compiler
Answer: (b).
Load and go assembler

6. Translator for low level programming language were termed as
a. Assembler
b. Compiler
c. Linker
d. Loader
Answer: (a).
Assembler

7. An assembler is
a. programming language dependent
b. syntax dependant
c. machine dependant
d. data dependant
Answer: (c).
machine dependant

8. An imperative statement
a. Reserves areas of memory and associates names with them
b. Indicates an action to be performed during execution of assembled program
c. Indicates an action to be performed during optimization
d. None of the above
Answer: (b).
Indicates an action to be performed during execution of assembled program

9. In a two-pass assembler, the task of the Pass II is to
a. separate the symbol, mnemonic opcode and operand fields.
b. build the symbol table.
c. construct intermediate code.
d. synthesize the target program.
Answer: (d).
synthesize the target program.

10. TII stands for
a. Table of incomplete instructions
b. Table of information instructions
c. Translation of instructions information
d. Translation of information instruction
Answer: (a).
Table of incomplete instructions

11. Assembler is a machine dependent, because of?
a. Macro definition table(MDT)
b. Pseudo operation table(POT)
c. Argument list array(ALA)
d. Mnemonics operation table(MOT)
Answer: (d).
Mnemonics operation table(MOT)

12. Assembler is ?
a. A program that places programs into memory an prepares them for execution
b. A program that automate the translation of assembly language into machine language
c. A program that accepts a program written in high level language and produces an object program
d. Is a program that appears to execute a source program as if it were machine language
Answer: (b).
A program that automate the translation of assembly language into machine language

13. Forward reference table(FRT) is arranged like ?
a. Stack
b. Queue
c. Linked list
d. Double linked list
Answer: (c).
Linked list

14. Assembler is a program that
a. places programs into memory and prepares then for execution
b. automates the translation of assemble language into machine language
c. accepts a program written in a high level language and produces an object program
d. appears to execute a resource as if it were machine language
Answer: (b).
automates the translation of assemble language into machine language

15. A single two pass assembler does which of the following in the first pass
a. It allicates space for the literals
b. It computes the total length of the program
c. It builds the symbol table for the symbols and their values
d. all of the above
Answer: (d).
all of the above

16. Which of the following is not a function of pass1 of an assembler
a. generate data
b. keep track of LC
c. remember literals
d. remember values of symbols until pass 2
Answer: (a).
generate data

17. An Assembler converts
a. machine code to mnemonics
b. high level language to assembly level
c. assembly language to machine language
d. all of the above
Answer: (c).
assembly language to machine language

18. ____ converts the programs written in assembly language into machine instructions .
a. Machine compiler
b. Interpreter
c. Assembler
d. Converter
Answer: (c).
Assembler

19. The instructions like MOV or ADD are called as ______ .
a. OP-Code
b. Operators
c. Commands
d. None of the above
Answer: (a).
OP-Code

20.Instructions which wont appear in the object program are called as _____ .
a. Redundant instructions
b. Exceptions
c. Comments
d. Assembler Directives
Answer: (d).
Assembler Directives

21. The assembler stores all the names and their corresponding values in ______ .
a. Special purpose Register
b. Symbol Table
c. Value map Set
d. None of the above
Answer: (b).
Symbol Table

22. When dealing with the branching code, the assembler
a. Replaces the target with its address
b. Does not replace until the test condition is satisfied
c. Finds the Branch offset and replaces the Branch target with it
d. Replaces the target with the value specified by the DATAWORD directive
Answer: (c).
Finds the Branch offset and replaces the Branch target with it

23. The last statement of the source program should be _______ .
a. Stop
b. Return
c. OP
d. End
Answer: (d).
End

24. _____ directive specifies the end of execution of a program .
a. End
b. Return
c. Stop
d. Terminate
Answer: (b).
Return

25. In a two-pass assembler, the task of the Pass II is to
a. separate the symbol, mnemonic opcode and operand fields.
b. build the symbol table.
c. construct intermediate code.
d. synthesize the target program.
Answer: (d).
synthesize the target program.

26. Address symbol table is generated by the
a. memory management software
b. assembler
c. match logic of associative memory
d. generated by operating system
Answer: (b).
assembler

27. Which of these features of assembler are Machine-Dependent ?
a. Instruction formats
b. Addressing modes
c. Program relocation
d. All of the mentioned
Answer: (d).
All of the mentioned

28. In a two pass assembler pseudo code,equ is to be evaluated during
a. pass 1
b. pass 2
c. not evaluated by the assembler
d. none of these
Answer: (a).
pass 1

29. The translator used by second generation languages is?
a. assembler
b. interpreter
c. compiler
d. linker
Answer: (a).
assembler

30. A simple two-pass assembler does which of the following in the first pass ?
a. It allocates space for the literals
b. It computes the total length of the program
c. It builds the symbol table for the symbols and their values
d. All of these
Answer: (d).
All of these

31. In analyzing the compilation of PL/I program, the term “Machine independent optimization” is assosiated with
a. creation of more optical matrix
b. recognition of basic elements and creation of uniform symbols
c. use of macro-processor to produce more optimal assembly code
d. recognization of basic syntactic construction through reductions
Answer: (a).
creation of more optical matrix

32. In analyzing the compilation of PL/I program the description ” resolving symbolic address ( lables ) and generating machine language ” is associated with
a. syntax analysis
b. code generation
c. storage assignment
d. assembly and output
Answer: (d).
assembly and output

33. In analyzing the compilation of PL/I program the description ” creation of more optimal matrix ” is assosiated with
a. syntax analysis
b. code generation
c. assembly and output
d. machine independent optimization
Answer: (d).
machine independent optimization

34. In a single pass assembler, most of the forward references can be avoided by putting the restriction
a. that the data segment must be defined after the code segment
b. on the number of strings/lifereacts
c. on unconditional rump
d. None of these
Answer: (a).
that the data segment must be defined after the code segment

35. Which of the following translation program converts assembly language programs to object program
a. Loader
b. Compiler
c. Assembler
d. Macroprocessor
Answer: (c).
Assembler

36. Loop is a collection of nodes that is
a. strongly connected and has a unique entry
b. loosely connected and has a unique entry
c. strongly connected
d. none of these
Answer: (a).
strongly connected and has a unique entry

37. Pass 2 –
a. perform processing of assembler directives not done during pass 1
b. write the object program and assembly listing
c. assemble instruction and generate data
d. all of these
Answer: (d).
all of these

38. Pass I –
a. save the values assigned to all labels for use in pass 2
b. perform some processing of assembler directives
c. assign address to all statements in the program
d. all of these
Answer: (d).
all of these

39. Which table is permanent databases that has an entry for each terminal symbol ?
a. Literal table
b. Identiier table
c. Terminal table
d. None of these
Answer: (c).
Terminal table

40. Which of the following system program forgoes the production of object code to generate absolute machine code and load it into the physical main storage location from which it will be executed immediately upon completion of the assembly?
a. compiler
b. macroprocessor
c. two pass assembler
d. load-and-go assembler
Answer: (d).
load-and-go assembler

41. __________ converts the programs written in assembly language into machine instructions.
a) Machine compiler
b) Interpreter
c) Assembler
d) Converter
Answer: c
Explanation: An assembler is a software used to convert the programs into machine instructions.

42. The instructions like MOV or ADD are called as ______
a) OP-Code
b) Operators
c) Commands
d) None of the mentioned
Answer: a
Explanation: This OP – codes tell the system what operation to perform on the operands.

43. The alternate way of writing the instruction, ADD #5,R1 is ______
a) ADD [5],[R1];
b) ADDI 5,R1;
c) ADDIME 5,[R1];
d) There is no other way
Answer: b
Explanation: The ADDI instruction, means the addition is in immediate addressing mode.

44. Instructions which won’t appear in the object program are called as _____
a) Redundant instructions
b) Exceptions
c) Comments
d) Assembler Directives
Answer: d
Explanation: The directives help the program in getting compiled and hence won’t be there in the object code.

45. The assembler directive EQU, when used in the instruction: Sum EQU 200 does ________
a) Finds the first occurrence of Sum and assigns value 200 to it
b) Replaces every occurrence of Sum with 200
c) Re-assigns the address of Sum by adding 200 to its original address
d) Assigns 200 bytes of memory starting the location of Sum
Answer: b
Explanation: This basically is used to replace the variable with a constant value.

46. The purpose of the ORIGIN directive is __________
a) To indicate the starting position in memory, where the program block is to be stored
b) To indicate the starting of the computation code
c) To indicate the purpose of the code
d) To list the locations of all the registers used
Answer: a
Explanation: This does the function similar to the main statement.

47. The directive used to perform initialization before the execution of the code is ______
a) Reserve
b) Store
c) Dataword
d) EQU
Answer: c
Explanation: None.

48. _____ directive is used to specify and assign the memory required for the block of code.
a) Allocate
b) Assign
c) Set
d) Reserve
Answer: d
Explanation: This instruction is used to allocate a block of memory and to store the object code of the program there.

49. _____ directive specifies the end of execution of a program.
a) End
b) Return
c) Stop
d) Terminate
Answer: b
Explanation: This instruction directive is used to terminate the program execution.

50. The last statement of the source program should be _______
a) Stop
b) Return
c) OP
d) End
Answer: d
Explanation: This enables the processor to load some other process.

51. When dealing with the branching code the assembler ___________
a) Replaces the target with its address
b) Does not replace until the test condition is satisfied
c) Finds the Branch offset and replaces the Branch target with it
d) Replaces the target with the value specified by the DATAWORD directive
Answer: c
Explanation: When the assembler comes across the branch code, it immediately finds the branch offset and replaces it with it.

52. The assembler stores all the names and their corresponding values in ______
a) Special purpose Register
b) Symbol Table
c) Value map Set
d) None of the mentioned
Answer: b
Explanation: The table where the assembler stores the variable names along with their corresponding memory locations and values.

53. The assembler stores the object code in ______
a) Main memory
b) Cache
c) RAM
d) Magnetic disk
Answer: d
Explanation: After compiling the object code, the assembler stores it in the magnetic disk and waits for further execution.

54. The utility program used to bring the object code into memory for execution is ______
a) Loader
b) Fetcher
c) Extractor
d) Linker
Answer: a
Explanation: The program is used to load the program into memory.

55. To overcome the problems of the assembler in dealing with branching code we use _____
a) Interpreter
b) Debugger
c) Op-Assembler
d) Two-pass assembler
Answer: d
Explanation: This creates entries into the symbol table first and then creates the object code.

Module 3

1. Non-modifiable procedures are called ?
a. concurrent procedures
b. serially usable procedures
c. reentrant procedures
d. topdown procedures
Answer: (b).
serially usable procedures

2. The translator which perform macro expansion is called a
a. Macro processor
b. Macro pre-processor
c. Micro pre-processor
d. assembler
Answer: (b).
Macro pre-processor

3. A macro definition consists of
a. A macro prototype statement
b. One or more model statements
c. Macro pre-processor statements
d. All of the above
Answer: (d).
All of the above

4. A macro is
a. a small program inside a program
b. set of special instructions
c. a unit of specification for program generation through expansion
d. None of the above
Answer: (c).
a unit of specification for program generation through expansion

5. A ________________ statement declare the name of macro.
a. macro prototype
b. macro definition
c. macro identification
d. None of the above
Answer:
macro prototype statement

6. During macro expansion each statement is replaced by
a. the original program
b. the sequence of assembly statement
c. by specific synbols
d. None of the above
Answer: (b).
the sequence of assembly statement

7. Each macro statement is marked with the __________ sign preceded it.
a. +
b. @
c. ~
d. $
Answer: (a).
+

8. The flow control during macro expansion is
a. combination
b. chronological
c. indexable
d. sequential
Answer: (d).
sequential

9. A model statement contains call for another macro is called as
a. referential macro call
b. nested macro call
c. inbuilt macro call
d. inherited macro call
Answer: (b).
nested macro call

10. Expansion time variables are used
a. Before expansion of micro calls
b. only during expansion of macro calls
c. After expansion of micro calls
d. Any one of the above
Answer: (b).
only during expansion of macro calls

11. Macro processor is an inbuilt function of ?
a. Loader
b. Editor
c. Linker
d. Assembler
Answer: (d).
Assembler

12. If a number of instructions are repeating through the main program, then to reduce the length of the program, ……. is used.
a. procedure
b. subroutine
c. macro
d. none of the mentioned
Answer: (c).
macro

13. The process of assigning a label or macroname to the string is called
a. initialising macro
b. initialising string macro
c. defining a string macro
d. defining a macro
Answer: (d).
defining a macro

14. A macro within a macro is called
a. macro-within-macro
b. nested macro
c. macro-in-macro
d. none of the mentioned
Answer: (b).
nested macro

15. A macro can be defined at
a. beginning of a program
b. end of a program
c. after initialisation of program
d. anywhere in a program
Answer: (d).
anywhere in a program

16. A macro can be used
a. in data segment
b. to represent directives
c. to represent statements
d. all of the mentioned
Answer: (d).
all of the mentioned

17. The end of a macro can be represented by the directive
a. END
b. ENDS
c. ENDM
d. ENDD
Answer: (c).
ENDM

18. Inserting the statements and instructions represented by macro, directly at the place of the macroname, in the program, is known as
a. calling a macro
b. inserting a macro
c. initializing a macro
d. none of the mentioned
Answer: (a).
calling a macro

19. The time required for execution of a macro is ……… that of procedure.
a. greater than
b. less than
c. equal to
d. none of the mentioned
Answer: (b).
less than

20. Which of the following statements is incorrect?
a. complete code of instruction string is inserted at each place, wherever the macroname appears
b. macro requires less time of execution than that of procedure
c. macro uses stack memory
d. macroname can be anything except registers and mnemonics
Answer: (c).
macro uses stack memory

21. The beginning of the macro can be represented as
a. START
b. BEGIN
c. MACRO
d. none of the mentioned
Answer: (c).
MACRO

22. Nested Macro calls are expanded using the
a. FIFO rule (First in first out)
b. LIFO (Last in First out)
c. FILO rule (First in last out)
d. None of the above
Answer: (b).
LIFO (Last in First out)

23. Macro-processors are ______
a. Hardware
b. Compilers
c. Registers
d. None of the above
Answer: (b).
Compilers

24. Macro processor is an inbuilt function of –
a. Assembler
b. Loader
c. Linker
d. Editor
Answer: (a).
Assembler

25. A processor-
a. is a sequence of instructions
b. is the device where information is stored
c. is a device that performs a sequence of operations specified by instructions in memory
d. none of these
Answer: (c).
is a device that performs a sequence of operations specified by instructions in memory

26. A co-processor-
a. is used to support in software
b. is used in fifth generation computers
c. is used in combination with every application
d. none of these
Answer: (a).
is used to support in software

27. Advantage of incorporating the macro-processor into pass 1 is that
a. many functions have to be implemented twice
b. more flexibility is available to the programmer in that he may use all the features of the assembler in conjunction with macros.
c. functions are combined and it is not necessary to create intermediate files as output from the macro-processor and input to the assembler.
d. all of these
Answer: (d).
all of these

28. In which way a macro processor for assembly language can be implemented?
a. Processor incorporated into pass 1 of a standard two pass assembler
b. Independent one-pass processor
c. Independent two-pass processor
d. All of these
Answer: (d).
All of these

29. What are x and y in the following macro definition? macro Add x, y Load y Mul x Store y end macro
a. variables
b. identifiers
c. formal parameters
d. actual parameters
Answer: (c).
formal parameters

30.What is the value of X printed by the following program ? program COMPUTE ( input, output ); var X : integer ; procedure FIND ( X: real ) ; begin X : = sqrt ( X ) ; end ; begin X : = 2 FIND(X);

writeln(X);

end.
a. n
b. 2
c. √2
d. Run-time error
Answer: (b).
2

31. Which of the following macros can put a macro assembler into an infinite loop ?
a. MACRO M1, XIF EQ, X if X = 0 then….M1 X + 1ENDCIF NE, X : IF X ≠ 0 then……WORD X : address (X) is stored hereENDCENDM
b. MACRO M2, XIF EQ, XM2 XENDCIF NE, XWORD X + 1ENDCENDM
c. both (a) and (b)
d. none of these
Answer: (b).
MACRO M2, XIF EQ, XM2 XENDCIF NE, XWORD X + 1ENDCENDM

32. If control signals {a,b,c,d,e,f,g} for some micro instructions and their corresponding MCCS (Maximum Compatibility Classes) are [ad f* g, abd, beg, b deg} then to determine minimal MCC cover, we need to remove
a. afd
b. bcg
c. adfg
d. bdeg
Answer: (a).
afd

33. The conditional expansion facility of macro procesors is provided to
a. to expand certain model statements depending upon the value of a condition during the execution of the expanded program
b. test a condition during the execution of the expanded program
c. Both (a) and (b)
d. to expand certain model statements depending upon the value of a condition during the process of macro expansion.
Answer: (c).
Both (a) and (b)

34. The advantage(s) of incorporating the macro processor into pass 1 is/ are:
a. many functions do not have to be implemented twice
b. more flexibility is available to the programmer in which he/she may use all the features of the assembler in conjunction with macros
c. Functions are combined and it is not necessary to create intermediate files as output from the macro processor and input to the assembler
d. All of the above
Answer: (d).
All of the above

35. In which way(s) can a macro processor for assembly language be implemented?
a. independent one-pass processor
b. independent two-pass processor
c. processor incorporated into pass of a standard two-pass assembler
d. all of the above
Answer: (d).
all of the above

Module 4

1. The linker ?
a. is same as the loader
b. is required to create a load module
c. is always used before programs are executed
d. None of above
Answer: (b).
is required to create a load module

2. A system program that combines the separately compiled modules of a program into a form suitable for execution ?
a. Assembler
b. Linking loader
c. Cross compiler
d. Load and Go
Answer: (b).
Linking loader

3. Loading process can be divided into two separate programs, to solve some problems. The first is binder the other is ?
a. Linkage editor
b. Module Loader
c. Relocator
d. None of these
Answer: (b).
Module Loader

4. Load address for the first word of the program is called
a. Linker address origin
b. Load address origin
c. Phase library
d. Absolute library
Answer: (b).
Load address origin

5. A linker program
a. places the program in the memory for the purpose of execution.
b. relocates the program to execute from the specific memory area allocated to it.
c. links the program with other programs needed for its execution.
d. interfaces the program with the entities generating its input data.
Answer: (c).
links the program with other programs needed for its execution.

6. Consider a program with a linked origin of 5000. Let the memory area allocated to it have the start address of 70000. Which among the following will be the value to be loaded in relocation register?
a. 20000
b. 50000
c. 70000
d. None of the above
Answer: (d).
None of the above

7. Resolution of externally defined symbols is performed by
a. Linker
b. Loader
c. Compiler
d. Editor
Answer: (a).
Linker

8. Relocatable programs
a. cannot be used with fixed partitions
b. can be loaded almost anywhere in memory
c. do not need a linker
d. can be loaded only at one specific location
Answer: (b).
can be loaded almost anywhere in memory

9. Memory allocation involves which of the following task(s)
a. determine amount of memory required
b. use an appropriate memory allocation model
c. determine appropriate memory mapping
d. All of the above
Answer: (d).
All of the above

10. Static memory allocation is typically performed during _____________.
a. compilation
b. execution
c. loading
d. linking
Answer: (a).
compilation

11. Dynamic memory allocation is typically performed during _______________.
a. loading of the program
b. compilation of the program
c. execution of the program
d. None of the above
Answer: (c).
execution of the program

12. Dynamic memory allocation is implementing using ________________.
a. queue and stacks
b. trees
c. stack and heaps
d. graphs
Answer: (c).
stack and heaps

13. ________________ are used for reduce the main memory requirements of program.
a. Heaps
b. Overlays
c. Graphs
d. None of the above
Answer: (b).
Overlays

14. ________________is used for reducing relocation requirements.
a. Relocation register
b. Track register
c. Binding register
d. Segment Register
Answer: (d).
Segment Register

15. Linking is process of binding
a. Internal part of a program
b. external functional call
c. External reference to the correct link time address
d. None of the above
Answer: (c).
External reference to the correct link time address

16. If load origin is not equal to linked origin then relocation is performed by
a. Loader
b. Linker
c. By program itself
d. Relocation not performed
Answer: (a).
Loader

17. If linked origin is not equal to translated address then relocation is performed by____________.
a. Absolute Loader
b. Loader
c. Linker
d. None of the above
Answer: (c).
Linker

18. Which is not a funciton of a loader
a. allocation
b. translation
c. relocation
d. loading
Answer: (b).
translation

19. Binder performs the functions of
a. allocation
b. relocation
c. linking
d. all of these
Answer: (d).
all of these

20. A system program that set up an executable program in main memory ready for execution is
a. assembler
b. linker
c. loader
d. text-editor
Answer: (c).
loader

21. A system program that sets up an executable program in main memory ready for execution
a. assembler
b. linker
c. loader
d. laod and go
Answer: (c).
loader

22. In an absolute loading scheme which loader function is accomplished by loader
a. reallocation
b. allocation
c. linking
d. loading
Answer: (a).
reallocation

23. Disadvantage of compile and go loading scheme is that
a. a position of memory is wasted because the case occupied by the assembler is unavailable the object program
b. it is necessary to retranslate the users program check every time it is run
c. it is very difficult to handle multiple segments especially if the source programs are in different language and to produce overlay modular programs
d. all of the above
Answer: (d).
all of the above

24. The non-relocateable program is one which
a. can not be made to execute in any area to storage other than the one designated for it at the time of its coding or translation
b. consists of a program and relevent information for its reloaction
c. can itself perform the relocation of its address sensitive positions
d. all of the above
Answer: (a).
can not be made to execute in any area to storage other than the one designated for it at the time of its coding or translation

25. A self relocating program in one which
a. can not be made to exercise in any area of storage other than the one designated for it at the time of its coding or translation
b. consists of a program and relevent information for its reloactio
c. one itself perform the relocation of its address sensitive positions
d. all of the above
Answer: (c).
one itself perform the relocation of its address sensitive positions

26. The linker
a. is the same as loader
b. is required to create a load module
c. user source code as input
d. is always used before programs are executed
Answer: (a).
is the same as loader

27. Consider a program with a linked origin of 5000. Let the memory area allocated to it have the start address of 70000. Which amongst the following will be the value to be loaded in relocation register?
a. 20000
b. 50000
c. 70000
d. None of the above
Answer: (d).
None of the above

28. Relocating bits used by relocating loader are specified by
a. Relocating loader itself
b. Linker
c. Assembler
d. Macro processor
Answer: (b).
Linker

29. Which of the following can be accessed by transfer vector approach of linking?
a. External data segments
b. External subroutines
c. Data located in other procedure
d. All of these
Answer: (b).
External subroutines

30. A system program that combines separately compiled modules of a program into a form suitable for execution is
a. Assembler
b. Linking loader
c. Cross compiler
d. None of the mentioned
Answer: (b).
Linking loader

31. A system program that brings together separately compiled modules of a program into a form language that is suitable for execution
a. Assembler
b. Linking loade
c. Cross compiler
d. None of the mentioned
Answer: (b).
Linking loade

32. A system program that combines the separately compiled modules of a program into a form suitable for execution?
a. Assembler
b. Compiler
c. Linking Loader
d. Interpreter
Answer: (c).
Linking Loader

33. Which of the following system software always resides in the main memory ?
a. Text Editor
b. Assembler
c. Linker
d. Loader
Answer: (d).
Loader

34. Loader is a program that
a. places programs into memory and prepares them for execution
b. automates the translation of assembly language into machine language
c. accepts a program written in a high level language and produces an object program
d. appers to execute a source program as if it were machine language
Answer: (a).
places programs into memory and prepares them for execution

35. A loader is
a. a program that places programs into memory and prepares them for execution
b. a program that automate the translation of assembly language into machine language
c. a program that accepts a program written in a high level language and produces an object program
d. is a program that appears to execute a source program if it were machine language
Answer: (a).
a program that places programs into memory and prepares them for execution

36. In an aboslute loading scheme, which loader function is accomplished by programmer?
a. Linking
b. Allocation
c. Both (a) and (b)
d. Reallocation
Answer: (c).
Both (a) and (b)

37. A loader is a program that
a. program that places programs into memory and prepares them for execution.
b. program that automates the translation of assembly language into machine language.
c. program that accepts a program written in a high level language and produces as object program.
d. None of these
Answer: (a).
program that places programs into memory and prepares them for execution.

38. A system program that setup an executable program in main memory ready for execution is
a. loader
b. linker
c. assembler
d. load and go
Answer: (a).
loader

39. A system program that set-up an executable program in main memory ready for execution is
a. linker
b. loader
c. assembler
d. text editor
Answer: (b).
loader

40. A non relocatable program is the one which
a. can itself perform the relocation of its address sensitive portions
b. consists of a program and relevant information for its relocation
c. cannot be made to execute in any area of storage other than the one designated for it at the time of its coding or translation
d. all of these
Answer: (c).
cannot be made to execute in any area of storage other than the one designated for it at the time of its coding or translation

Module 5

1) Users write the programs in which language?
a. Low-level Language
b. High-Level Language
c. Decimal-Format
d. Middle-Level Language
Answer: b. High-Level Language
Explanation: Users write the program in a high-level language because it is easier to use, understand and remember.

2) Which computer program accepts the high-level language and converts it into assembly language?
a. Interpreter
b. Linker
c. Assembler
d. Compiler
Answer: d. Compiler
Explanation: Compiler is a computer program that accepts the code written in a high-level language and converts that code into the assembly language.

3) Does the compiler program translate the whole source code in one step?
a. No
b. Depends on the Compiler
c. Don’t Know
d. Yes
Answer: d. Yes
Explanation: The compiler is that program which translates the whole high-level code into the machine code at once.

4) Which of the following file is an output of the assembler?
a. Program file
b. Object file
c. Data File
d. Task File
Answer: b. Object File
Explanation: The object file contains the object code, which is an output of an assembler.

5) Which tool is used for grouping of characters in tokens in the compiler?
a. Parser
b. Code optimizer
c. Code generator
d. Scanner
Answer: d. Scanner
Explanation: Scanner is a subroutine which is called by the compiler program. The scanner combines the characters and implements them to produce tokens.

6) What is the linker?
a. It is always used before the program execution.
b. It is required to create the load module.
c. It is the same as the loader
d. None of the above
Answer: b. It is required to create the load module.
Explanation: Linker is a program in the compiler which is required to create a load module.

7) Parsing is categorized into how many types?
a. three types
b. four types
c. two types
d. five types
Answer: c. two types
Explanation: In the compiler design, the parser is mainly categorized into top-down parsing and bottom-up parsing.

8) In which parsing, the parser constructs the parse tree from the start symbol and transforms it into the input symbol.
a. Bottom-up parsing
b. Top-down parsing
c. None of the above
d. Both a and b
Answer: b. Top-Down Parsing
Explanation: Top-down parsing is a technique which constructs the parse tree from the start symbol and transforms it to the input symbol. This type of parsing is also referred to as predictive or recursive parsing.

9) Which derivation is generated by the top-down parser?
a. Right-most derivation in reverse
b. Left-most derivation in reverse
c. Right-most derivation
d. Left-most derivation
Answer: d. Left-most derivation
Explanation: Top-down parser generates the left-most derivation. It constructs the parse tree from left to right and constructs the left-most derivation of the specified sentence.

10) Which derivation is generated by the bottom-up parser?
a. Right-most derivation in reverse
b. Left-most derivation in reverse
c. Right-most derivation
d. Left-most derivation
Answer: a. Right-most derivation in reverse.
Explanation: Bottom-up parser generates the right-most derivation in reverse. It constructs the parse tree from the input string to the root and tries to construct the right-most derivation of the specified string backward.

11) Which parser is most powerful in the following parsers?
a. Operator Precedence
b. SLR
c. Canonical LR
d. LALR
Answer: c. Canonical LR
Explanation: Canonical LR (CLR) is the most powerful parser than LALR and SLR.

12) The output of the lexical analyzer is _______
a. string character
b. a syntax tree
c. a set of RE
d. a set of tokens
Answer: d. a set of tokens
Explanation: Lexical analyzer gives the set of tokens as output. The set of tokens contains keywords, separators, literals, identifiers, and operators.

13) From the following grammars, which describes the lexical syntax?
a. Lexical Grammar
b. Context-free Grammar
c. Syntactic Grammar
d. Regular Grammar
Answer: a. Lexical Grammar
Explanation: Lexical grammar is a type of grammar which specifies the syntax of tokens.

14) Which grammar gives multiple parse trees for the same string?
a. Unambiguous
b. Regular
c. Ambiguous
d. All of the above
Answer: c. Ambiguous
Explanation: Ambiguous grammar is a context-free grammar which gives more than one leftmost or rightmost derivation for the same specified sentence.

15) In Compiler lexical analyzer is used for?
a. removing comments
b. removing whitespace
c. breaking the syntaxes in the set of tokens
d. All of the mentioned
Answer: d. All of the mentioned
Explanation: Lexical analyzer is used in the compiler for removing the Whitespace and comments. It is also used in breaking the syntaxes into the set of tokens.

16) Which is considered as the sequence of characters in a token?
a. Mexeme
b. Lexeme
c. Texeme
d. Pattern
Answer: b. Lexeme
Explanation: Lexemes are the string of alphanumeric characters in a single token. In the source program, lexemes are characters which are identified by the pattern for a token.

17) Which part of the compiler highly used the grammar concept?
a. Code optimization
b. Code generation
c. Parser
d. Lexical Analysis
Answer: c. Parser
Explanation: The concept of grammar is much used in the parser phase of the compiler.
The parser phase is next to the lexical analysis phase in the compiler. Parser generated the parse tree using the predefined grammar. The parser has two different techniques for creating a different parse tree.

18) Which phase of the compiler checks the grammar of the programming?
a. Code Optimization
b. Semantic Analysis
c. Code Generation
d. Syntax Analysis
Answer: d. Syntax Analysis
Explanation: Syntax Analysis is the 2nd phase of the compiler, which checks the given input string is the correct syntax of the programming language.

19) Which of the following component is important for semantic analysis?
a. Yacc
b. Lex
c. Symbol Table
d. Type Checking
Answer: d. Type checking
Explanation: In the semantic analysis, type checking is an important component because it verifies the program’s operations from the semantic conventions.

20) Which phase of the compiler is also known as Scanner?
a. Syntax Analysis
b. Lexical Analysis
c. Semantic Analysis
d. Code generation
Answer: b. Lexical Analysis
Explanation: The first part of the compiler (lexical analysis) is also known as a scanner. It scans the characters from the source program and implements them to produce tokens.

21) Which phase of the compiler is also known as Parser?
a. Code Optimization
b. Semantic Analysis
c. Syntax Analysis
d. Lexical Analysis
Answer: c. Syntax Analysis
Explanation: The phase of the compiler next to the lexical analysis phase is also known as Parser.
Syntax analysis or parser accepts the tokens produced by the lexical analysis and gives the parse tree in the output.

22) Which of the following parser is a top-down parser?
a. An LALR parser
b. A LR parser
c. Operator precedence parser
d. Recursive descent parser
Answer: d. Recursive descent parser
Explanation: Recursive descent parser is a type of top-down parser which generates the parse tree from top to bottom and reads the input string from left to right.

23) Keywords are recognized in a compiler during –
a. the code generation
b. the data flow analysis
c. the lexical analysis of the program
d. the program parsing
Answer: c. the lexical analysis of the program
Explanation: Keywords are firstly recognized during the lexical analysis of the program in the compiler.

24) Leaf nodes in a parse tree indicate?
a. sub-terminals
b. half-terminals
c. non-terminals
d. terminals
Answer: d. terminals.
Explanation: All the leaf nodes in the parse tree indicate the terminals. And all the interior nodes indicate non-terminals.

25) Which graph describes the basic block and successor relationship?
a. Control graph
b. DAG
c. Flow graph
d. Hamilton graph
Answer: c. Flow graph
Explanation: A flow graph is a graph of the compiler which describes the basic blocks and how the program control is passed between the blocks.

26) Which language is accepted by the push-down automata?
a. Type 0 language
b. Type 1 language
c. Type 2 language
d. Type 3 language
Answer: c. Type 2 language
Explanation: According to the Chomsky hierarchy, push down automata accepts the Type 2 language, which is used for context-free language.

27) The most general phase of structured grammar is?
a. Context-sensitive grammar
b. Context-free grammar
c. Regular grammar
d. All of these
Answer: a. Context Sensitive Grammar
Explanation: Context-sensitive grammar is the most general phase of structured grammar because, in this grammar, the left-hand side and the right side contain the terminals or non-terminals.

28) In the compiler, the function of using intermediate code is:
a. to improve the register allocation
b. to increase the error reporting & recovery.
c. to make semantic analysis easier.
d. to increase the chances of re-using the machine-independent code optimizer in other compilers.
Answer: d. to increase the chances of re-using the machine-independent code optimizer in other compilers.
Explanation: After semantic analysis, the intermediate code increases the chances of reusing the machine-independent code optimizer in other compilers.

29) In how many types of optimization can be divided?
a. two types
b. three types
c. four types
d. five types
Answer: a. two types
Explanation: The code optimization technique is divided into machine-dependent and machine-independent types.

30) The value of which variable is updated inside the loop by a loop-invariant value?
a. loop
b. strength
c. induction
d. invariable
Answer: c. induction
Explanation: The value of the induction variable is updated inside the loop by a loop-invariant value.

31) Which compiler runs on one machine and generates code for multiple machines?
a. Multipass compiler
b. Cross compiler
c. Optimizing compiler
d. Onepass compiler
Answer: b. Cross compiler
Explanation: Cross compiler is a compiler which runs on one machine and generates code for more than one machine.

32) Which of the following is not a characteristic of the compiler?
a. More execution time
b. Debugging process is slow
c. The execution takes place after the removal of all syntax errors
d. Firstly scans the entire program and then transforms it into machine-understandable code
Answer: a. More execution time
Explanation: The compiler does not take more time to execute. So, more execution time is not a characteristic of the compiler.

33) Which phenomenon happens when the non-terminal on the left side is repeated as the first symbol on the right side?
a. Left-most derivation
b. Left recursion
c. Left factoring
d. Left parsing
Answer: b. Left recursion
Explanation: Left recursion is the process in which non-terminal on the left side of the production is the same on the right side as the leftmost symbol.

34) In which derivation the right-most non-terminal symbol is replaced at each step?
a. Right look ahead
b. Right claim
c. Rightmost
d. Right non-terminal
Answer: c. Rightmost
Explanation: The rightmost derivation is that derivation of context-free grammar, which replaces the rightmost non-terminal symbol at each step.

35) In which derivation the leftmost non-terminal symbol is replaced at each step?
a. Left recursion
b. Left non-terminal
c. Left pushdown
d. Leftmost
Answer: d. Leftmost
Explanation: The leftmost derivation is that derivation of context-free grammar which replaces the leftmost non-terminal symbol at each step.

36) The compiler can detect what type of errors?
a. neither logical nor grammatical error
b. logical errors only
c. grammatical errors only
d. both grammatical and logical errors
Answer: c. grammatical errors only.
Explanation: Compiler is a computer program that detects grammatical errors, not logical errors.

37) Which symbol is not related to context-free grammar?
a. End symbol
b. Start symbol
c. Non-terminal symbol
d. Terminal symbol
Answer: a. End symbol
Explanation: Context-free grammar is that grammar which consists of the start symbol, set of terminals, set of non-terminal symbols and the set of productions.

38) Which method merges the multiple loops into the single one?
a. Constant Folding
b. Loop rolling
c. Loop fusion or jamming
d. None of the above
Answer: c. Loop fusion or Loop jamming
Explanation: Loop fusion is an optimization technique which merges the multiple bodies of loops into a single body. This programming technique may reduce the runtime performance of the program.

39) Which parser is known as the shift-reduce parser?
a. Bottom-up parser
b. Top-down parser
c. Both Top-down and bottom-up
d. None of the Above
Answer: a. Bottom-up parser
Explanation: Bottom-up parser in the compiler is also called the shift-reduce parser.

40) Which of the following tree is the pictorial identification of the derivation?
a. The oct tree
b. The parse tree
c. The binary tree
d. None of the above
Answer: b. The parse tree
Explanation: The tree which represents the syntactic structure of the string is known as the parse tree. It also indicates the terminal, start symbol, and non-terminal symbols.

41) The full form of YACC is:
a. Yet Another Computer Computer
b. Yet Another Computer Compiler
c. Yet Another Compiler Computer
d. Yet Another Compiler Compiler
Answer: d. Yet Another Compiler Compiler
Explanation: The full form of YACC is Yet Another Compiler Compiler, which produces the LALR (1) grammar parser.

42) What type of conflicts can occur in the shift-reduce parsing?
a. reduce/reduce
b. shift/reduce
c. Both shift/reduce and reduce/reduce
d. None of the above
Answer: b. Shift/reduce
Explanation: None

43) Which of the following grammar can be translated into DFAs?
a. Generic Grammar
b. Left Linear Grammar
c. Right Liner Grammar
d. All of the above
Answer: c. Right Linear Grammar
Explanation: A right linear grammar is that grammar which contains all the non-terminals on the right-hand side at the right ends. This grammar can be simply converted into the DFA.

44) Which algorithm invokes a function GETREG()?
a. Code motion algorithm
b. Code optimization algorithm
c. Intermediate Code
d. Code generation algorithm
Answer: d. Code generation algorithm
Explanation: Code generation algorithm invokes the GETREG() function to check the status of available registers and the location where the result should be stored. This function also selects the registers for every memory location.

45) FORTRAN programming language is a _______
a. Turing language
b. Context-sensitive language
c. Context-free language
d. Regular language
Answer: b. Context-sensitive language.
Explanation: Context-sensitive languages are those languages which are defined by context-sensitive grammar.

46) The execution time of the code depends on?
a. the usage of machine idioms
b. the way the registers are used
c. the orders in which the computations are performed
d. All of the mentioned
Answer: d. All of the mentioned
Explanation: None

47) Which optimization technique is used to reduce the multiple jumps?
a. Latter optimization technique
b. Peephole optimization technique
c. Local optimization technique
d. Code optimization technique
Answer: b. Peephole optimization technique
Explanation: The peephole optimization technique is used to reduce the memory footprint and the size of code. It is also used to improve the program performance.

48) Which of the following term is used to keep track of the location where the current values of the name are stored?
a. Register descriptor
b. Address descriptor
c. Allocation descriptor
d. Flag register
Answer: b. Address descriptor
Explanation: The address descriptor is a descriptor of the code generator technique, which keeps track of the memory location.

49) Which of the following are labeled by operator symbol?
a. Root
b. Interior nodes
c. Leaves
d. Nodes
Answer: b. Interior nodes
Explanation: In the compiler, interior nodes are specified by the operator symbol.

50) DAG is an abbreviation of?
a. Detecting Acyclic Graph
b. Data Acyclic Graph
c. Dynamic Acyclic Graph
d. Directed Acyclic Graph
Answer: d. Directed Acyclic Graph
Explanation: DAG is a Directed Acyclic Graph, which is constructed using three address code for optimizing the basic blocks.

51) Which of the following is used in various stages or phases of the compiler?
a. Records
b. Program
c. Symbol Table
d. Table
Answer: c. Symbol Table
Explanation: A symbol table is simply a table which is created and maintained by the compiler and used in various phases of the compiler.

52) Which of the following structure has four fields?
a. Parse tree
b. Triples
c. Indirect Triples
d. Quadruples
Answer: d. Quadruples
Explanation: Quadruples are a record structure in a compiler with four fields for implementing the three address code.

53) In which of the following tree, the leaf indicates the operand, and the interior node represents the operator.
a. Syntax tree
b. Parser tree
c. Structured tree
d. Sematic tree
Answer: a. Syntax tree
Explanation: Syntax tree is a tree in the compiler which represents operands by leaf and operator by interior nodes.

54) Which statement is an abstract form of intermediate code?
a. 3- address
b. 2-address
c. address
d. Intermediate code
Answer: a. 3-address
Explanation: None

55) Which mapping is described by the implementation of the syntax-directed translator?
a. Parse table
b. Input
c. Output
d. Input-Output
Answer: d. Input-Output
Explanation: Input-Output is a mapping which is described by the implementation of the syntax-directed translator (SDT).

56) Which of the following function is called the canonical collection of LR(0) item.
a. FIRST
b. GOTO
c. COMPUTE
d. FOLLOW
Answer: b. GOTO
Explanation: GOTO is a function that is called for defining the DFA. And, it is called the canonical collection of LR(0) item.

57) Which of the following option is not a function of the shift-reduce parser?
a. Reduce
b. Accept
c. Go
d. Shift
Answer: c. Go
Explanation: The shift-reduce parser contains only shift, reduce, error and accept action. That’s why Go is not a function of the shift-reduce parser.

58) Which of the following grammar has no two adjacent non-terminals?
a. Irregular grammar
b. Regular grammar
c. Operator
d. Precedence grammar
Answer: c. Operator
Explanation: Operator grammar is the grammar that does not contain two adjacent non-terminals on the right side of the production. It is that grammar that defines the mathematical operators.

59) DFA is an abbreviation of.
a. Non Deterministic Finite set Automata
b. Deterministic Finite Automata
c. Non Deterministic Finite Automata
d. Deterministic Finite set Automata
Answer: b. Deterministic Finite Automata
Explanation: The full form of DFA is Deterministic Finite Automata. It is also known as Deterministic Finite Acceptor. The automata read only one symbol from the input string at a time.

60) NFA is an abbreviation of.
a. Non Deterministic Finite set Automata
b. Deterministic Finite Automata
c. Non Deterministic Finite Automata
d. Deterministic Finite set Automata
Answer: c. Non Deterministic Finite Automata
Explanation: The full form of NFA is Non-Deterministic Finite Automata. It is also known as a Non-Deterministic Finite State-machine. An Automaton gives more than one possible transition of the same state.