Tuesday, June 9, 2015

Assembly Language Multiple Choice Questions and Answers

1.Which is not a funciton of a loader

1.allocation

2.translation

3.relocation

4.loading

Binder performs the functions of

1.allocation

2.relocation

3.linking

4.all of these

The error that can be pointed out by the compiler are

1.syntax errors

2.semantic errors

3.logical errors

4.internal errors

system programs such as compiler are designed as that they are

1.re-enterable

2.non-reusable

3.serially usable

4.recursive

A system program that set up an executable program in main memory ready for execution is

1.assembler

2.linker

3.loader

4.text-editor

Assembler is a program that

1.places programs into memory and prepares then for execution

2.automates the translation of assemble language into machine language

3.accepts a program written in a high level language and produces an object program

4.appears to execute a resource as if it were machine language

An interpreter is a program that

1.places programs into memory and prepares then for execution

2.automates the translation of assemble language into machine language

3.accepts a program written in a high level language and produces an object program

4.appears to execute a resource as if it were machine language

A compiler is a program that

1.places programs into memory and prepares then for execution

2.automates the translation of assemble language into machine language

3.accepts a program written in a high level language and produces an object program

4.appears to execute a resource as if it were machine language

A system program that sets up an executable program in main memory ready for execution

1.assembler

2.linker

3.loader

4.laod and go

A single two pass assembler does which of the following in the first pass

1.It allicates space for the literals

2.It computes the total length of the program

3.It builds the symbol table for the symbols and their values

4.all pf the above

recursive descent parsing is an example of

1.top down parsers

2.botton up parsers

3.predictive parsing

4.none of these

In an absolute loadin scheme which loader function is accomplished by loader

1.reallocation

2.allocation

3.linking

4.loading

disadvantage of compiler and go loading scheme is that

1.a position of memory is wasted because the case occupied by the assembler is unavailable the object program

2.it is necessary to retranslate the users program check every time it is run

3.it is very difficult to handle multiple segments especially if the source programs are in different language and to produce overlay modular programs

4.all of the above

context free language can be recognized by

1.finite state automation

2.linear bounded automation

3.push down automata

4.both (b) and (c)

The set ( a power n b power n | n=1,2,3.....} can be generated by the CFG

1.S->ab | aSb | e

2.S-> aaSbb | ab

3.S-> ab | aSb

4.none of these

Which is not true about syntax and semantic parts of a computer language

1.syntax is generally checked by the programmer

2.semantics is the responsibility of the programmer

3.semantics is checeked mechanically by a computer

4.both (b) and (c)

The term environment in programming language semantics is said as

1.function that maps a name to value held there

2.function that maps a name to a storage location

3.the function that maps a storage location to the value held there

4.none of the above

The non-relocabe program is one which

1.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

2.consists of a program and relevent information for its reloaction

3.can itself perform the relocation of its address sensitive positions

4.all of the above

A self relocating program in one which

1.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

2.consists of a program and relevent information for its reloaction

3.one itself perform the relocation of its address sensitive positions

4.all of the above

the linker

1.is the same as loader

2.is required to create a load module

3.user source code as input

4.is always used before programs are executed

a simle two pass assembler does which of the following in the first class

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.It generates code for all the load and stores regular instruction

1.only a

2. a and b

3. a,b and c

4. only d

which of the following are language processors

1.assembler

2.compilers

3.interpreter

4.all of these

The task of the logical analysis phase is

1.to parse the source program into the basic elements or token of the language

2.to build the literal table and an identifier table

3.to build a uniform symbol table

4.all of the above

The output of lexical analyzer is

1.to set of regular expressions

2.syntax tree

3.set of tokens

4.string of characters

pick the machine independent pahse of the compiler

1.syntax analysis

2.lexical analysis

3.intermediate code generation

4.all of the above

the bottom up parser generates

1.right most derivation

2.right most derivation in reverse

3.left most derivation

4.left most derivation in reverse

the top down parser generates

1.right most derivation

2.right most derivation in reverse

3.left most derivation

4.left most derivation in reverse

type checking is normally done during

1.lexical analysis

2.syntax analysis

3.syntax directed translation

4.code optimization

Which of the following grammers are not phase structured

1.regular

2.context free grammar

3.context sensitive

4.none of these

LR stands for

1.left to right

2.left to right redirection

3.right to left

4.left to right and rightmost derivation in reverse

A grammar will be meaningless

1.if terminal set and non terminal set are not disjoint

2.if the left handside of a production has no non-terminal

3.if the left hand side of a production has non terminal

4.all of the above

Which of the following statements is false

1.a sentence of a grammar should be desirable from the start state

