Skip to main content

Computer Architecture & Assembly Language MCQs with Answers

Practice important Computer Architecture & Assembly Language MCQs with answers and explanations.

Chapter: 5
Q121:
What is the purpose of using the stack in subroutine calls?
A. To store subroutine code
B. To pass parameters
C. To save return addresses and registers
D. To store the array being sorted
Correct Answer: C
Chapter: 5
Q122:
Which register combination gives the physical address of the stack top?
A. AX
B. CS
C. SS
D. DX
Correct Answer: C
Chapter: 5
Q123:
In the context of the CALL and RET instructions, what does "near call" refer to?
A. A subroutine within the same segment
B. A subroutine in a different segment
C. A subroutine that uses PUSH/POP
D. A subroutine that uses stack
Correct Answer: A
Chapter: 5
Q124:
What is the main disadvantage of the subroutine in the given bubble sort example?
A. It cannot handle large arrays
B. It destroys some registers
C. It does not return properly
D. It requires too many parameters
Correct Answer: B
Chapter: 5
Q125:
What type of stack is used by the 8088 processor?
A. Incrementing
B. Decrementing
C. Rotating
D. Fixed
Correct Answer: B
Chapter: 5
Q126:
Why is the stack considered a LIFO data structure?
A. Because the last element in is the first out
B. Because it can only hold one element at a time
C. Because it only works with registers
D. Because it uses the stack pointer
Correct Answer: A
Chapter: 5
Q127:
What operation is performed by the "POP" instruction?
A. Places a value on the stack
B. Removes a value from the top of the stack
C. Clears the entire stack
D. Increments the stack pointer by 1
Correct Answer: B
Chapter: 5
Q128:
What is the effect of the "shl cx, 1" instruction in the context of sorting?
A. It doubles the value of CX
B. It halves the value of CX
C. It compares array elements
D. It shifts the array
Correct Answer: A
Chapter: 5
Q129:
How many times is the bubble sort subroutine called in Example 5.2?
A. Once
B. Twice
C. Three times
D. Four times
Correct Answer: B
Chapter: 5
Q130:
What is the role of the "mov ax, 0x4c00" instruction at the end of the program?
A. Starts a new subroutine
B. Terminates the program
C. Calls the bubble sort subroutine
D. Restores the stack
Correct Answer: B
Chapter: 5
Q131:
How does the RET instruction determine where to return after a CALL?
A. It reads the instruction pointer
B. It uses a label
C. It uses the stack
D. It uses the segment register
Correct Answer: C
Chapter: 5
Q132:
What does the instruction RETF do in assembly language?
A. Pops the IP followed by popping CS
B. Pushes AX and CX onto the stack
C. Swaps two memory operands
D. Saves the caller's registers
Correct Answer: A
Chapter: 5
Q133:
Which instruction is used to exchange the contents of two operands in assembly language?
A. MOV
B. PUSH
C. POP
D. XCHG
Correct Answer: D
Chapter: 5
Q134:
What does the PUSH instruction do to the stack pointer (SP)?
A. Increments SP by 2
B. Decrements SP by 2
C. Increments SP by 4
D. Decrements SP by 4
Correct Answer: B
Chapter: 5
Q135:
What is the purpose of the POP instruction in assembly language?
A. Loads data into memory
B. Transfers a word from the top of the stack
C. Loads data into a register
D. Swaps data between two registers
Correct Answer: C
Chapter: 5
Q136:
In the bubblesort subroutine, which register is used to store the starting address of the array?
A. AX
B. BX
C. CX
D. SI
Correct Answer: B
Chapter: 5
Q137:
What happens if PUSH and POP operations are not used in the correct order?
A. Stack will overflow
B. Registers will be corrupted
C. Data will be lost
D. System will crash
Correct Answer: B
Chapter: 5
Q138:
Which instruction is responsible for returning control to the caller after a subroutine call?
A. CALL
B. JMP
C. RET
D. XCHG
Correct Answer: C
Chapter: 5
Q139:
In the provided example, what does the swapflag variable indicate?
A. Start of the array
B. Number of elements in the array
C. Whether a swap has occurred
D. Address of the subroutine
Correct Answer: C
Chapter: 5
Q140:
What is the correct order of operations when multiple registers are pushed onto the stack?
A. POP first, then PUSH
B. PUSH in reverse order, POP in reverse
C. PUSH in order, POP in reverse order
D. POP in order, PUSH in reverse order
Correct Answer: C

Test Your Knowledge

Take a timed quiz on Computer Architecture & Assembly Language

🚀 Start Quiz Now