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 111 โ€“ 120 of 222 Questions
Page 12 of 23
Q111
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Accessing Stack Parameters via POP vs BP)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
To access arguments passed on the stack inside a subroutine, the immediate or naive idea that comes to mind is to __________ them off the stack.
๐Ÿ’ป assembly Snippet
; Accessing parameters by popping removes them from stack
  1. A.PUSH
  2. B.POP
  3. C.CALL
  4. D.Register
Q112
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Stack Frame Setup with PUSH BP)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When executing the assembly instruction `push bp`, what operation is being performed?
๐Ÿ’ป assembly Snippet
push bp ; Saves previous BP on top of 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
Q113
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Local Variables Definition in Subroutines)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In computer programming and assembly language, 'local variables' refer to temporary variables that are declared and used strictly within a __________.
๐Ÿ’ป assembly Snippet
sub sp, 4 ; Allocates 4 bytes for local variables on subroutine stack frame
  1. A.Subroutine
  2. B.Program
  3. C.CALL
  4. D.Label
Q114
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (RETF Inter-Segment Far Return)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The `RETF` (Return Far) instruction restores program execution by popping the offset address into register `IP` and the segment address into which segment register?
๐Ÿ’ป assembly Snippet
retf ; Pops IP first, then pops CS off stack
  1. A.CS register
  2. B.DS register
  3. C.SS register
  4. D.ES register
Q115
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Default SS:SP Segment Association)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
By default, the Stack Pointer (`SP`) register is associated with which segment register?
  1. A.SS
  2. B.DS
  3. C.CS
  4. D.ES
Q116
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (RETF Far Return Mechanics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The `RETF` (Return Far) instruction pops the 16-bit target instruction offset into which register?
๐Ÿ’ป assembly Snippet
retf ; Pops IP first, then pops CS off stack
  1. A.BP
  2. B.IP
  3. C.SP
  4. D.SI
Q117
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (RET n Stack Pointer Modification Mechanics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
After the execution of the near return instruction `RET 2`, what is the total change applied to the Stack Pointer (`SP`)?
๐Ÿ’ป assembly Snippet
ret 2 ; Pops 2-byte IP (SP += 2) and removes 2 parameter bytes (SP += 2) -> Total 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
Q118
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (PUSH Operation Decrements SP by 2)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In 8088 architecture, whenever an element is pushed onto the stack, how is the Stack Pointer (`SP`) modified?
๐Ÿ’ป assembly Snippet
push ax ; SP = SP - 2, then [SS:SP] = AX
  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
Q119
๐Ÿ“ Short Q๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Stack Decrementing and Incrementing Mechanics)Mediumโญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Explain the concept of Incrementing and Decrementing Stack operations in x86 microprocessor architecture.
๐Ÿ’ป assembly Snippet
; PUSH: SP decrements by 2 (top-down stack growth)
; POP:  SP increments by 2 (stack unwinding)
Q120
๐Ÿ“ Short Q๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Word-Size Element Constraint on 8088 Stack)Easyโญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Can single 8-bit bytes be directly pushed onto or popped off the stack in Intel 8088 assembly language? Explain the stack element size constraint.
๐Ÿ’ป assembly Snippet
; Valid:   push ax   ; Pushes 16-bit word
; Invalid: push al   ; Syntax Error (8-bit registers cannot be pushed)