Ch 05: Subroutines and Stack Architecture

222 Questions222 MCQs0 Short Questions0 Long Questions
๐ŸŽฏ Exam Practice Papers
SEMESTER PASS

CS401 - Computer Architecture and Assembly Language Programming Examination Practice

Timed practice exam simulation for CS401 - Computer Architecture and Assembly Language Programming.

๐Ÿ“˜ VU MID TERM EXAMLectures 1 to 22
โฑ๏ธ 60 Mins

Mid Term Examination

Covers syllabus of Lectures 1 to 22 with 30 high-yield MCQs in a timed exam environment.

๐Ÿ“30 MCQs
โฑ๏ธ60 Minutes
๐Ÿ“— VU FINAL TERM EXAMLectures 23 to 45
โฑ๏ธ 90 Mins

Final Term Examination

Comprehensive semester exam preparation with 45 MCQs covering Lectures 23 to 45 with complete course coverage.

๐Ÿ“45 MCQs
โฑ๏ธ90 Minutes
Showing 61 โ€“ 70 of 222 Questions
Page 7 of 23
Q61
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (RET n Stack Pointer Total Increment)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When the instruction `RET 2` completes execution, by how many bytes is the Stack Pointer (`SP`) incremented in total?
๐Ÿ’ป assembly Snippet
ret 2 ; SP = SP + 2 (return address) + 2 (operand) = SP + 4
  1. A.SP is incremented by 2
  2. B.SP is decremented by 2
  3. C.SP is incremented by 4
  4. D.SP is decremented by 4
Q62
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (PUSH Stack Pointer Decrement)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In 8088 / 8086 architecture, whenever an element is pushed onto the stack using `PUSH`, how is the Stack Pointer (`SP`) modified?
๐Ÿ’ป assembly Snippet
push ax ; Decrements SP by 2 and writes AX to [SS:SP]
  1. A.SP is decremented by 1
  2. B.SP is decremented by 2
  3. C.SP is decremented by 3
  4. D.SP is decremented by 4
Q63
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (RET Instruction Stack Retrieval)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When a subroutine finishes execution, which instruction retrieves the saved return address from the stack and transfers program control back to that location?
๐Ÿ’ป assembly Snippet
ret ; Pops saved return address from stack into IP
  1. A.RET instruction
  2. B.CALL instruction
  3. C.POP instruction
  4. D.Jump instruction
Q64
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL Subroutine Diversion and Reusability)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which x86 control flow instruction pushes the return address onto the stack and transfers execution to a subroutine, enabling code modularity and reusability?
๐Ÿ’ป assembly Snippet
call my_subroutine ; Pushes IP, jumps to my_subroutine
  1. A.CALL
  2. B.JMP
  3. C.RET
  4. D.MOV
Q65
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL Instruction Operand Syntax)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The `CALL` instruction takes a subroutine name or label as its __________, and program execution branches to that label.
๐Ÿ’ป assembly Snippet
call my_subroutine ; 'my_subroutine' label is passed as operand argument
  1. A.argument
  2. B.Label
  3. C.Text
  4. D.Register
Q66
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (RET Subroutine Return Execution)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When the __________ instruction is encountered inside a subroutine, it pops the saved return address from the stack and transfers execution back to the instruction immediately following the `CALL`.
๐Ÿ’ป assembly Snippet
ret ; Pops saved return address into IP
  1. A.CALL
  2. B.RET
  3. C.AND
  4. D.XOR
Q67
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL and RET Subroutine Pair)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which pair of instructions is commonly used together for subroutine control flow, although technically each operates independently?
๐Ÿ’ป assembly Snippet
call sub_routine ; Subroutine invocation
... 
sub_routine:
  ; procedure code
  ret            ; Subroutine return
  1. A.RET and ADC
  2. B.CALL and SBB
  3. C.CALL and RET
  4. D.ADC and SBB
Q68
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL Modification of Instruction Pointer IP)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The `CALL` mechanism breaks the linear thread of execution and preserves general registers, modifying only the __________ (and Stack Pointer SP).
๐Ÿ’ป assembly Snippet
call target ; Modifies IP to target offset and SP (pushes return address)
  1. A.SI
  2. B.IP
  3. C.DI
  4. D.SP
Q69
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Stack Data Structure Definition)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In computer science, a stack is a linear __________ that operates in a First-In, Last-Out (FILO) or Last-In, First-Out (LIFO) manner.
  1. A.Program
  2. B.data structure
  3. C.Heap
  4. D.None of the Given
Q70
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (RET n Callee Stack Parameter Cleanup)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
If the __________ instruction is not available, clearing stack arguments by the callee subroutine becomes a complicated and inefficient process.
๐Ÿ’ป assembly Snippet
ret 4 ; Pops 2-byte return IP, then adds 4 to SP to discard 2 word parameters
  1. A.CALL
  2. B.SBB
  3. C.RET n
  4. D.None of the Given