2.a sentence of a grammar should be frontier of a derivation tree, in which the root node has the start state as the label

3.a sentence of a grammar

4.two different grammars may generate the same language

Any syntactic constrct that can be described by a regular expression can also be described by a

1.context sensitive grammar

2.non-context free grammar

3.context free grammar

4.none of these

a compiler that runs on one machine and produces code for a different machine is called

1.cross compilation

2.one pass compilation

3.two pass compilation

4.none of these

In which addressing mode, the operand is given explicitly in the instruction itself

1.absolute mode

2.immediate mode

3.indirect mode

4.index mode

In which addressing mode the effective address of the operand is generated by adding a constant

value to the context of register

1.absolute mode

2.immediate mode

3.indirect mode

4.index mode

YACC stands for

1.yet accept compiler constructs

2.yet accept compiler compiler

3.yet another compiler constructs

4.yet another compiler compiler

An assembly program contains

1.imperative statements and assembler directives

2.imperative and declarative statement

3.imperative and declarative statement as well as assembler directive

4.declarative statements and assembler directive

context-free grammar (CFG) can be recognized by

1.finite state automata

2.2 way linear bounded automata

3.push down automata

4.both (b) and (c)

An ideal computer should a) be small in size b) produce object code that is smaller in

size and executes into tokens in a compiler

1.parser

2.cose optimizer

3.code generator

4.scanner

a garbage is

1.un allocated storage

2.allocated, storage with all across path to it destroyed

3.allocated storage

4.uninitialized storage

assembly language uses

1.hex code

2.binary code

3.mnemonics

4.ASCII code

which of the following is not a function of pass1 of an assembler

1.generate data

2.keep track of LC

3.remember literals

4.remember values of symbols until pass 2

Am assembler converts

1.machine code to mnemonics

2.high level language to assembly level

3.assembly language to machine language

4.all of the above

8085 instruction set has ______________ different instructions

1.74

2.98

3.85

4.100

A macro processor can be

1.only single pass

2.both single and double pass

3.only double pass

4.none of the above

The basic task of a macro processor are

1.recognize macro calls

2.recognize and save macro definition

3.expand macro calls

4.all of the above

task not involved in loading are

1.reallocation

2.linking

3.executing

4.allocation

the function(s) of the storage assignment is (are)

1.to assign storage to lierals and to ensure that the storage is allocated and appropriate locations are initialized

2.to assign storage to all temporary locations that are necessary for intermediate result

3.to assign storage to all variale

4.none of the above

the function(s) of scheduler is (are)

1.it selects which ready process is to be run next

2.it is waiting for an event to occur before continuing execution

3.it specifies the time slice

4.both (a) and (b)

the function performed by the paging software is (are)

1.management of the physical address syntax

2.implementation of the access environment for all programs in the systems

3.sharing and protection

4.all of the above

what is the name of the Operating System that reads and reacts in terms of actual time

1.tiem sharing system

2.quick response system

3.read time system

4.batch system

page fault frequency is an Operating System is reduced when the

1.process tend to be I/O bound

2.size of pages is reduced

3.process tend to be CPU bound

4.locality of reference applicable to the process

Bootstraping means

1.a language interpreting other language programs

2.a language compiling other language programs

3.a language compile itself

4.all of the above

Interpreter is

1.slower than compiler

2.generates target code

3.faster than compiler

4.does not build a tree

_______ is not a phase of compiler

1.syntax analysis

2.lexical analysis

3.code generation

4.Error correction

Functions of a lexical analyzer are

1.running white space

2.recognize constants, identifier and keywords

3.removing comments

4.All of the above

lexical analyzer generates

1.trees

2.code

3.tokens

4.intermediate code

which of the following might be used to convert high level language instructions

into machine language code is

1.assembler

2.system software

3.compiler

4.translator

The problem of threashing is affected sighnificantly by

1.primary-storage size

2.program size

3.program structure

4.all of these

A lex program consists of

1.declarations

2.auxillary procedure

3.translation rules

4.all of these

In lex, a class is implemented by first placing

1. ^

2. !

3. ~

4. NOT

A Lex compiler generates

1. Lex object code

2. transition

3. C tokens

4. None of these

Lex is a

1. programming language

2. pattern recognition language

3. assembly language

4. None of the above

Capacity planning

1.does not depend on the monitoring tools available

2.is independent of the operating system

3.required detailed systems performance informations

4.do not needed in small installations

Assembler language

1.is quite different from the SCL interpreter

2.requires fixed format commands

3.is a mnemonic forms of machine language

4.is usally the primary user interface

which of the following can be accessed by transfer vector approach of linking

1.Data located in other procedures

2.external subroutines

3.external data arguments

