Computer Architecture & Assembly Language MCQs with Answers
Practice important Computer Architecture & Assembly Language MCQs with answers and explanations.
Multiple Choice Questions
Q111: What happens to the stack when the CALL instruction is executed?
- A: Stack pointer is incremented
- B: Stack pointer is decremented
- C: Registers are stored on the stack
- D: Stack is cleared
View Answer
B
Q112: Why is it important to save registers on the stack before calling a subroutine?
- A: To prevent memory corruption
- B: To ensure code reusability
- C: To preserve the caller’s data
- D: To reset the stack pointer
View Answer
C
Q113: What does the "RET n" instruction do?
- A: It calls a subroutine
- B: It pops multiple values from the stack
- C: It increments the stack pointer by n
- D: It decrements the stack pointer by n
View Answer
C
Q114: In the provided bubble sort subroutine, what does the command "mov si, 0" do?
- A: Initializes the array
- B: Resets the swap flag
- C: Initializes the array index to zero
- D: Compares the array elements
View Answer
C
Q115: What is the purpose of the "shl cx, 1" instruction in the bubble sort subroutine?
- A: Multiplies CX by 2
- B: Divides CX by 2
- C: Shifts the array index left
- D: Shifts the array index right
View Answer
A
Q116: In the bubble sort subroutine, what condition is checked with "cmp byte [swap], 1"?
- A: If the array is sorted
- B: If a swap has been done
- C: If the last element is reached
- D: If the array index is zero
View Answer
B
Q117: What does the instruction "jmp start" do in the provided assembly code?
- A: Ends the program
- B: Calls the subroutine
- C: Jumps to the beginning of the program
- D: Initializes the array
View Answer
C
Q118: Which registers are used to pass parameters to the bubble sort subroutine in the example?
- A: AX and DX
- B: CX and DX
- C: BX and CX
- D: BX and DX
View Answer
C
Q119: What happens when the RET instruction is executed after the bubble sort subroutine?
- A: The stack pointer is decremented
- B: The program is terminated
- C: Control returns to the instruction after CALL
- D: Registers are reset
View Answer
C
Q120: How does the stack pointer behave during a PUSH operation in a decrementing stack?
- A: It is incremented by 1
- B: It is incremented by 2
- C: It is decremented by 1
- D: It is decremented by 2
View Answer
D