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 41 โ€“ 50 of 222 Questions
Page 5 of 23
Q41
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Stack Data Structure Definition)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
A stack is a fundamental __________ that operates in a Last-In, First-Out (LIFO / FILO) manner.
  1. A.Program
  2. B.data structure
  3. C.Heap
  4. D.None of the Given
Q42
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (RET n Callee Stack Parameter Cleanup)Medium๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
If the __________ instruction variant is not available, callee-side stack parameter cleanup becomes a complicated multi-step process.
๐Ÿ’ป assembly Snippet
ret 4 ; Pops return address, then adds 4 bytes to SP to discard 2 word parameters
  1. A.CALL
  2. B.SBB
  3. C.RET n
  4. D.None of the given
Q43
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Stack Overflow and SP Wraparound)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
True or False: When the stack eventually becomes full in 16-bit x86 architecture, the Stack Pointer (SP) will reach 0x0000, and subsequent PUSH operations will wrap around to 0xFFFE, producing stack overflow and unexpected memory corruption.
๐Ÿ’ป assembly Snippet
push ax ; When SP = 0x0000, pushing decrements SP to 0xFFFE (stack wraparound)
  1. A.True
  2. B.False
Q44
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Stack Overflow Definition)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When the stack becomes full and pushing data past offset 0x0000 causes SP to wrap around and overwrite existing stack frame data, this situation is called stack __________.
  1. A.Overflow
  2. B.Leakage
  3. C.Error
  4. D.Pointer
Q45
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (POP Instruction Destination Operand)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The `POP` operation copies the 16-bit word from the current top of the stack into its specified __________.
๐Ÿ’ป assembly Snippet
pop ax ; Copies word at [SS:SP] into operand register AX
  1. A.Register
  2. B.operand
  3. C.RET n
  4. D.Pointer
Q46
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (PUSH Execution Mechanics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which x86 assembly instruction decrements SP (the Stack Pointer) by two and then transfers a word from the source operand to the top of the stack?
๐Ÿ’ป assembly Snippet
push ax ; Decrements SP by 2, writes AX to top of stack
  1. A.PUSH
  2. B.POP
  3. C.CALL
  4. D.RET
Q47
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (POP Execution Mechanics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Executing `POP` transfers the word at the top of the stack (pointed to by SP) to the destination operand and then __________ SP by two to point to the new top of the stack.
๐Ÿ’ป assembly Snippet
pop ax ; Reads word at [SS:SP] and increments SP by 2
  1. A.increments
  2. B.decrements
  3. C.++
  4. D.--
Q48
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Register Preservation via PUSH and POP)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
To preserve register values across subroutine calls, the standard technique is to use __________ and __________ operations to save caller registers on the stack and restore them before returning.
๐Ÿ’ป assembly Snippet
subroutine:
    push ax ; Save AX
    push bx ; Save BX
    ; ... subroutine work ...
    pop  bx ; Restore BX
    pop  ax ; Restore AX
    ret
  1. A.POP, ADC
  2. B.CALL, RET
  3. C.CALL, RET n
  4. D.PUSH, POP
Q49
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Retrieving Stack Arguments via POP)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When parameters are passed to a subroutine on the stack, the straightforward method to retrieve them inside the subroutine is to __________ them off the stack.
๐Ÿ’ป assembly Snippet
pop ax ; Retrieves top parameter off the stack into AX
  1. A.PUSH
  2. B.POP
  3. C.CALL
  4. D.Register
Q50
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Standard Stack Frame Prologue)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In standard stack frame creation, executing `push bp` performs which action?
๐Ÿ’ป assembly Snippet
push bp     ; Pushes old BP onto stack
mov  bp, sp ; Sets up new stack frame pointer
  1. A.sending bp copy to stack
  2. B.making bp copy from stack
  3. C.pushing bp on the stack
  4. D.doing nothing