Computer Architecture & Assembly Language MCQs with Answers
Practice important Computer Architecture & Assembly Language MCQs with answers and explanations.
Chapter: 5
Q101:
What is the primary function of a CALL instruction in assembly language?
A. Temporary diversion
B. Permanent diversion
C. Modifying registers
D. Terminating a program
Correct Answer:
A
Chapter: 5
Q102:
Which instruction is used to return control back to the caller after a subroutine?
A. CALL
B. JMP
C. RET
D. PUSH
Correct Answer:
C
Chapter: 5
Q103:
What problem does the concept of subroutines help to solve in programming?
A. Increasing the size of code
B. Repetition of code
C. Reducing execution time
D. Permanent diversion
Correct Answer:
B
Chapter: 5
Q104:
What is the main advantage of using subroutines in assembly language programming?
A. Reduces the need for loops
B. Facilitates code reusability
C. Simplifies conditional jumps
D. Eliminates the need for labels
Correct Answer:
B
Chapter: 5
Q105:
Which instruction in 8088 allows temporary diversion and reuse of code?
A. JMP
B. CALL
C. RET
D. MOV
Correct Answer:
B
Chapter: 5
Q106:
What is the main drawback of using JMP for code reuse compared to CALL?
A. JMP is slower
B. JMP changes the instruction pointer
C. JMP does not allow returning to the original location
D. JMP is difficult to implement
Correct Answer:
C
Chapter: 5
Q107:
How does the CALL instruction differ from the JMP instruction?
A. CALL modifies registers
B. CALL allows returning after execution
C. CALL is only used for loops
D. CALL does not use a label
Correct Answer:
B
Chapter: 5
Q108:
What is placed on the stack by the CALL instruction?
A. Current register values
B. Instruction pointer
C. Memory address of the label
D. Parameter values
Correct Answer:
B
Chapter: 5
Q109:
What does the RET instruction do in assembly language?
A. Restores register values
B. Jumps to a fixed address
C. Returns to the instruction after CALL
D. Terminates the program
Correct Answer:
C
Chapter: 5
Q110:
How is the CALL and RET pair typically used in programming?
A. CALL is used to terminate a program
B. RET is used before CALL
C. CALL and RET are used to create subroutines
D. RET is only used in loops
Correct Answer:
C
Chapter: 5
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
Correct Answer:
B
Chapter: 5
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
Correct Answer:
C
Chapter: 5
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
Correct Answer:
C
Chapter: 5
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
Correct Answer:
C
Chapter: 5
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
Correct Answer:
A
Chapter: 5
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
Correct Answer:
B
Chapter: 5
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
Correct Answer:
C
Chapter: 5
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
Correct Answer:
C
Chapter: 5
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
Correct Answer:
C
Chapter: 5
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
Correct Answer:
D