0% found this document useful (0 votes)
60 views15 pages

TOPIC 2 Part 2 Machine Instructions and Programs

This document contains multiple choice questions about computer organization topics including instructions, assembly language, and subroutines. It discusses key concepts such as register transfer notation (RTN), instruction phases of fetch and execution, assembler directives, subroutine parameter passing using registers and stacks, and nested subroutine return address handling using a processor stack. The document tests understanding of these foundational computer architecture concepts through short multiple choice questions and explanations.

Uploaded by

Quang Minh
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)
60 views15 pages

TOPIC 2 Part 2 Machine Instructions and Programs

This document contains multiple choice questions about computer organization topics including instructions, assembly language, and subroutines. It discusses key concepts such as register transfer notation (RTN), instruction phases of fetch and execution, assembler directives, subroutine parameter passing using registers and stacks, and nested subroutine return address handling using a processor stack. The document tests understanding of these foundational computer architecture concepts through short multiple choice questions and explanations.

Uploaded by

Quang Minh
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/ 15

I.

This set of Computer Organization Questions and Answers for Campus


interviews focuses on “Instructions and Instruction Sequencing”.

1. RTN stands for ___________


a) Register Transfer Notation
b) Register Transmission Notation
c) Regular Transmission Notation
d) Regular Transfer Notation
View Answer
Answer: a
Explanation: This is the way of writing the assembly language code with the help of
register notations.

2. The instruction, Add Loc,R1 in RTN is _______


a) AddSetCC Loc+R1
b) R1=Loc+R1
c) Not possible to write in RTN
d) R1<-[Loc]+[R1]
View Answer
Answer: d
Explanation: None.

3. The instruction, Add R1,R2,R3 in RTN is _______


a) R3=R1+R2+R3
b) R3<-[R1]+[R2]+[R3]
c) R3=[R1]+[R2]
d) R3<-[R1]+[R2]
View Answer
Answer: d
Explanation: In RTN the first operand is the destination and the second operand is the
source.

4. In a system, which has 32 registers the register id is __________ long.


a) 16 bit
b) 8 bits
c) 5 bits
d) 6 bits
View Answer
Answer: c
Explanation: The ID is the name tag given to each of the registers and used to identify
them.
5. The two phases of executing an instruction are __________
a) Instruction decoding and storage
b) Instruction fetch and instruction execution
c) Instruction execution and storage
d) Instruction fetch and Instruction processing
View Answer
Answer: b
Explanation: First, the instructions are fetched and decoded and then they’re executed
and stored.

6. The Instruction fetch phase ends with _________


a) Placing the data from the address in MAR into MDR
b) Placing the address of the data into MAR
c) Completing the execution of the data and placing its storage address into MAR
d) Decoding the data in MDR and placing it in IR
View Answer
Answer: d
Explanation: The fetch ends with the instruction getting decoded and being placed in
the IR and the PC getting incremented.

7. When using Branching, the usual sequencing of the PC is altered. A new instruction is
loaded which is called as ______
a) Branch target
b) Loop target
c) Forward target
d) Jump instruction
View Answer
Answer: a
Explanation: None.

8. The condition flag Z is set to 1 to indicate _______


a) The operation has resulted in an error
b) The operation requires an interrupt call
c) The result is zero
d) There is no empty register available
View Answer
Answer: c
Explanation: This condition flag is used to check if the arithmetic operation yields a zero
output.

Recommendation

1. Can you perform an addition on three operands simultaneously in ALN using Add
instruction?
a) Yes
b) Not possible using Add, we’ve to use AddSetCC
c) Not permitted
d) None of the mentioned
View Answer
Answer: c
Explanation: You cannot perform an addition on three operands simultaneously
because the third operand is where the result is stored.

2. While using the iterative construct (Branching) in execution _____________ instruction


is used to check the condition.
a) TestAndSet
b) Branch
c) TestCondn
d) None of the mentioned
View Answer
Answer: b
Explanation: Branch instruction is used to check the test condition and to perform the
memory jump with the help of offset.
II. This set of Computer Organization and Architecture Multiple Choice Questions &
Answers (MCQs) focuses on “Assembly Language”.

1. __________ converts the programs written in assembly language into machine


instructions.
a) Machine compiler
b) Interpreter
c) Assembler
d) Converter
View Answer
Answer: c
Explanation: An assembler is a software used to convert the programs into machine
instructions.

2. The instructions like MOV or ADD are called as ______


a) OP-Code
b) Operators
c) Commands
d) None of the mentioned
View Answer
Answer: a
Explanation: This OP – codes tell the system what operation to perform on the
operands.

3. 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
View Answer
Answer: b
Explanation: The ADDI instruction, means the addition is in immediate addressing
mode.
4. The last statement of the source program should be _______
a) Stop
b) Return
c) OP
d) End
View Answer
Answer: d
Explanation: This enables the processor to load some other process.

5. 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
View Answer
Answer: c
Explanation: When the assembler comes across the branch code, it immediately finds
the branch offset and replaces it with it.

6. 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
View Answer
Answer: b
Explanation: The table where the assembler stores the variable names along with their
corresponding memory locations and values.

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

1. The assembler stores the object code in ______


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

2. 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
View Answer
Answer: d
Explanation: This creates entries into the symbol table first and then creates the object
code.

3. Instructions which won’t appear in the object program are called as _____
a) Redundant instructions
b) Exceptions
c) Comments
d) Assembler Directives
View Answer
Answer: d
Explanation: The directives help the program in getting compiled and hence won’t be
there in the object code.
4. 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
View Answer
Answer: b
Explanation: This basically is used to replace the variable with a constant value.

5. 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
View Answer
Answer: a
Explanation: This does the function similar to the main statement.

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