4.all of the above

The linker

1.is the same as the loader

2.is required to create a load module

3.uses source code as input

4.is always used before programs are executed

The compiler for a high level language that runs on one machine and produce code for a

different machine is called

1.multipass compiler

2.one pass compiler

3.cross compiler

4.optimizing compiler

A YACC program has

1.translation rules

2.declarations

3.croutines

4.all of these

A YACC is a

1.LR parser

2.parser generator

3.compile and go

4.code optimizer

predictive parsers can be

1.recursive

2.constructive

3.non-recursive

4.both (a) & (b)

Intermediate code generation phase gets input from

1.lexical analyzer

2.syntax analyzer

3.semantic analyzer

4.error handler

An example of intermediate language is

1.SNOBOL

2.pascal

3.cobol

4.uncol

Indicate which of the following is not true about an interpreter

1.Interpreter generates an object program from the source program

2.interpreter analysis each source statements every time it is to be executed

3.interpreter is a kind of translator

4.all of the above

The pass numbers for each of the following activities

1.listing printed

2.literals added to literal table

3.object code generation

4.address resoultion of local symbols

A simple two pass assembler does the following in the first pass

1.It allocation space for the literals

2.It generates code for all the load and store register instruction

3.It builds the symbol table for the symbols and their values

4.It computes the total length of the program

type checking is normally done during

1.lexical analysis

2.syntax analysis

3.syntax directed translation

4.code optimization

Indicate wheather the statement LDA B is a statement in

1.machine language

2.assembly language

3.high level language

4.all of these

code generator gives

1.final or target code

2.source code

3.op code

4.machine code

code can be optmized at

1.source code

2.intermediate code

3.target code

4.all of these

we can optimize code by

1.dead code elimination

2.common sub programs

3.copy intermediate loop

4.loop declarational

A link editor is a program that

1.matches the parameters of the macto definition location of the parameters of the macro call

2.matches external names of one program with their location in other programs

3.matches the parameters of subroutine definition with location of parameters of the subroutine call

4.acts as a link between text editor and the user

During which type of analysis the computer tries to detect construction that have the right syntactic structure but no meaning to the operation involved

1.syntax analysis

2.semantic analysis

3.both (a) and (b)

4.neither (a) or (b)

which of the following is a semantic action

1.checking semantic validity of constructs in synthesis phase

2.determining the meaning of synthesis phase

3.constructing an intermediate representation

4.all of the above

which type of computers are designed to combine the main advantage of interpreters and compilers

1.optimizing compilers

2.incremental compilers

3.single pass compilers

4.none of these

which of the following is (are) function(s) of preprocessors

i.produce input to compilers ii. file inclusion iii.language extension iv.macro procesing

1.ii and iv

2.i,iv and iii

3.ii,iii and iv

4.all of the above

In implementation point of view, front end normally consists of

i.lexical analysis ii. syntax analysis iii. semantic analysis iv. intermediate code generation

1.i and ii

2.only i

3.i and iii

4.all of the above

which of the following statements is correct

1.a cross compiler which runs on one machine and generates code for another machine

2.the difference between a cross compiler and a normal compiler is in terms of the code generation only

3.cross compilers are widely used for mini and micro compilers

4.all of the above

which can detect errors the characters remaining in the input do not form any

taken of the language

1.syntax analysis phase

2.semantic analysis phase

3.lexical analysis phase

4.all of the above

In implementation point of view, back and normally consists of

i.code generation ii. code optimization iii. error handling iv. symbol table operations

1.ii and iv

2.ii , iii and iv

3.i , ii ad iii

4.all of the above

assembler is a program that

1.places program into memory and prepares them for execution

2.automates the translation of assembly language into machine language

3.accepts a program written in a high level language and produces an object program

4.prepares to execute a resource as if it were machine language

An interpreter is a program that

1.places program into memory and prepares them for execution

2.automates the translation of assembly language into machine language

3.accepts a program written in a high level language and produces an object program

4.prepares to execute a resource as if it were machine language

what is true about machine language

1.It is understood by the computer

2.It varies from one model if computer to another

3.It may always be represented by binary numbers

4.all of the above

A computer can not boot if it does not have the

1.compiler

2.loader

3.operating system

4.assembler

A compiler is a program that

1.places programs into necessary and prepares them for execution

2.automated the transition of assembly language inot machine language

3.accepts a program written in a high level language and produces an object program

4.appears to execute a source program as if it were machine language

compiler can diagnose

1.gramatical errors only

2.logical errors only

3.gramatical as well as logical errors

4.neither grammatical nor logical errors

A program by mistakes writes an instruction to divide, instead of a multiply such across

