1) 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
Explanation: A two pass assembler does two passes over the source file ( the second pass can be over a file generated in the first pass ). In the first pass all it does is looks for label definitions and introduces them in the symbol table. In the second pass, after the symbol table is complete, it does the actual assembly by translating the operations and so on.
2) In 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
Explanation: On the second pass, the assembler:
• Examines the operands for symbolic references to storage locations and resolves these symbolic references using information in the symbol table.
• Ensures that no instructions contain an invalid instruction form.
• Translates source statements into machine code and constants, thus filling the allocated space with object code.
• Produces a file containing error messages, if any have occurred.
3) Pick the machine independent phase of the compiler ?
a. Syntax analysis
b. Code generation
c. Lexical analysis
d. Intermediate code generation
e. A,C and D
Answer = E
Explanation:Machine independent phases are Lexical analysis, Syntax analysis, Semantic analysis, Intermediate code generation and sometime code optimization. Machine dependent phases are code generation and code optimization.
4) 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
e. None of above
Answer = B
5) 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
e. None of above
Answer = A
Explanation: Application software such as word processors (e.g. MS Word, LibreOffice) and layout applications (e.g. Adobe InDesign, Quark Express) are used for ths purpose.
6) Output file of the Lex is ....... is the input file is Myfile ?
a. Myfile.e
b. Myfile.yy.c
c. Myfile.lex
d. Myfile.obj
Answer = B
Explanation: This Produce the file "myfile.yy.c", which we can then compile with g++
7) Type checking is normally done during ?
a. Lexical analysis
b. Syntax analysis
c. Syntax directed translation
d. Code generation
Answer = C
8) yacc is available as a command on the ?
a. MINIX
b. UNIX
c. DOS
d. None of above
Answer = B
9) 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
10) In Lex, a class is complemented by first placing ?
a. ^
b. OR
c. -
d. NOT
Answer = A
11) Which of the following is not a feature of compiler ?
a. Scans the entire program first and then translate it into machine code
b. When all the syntax errors are removed execution takes place
c. slow for debugging
d. Execution time is more
Answer = D
Explanation: No Explanation
12) Parsing is also known as ?
a. Lexical analysis
b. Syntax analysis
c. Semantic analysis
d. Code generation
Answer = B
Explanation:No Explanation
13) 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
14) Predictive parsers can be ?
a. Recursive
b. Constructive
c. Non recursive
d. Both A and B
Answer = A
15) Producer consumer problem can be solved using ?
a. semaphores
b. event counters
c. monitors
d. All of above
e. None of above
Answer = D
16) Bottom up parsing involves ?
a. shift reduce
b. Handle pruning
c. Operator check
d. A & B
Answer = D
17) An example of intermediate language is ?
a. SNOBOL
b. PASCAL
c. COBOL
d. UNCOL
Answer = D
18) 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
19) A programming language is to be designed to run on a machine that does not have a big memory. The language should ?
a. prefer a 2 pass compiler to a 1 pass compiler
b. prefer a 1 pass compiler to a 2 pass compiler
c. prefer an interpreter to a compiler
d. Not support recursion
e. A, C, D
Answer = E
20) Which of the following system software resides in main memory always ?
a. Text editor
b. Assembler
c. Linker
d. Loader
Answer = D
21) In which addressing mode the operand is given explicitly in the instruction ?
a. Absolute mode
b. Immediate mode
c. Indirect mode
d. Index mode
e. None of these
Answer = B
Explanation: In Immediate addressing mode operand is directly found from the instruction. No memory address is required to read the operand.
22) Which of the following is not true ?
a. UGL doesn't support high level seven interaction
b. Many database management system package support 4GLs
c. All of above
d. None of above
Answer = A
23) Nonmodifiable procedures are called ?
a. concurrent procedures
b. serially usable procedures
c. reentrant procedures
d. topdown procedures
e. None of above
Answer = B
24) 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
25) 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
e. None of above
Answer = B
26) Input of Lex is ?
a. set to regular expression
b. statement
c. Numeric data
d. ASCII data
Answer = A
27) Yacc semantic action is a sequence of ?
a. Tokens
b. Expression
c. C statement
d. Rules
Answer = C
28) Which of the following software tool is parser generator ?
a. Lex
b. Yacc
c. Both A and B
d. None of these
Answer = B
29) A Lex compiler generates ?
a. Lex object code
b. Transition tables
c. C Tokens
d. None of above
Answer = B
30) A Compiler has ....... phases ?
a. 7
b. 6
c. 8
d. None of above
Answer = C