7. _____ directive is used to specify and assign the memory required for the block of
code.
a) Allocate
b) Assign
c) Set
d) Reserve
View Answer
Answer: d
Explanation: This instruction is used to allocate a block of memory and to store the
object code of the program there.
8. _____ directive specifies the end of execution of a program.
a) End
b) Return
c) Stop
d) Terminate
View Answer
Answer: b
Explanation: This instruction directive is used to terminate the program execution.
III. This set of Computer Organization and Architecture Multiple Choice Questions &
Answers (MCQs) focuses on “Subroutines and Nesting”.

1. The return address of the Sub-routine is pointed to by _______


a) IR
b) PC
c) MAR
d) Special memory registers
View Answer
Answer: b
Explanation: The return address from the subroutine is pointed to by the PC.

2. What is subroutine nesting?


a) Having multiple subroutines in a program
b) Using a linking nest statement to put many subroutines under the same name
c) Having one routine call the other
d) None of the mentioned
View Answer
Answer: c
Explanation: None.

3. The order in which the return addresses are generated and used is _________
a) LIFO
b) FIFO
c) Random
d) Highest priority
View Answer
Answer: a
Explanation: That is the routine called first is returned first.

4. In case of nested subroutines the return addresses are stored in __________


a) System heap
b) Special memory buffers
c) Processor stack
d) Registers
View Answer
Answer: c
Explanation: In this case, there will be more number of return addresses it is stored on
the processor stack.

5. The appropriate return addresses are obtained with the help of ____ in case of
nested routines.
a) MAR
b) MDR
c) Buffers
d) Stack-pointers
View Answer
Answer: d
Explanation: The pointers are used to point to the location on the stack where the
address is stored.

6. When parameters are being passed on to the subroutines they are stored in ________
a) Registers
b) Memory locations
c) Processor stacks
d) All of the mentioned
View Answer
Answer: d
Explanation: In the case of, parameter passing the data can be stored on any of the
storage space.

7. The most efficient way of handling parameter passing is by using ______


a) General purpose registers
b) Stacks
c) Memory locations
d) None of the mentioned
View Answer
Answer: a
Explanation: By using general purpose registers for the parameter passing we make
the process more efficient.
8. The most Flexible way of logging the return addresses of the subroutines is by using
_______
a) Registers
b) Stacks
c) Memory locations
d) None of the mentioned
View Answer
Answer: b
Explanation: The stacks are used as Logs for return addresses of the subroutines.

Recommendation

1. The location to return to, from the subroutine is stored in _______


a) TLB
b) PC
c) MAR
d) Link registers
View Answer
Answer: d
Explanation: The registers store the return address of the routine and is pointed to by
the PC.

2. The wrong statement/s regarding interrupts and subroutines among the following
is/are ______
i) The sub-routine and interrupts have a return statement
ii) Both of them alter the content of the PC
iii) Both are software oriented
iv) Both can be initiated by the user
a) i, ii and iv
b) ii and iii
c) iv
d) iii and iv
View Answer
Answer: d
Explanation: None.
Recommedation
IV. This set of Computer Organization Questions and Answers for Entrance exams
focuses on “Parameter Passing and Stack Frame”.

1. The private work space dedicated to a subroutine is called as ________


a) System heap
b) Reserve
c) Stack frame
d) Allocation
View Answer
Answer: c
Explanation: This work space is where the intermediate values of the subroutines are
stored.

2. If the subroutine exceeds the private space allocated to it then the values are pushed
onto _________
a) Stack
b) System heap
c) Reserve Space
d) Stack frame
View Answer
Answer: a
Explanation: If the allocated work space is exceeded then the data is pushed onto the
system stack.

3. ______ pointer is used to point to parameters passed or local parameters of the


subroutine.
a) Stack pointer
b) Frame pointer
c) Parameter register
d) Log register
View Answer
Answer: b
Explanation: This pointer is used to track the current position of the stack being used.
4. The reserved memory or private space of the subroutine gets deallocated when
_______
a) The stop instruction is executed by the routine
b) The pointer reaches the end of the space
c) When the routine’s return statement is executed
d) None of the mentioned
View Answer
Answer: c
Explanation: The work space allocated to a subroutine gets deallocated when the
routine is completed.

5. The private space gets allocated to each subroutine when _________


a) The first statement of the routine is executed
b) When the context switch takes place
c) When the routine gets called
d) When the Allocate instruction is executed
View Answer
Answer: c
Explanation: When the call statement is executed, simultaneously space also gets
allocated.

6. _____ the most suitable data structure used to store the return addresses in the case
of nested subroutines.
a) Heap
b) Stack
c) Queue
d) List
View Answer
Answer: b
Explanation: None.

7. In the case of nested subroutines, the stack top is always _________


a) The saved contents of the called sub routine
b) The saved contents of the calling sub routine
c) The return addresses of the called sub routine
d) None of the mentioned
View Answer
Answer: a
Explanation: None.

8. The stack frame for each subroutine is present in ______


a) Main memory
b) System Heap
c) Processor Stack
d) None of the mentioned
View Answer
Answer: c
Explanation: The memory for the work space is allocated from the processor stack.

9. The data structure suitable for scheduling processes is _______


a) List
b) Heap
c) Queue
d) Stack
View Answer
Answer: c
Explanation: The Queue data structure is generally used for scheduling as it is two
directional.

10. The sub-routine service procedure is similar to that of the interrupt service routine
in ________
a) Method of context switch
b) Returning
c) Process execution
d) Method of context switch & Process execution
View Answer
Answer: d
Explanation: The Subroutine service procedure is the same as the interrupt service
routine in all aspects, except the fact that interrupt might not be related to the process
being executed.

You might also like