can be developed by a /an

1.compiler

2.interpreter

3.compiler or interpreter test

4.none of the above

A most common system security method is

1.password

2.encryption

3.firewall

4.all of these

which of the following does not translate a resource program into machine language program

1.single pass assembler

2.interpreter

3.assembler

4.none of these

diagnostic compilers and connecting compilers are

1.some

2.different

3.both useless

4.none of these

which of the following statements is true

1.macro definitions can not appear within other macros definitions in assembly language program

2.overlapping is used to run a program which is longer than the address space of computer

3.mutual memory can be used to accommodate a program which is longer than the address space of computer

4.It is not possible to write interrupt service routines in a high level language

A compiler-compiler is a /an

1.compiler which compiles a compiler program

2.software tool used in automatic generation of a computer

3.computer written in the source language it compiles

4.another same for cross-compiler

A compiler which allows only the modified section of the source code to be recompiled is called as

1.incremental compiler

2.reconfigurable compiler

3.dynamic compiler

4.relocative compiler

Choose the in correct sentence

1.Any software can be simulated by hardware

2.any hardware can be simulated by software

3.Firmwave is nothing but hardware implementation of software

4.firmwave is nothing but software implementation of software

What is kleen closure of L

1.one or only one concatenations of L

2. one or more concatenations of L

3.zero or more concatenations of L

4.none of the above

Tyoe checking is normally done during

1.lexical analysis

2.synatax analysis

3.syntax directed translation

4.code optimization

variable prefix property is supported by

i.LR parsing ii. LL parsing

1.only iii

2.only i

3.neither ii nor iii

4.both (i) and (ii)

A hardware device that is capable of executing a sequene of interaction

is known as

1.CPU

2.ALU

3.CU

4.processor

Dividing a project into segments and smaller units in order to simplify the

analysis, design and programming efforts is known as

1.modular approach

2.top down approach

3.bottom up approach

4.left right approach

Language which have may types , but the type of every name and expression must be

calculated a compile time are

1.strongly typed language

2.weakly typed language

3.closely typed language

4.none of the above

The functions of the syntax phase is

1.to recognize the major constructs of the language and to call the appropriate action routines that will generate the intermediate from or matrix for these construts

2.to build a literal table and an identifier table

3.to build an uniform symbol table

4.to purse the source program into the basic element on tokens of the language

Which one of the following statements is true

1.macro definition can not appear within other macro definitions

2.overlapping is used to run a program which as longer than the address space of computer

3.virtual memory can be used to acccomodate a program which is longer than the address space of a computer

4.It is not possible to write interrupt service routines in a high level language

In a syntax directed definition, terminals are assumed to have synthesized attributes only because

1.the definition does not provide any semantic rules for terminals

2.the definition and declaration does not provide any expression for non-terminals

3.values for attributes of terminals are usually supported by lexical analyzer

4.none of the above

The process of assigning load address to the various path of the program and adjusting the code and data in the

program to collect the assignment address is called

1.assembly

2.parsing

3.relocation

4.symbol resolution

which of the following statements is false

1.an unambiguous grammar has same leftmost and rightmost derivation

2.An LL(1) parser is top-down parser

3.LALR is most powerful than SLR(Single LR)

4.An ambiguous grammer can never be LR(R) for any k

which of the following is currect about syntax directed translation

i.Evaluation of the semantic rules may generate order, same information in a symbol table

ii. The translation of the token is the result obtained by evaluating the semantic rules

1.only i

2.only ii

3.ii and iii

4.neither i nor ii

Advantage of using assembly language rather than machine language is that

1.it is mnemonic and easy to read

2.address are symbolic , not absolute

3.introduction of data to program in easier

4.All of the above

which of the following is incorrect

1.In a syntax directed definition, terminals are assumed to have synthesized attributes only

2.values for, attributes of terminals are usually supported by the lexical analyzer

3.the start symbol , is assumed not to have any inherited attributes , less otherwise

4.none of the above

Undeclared and multiple identifiers are examples of

1.semantic errors

2.declartion errors

3.transposition errors

4.none of these

which of the following statements is false

1.In statically typed lan

2.declartion errors

3.transposition errors

4.none of these


8 comments:

  1. Nice Collection of Questions for study

    ReplyDelete
  2. Thank you for such a wonderful collection of Assembly Language related questions.

    ReplyDelete
  3. Kindly correct the recursive pasring question because "In computer science, a recursive descent parser is a kind of top-down parser built from a set of mutually recursive procedures where each such procedure implements one of the nonterminals of the grammar."

    ReplyDelete
  4. A computer can not boot if it does not have the?

    Correct answer is "Operting System" not loader

    ReplyDelete