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 91 โ€“ 100 of 222 Questions
Page 10 of 23
Q91
๐Ÿ“ Short Q๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL Instruction Stack Mechanics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Describe the working mechanics of the `CALL` instruction in relation to the stack data structure.
๐Ÿ’ป assembly Snippet
; CALL mechanics:
; 1. SP = SP - 2
; 2. [SS:SP] = IP (Return Address)
; 3. IP = target_label_offset
Q92
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (POP Instruction Operation Mechanics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which x86 instruction transfers the word at the current top of the stack (pointed to by `SS:SP`) to the destination operand and then increments `SP` by two?
๐Ÿ’ป assembly Snippet
pop ax ; Copies [SS:SP] into AX, then increments SP by 2
  1. A.push
  2. B.pop
  3. C.call
  4. D.none of given
Q93
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (RET Instruction Pops Return Address into IP)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
True or False: The `RET` instruction does NOT pop the word at the top of the stack (pointed to by `SS:SP`) into the Instruction Pointer, but merely increments `SP` by two.
๐Ÿ’ป assembly Snippet
ret ; Pops top of stack into IP, restoring execution flow
  1. A.true
  2. B.false
Q94
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (PUSH and POP Stack Operations)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
True or False: The operations for placing items onto the stack and removing them from the stack are called `push` and `ret`.
๐Ÿ’ป assembly Snippet
push ax ; Pushes item onto stack
pop bx  ; Removes item from stack
  1. A.true
  2. B.false
Q95
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (PUSH Stack Decrement Mechanics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
True or False: The operation of `push ax` increments the Stack Pointer by 2 (`SP <- SP + 2`) before moving `AX` to `[SS:SP]`.
๐Ÿ’ป assembly Snippet
push ax ; Performs SP = SP - 2, then [SS:SP] = AX
  1. A.true
  2. B.false
Q96
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Callee Stack Parameter Cleanup via RET n)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In standard x86 subroutine parameter cleanup mechanisms using the `RET n` instruction, parameters are removed from the stack by the __________.
๐Ÿ’ป assembly Snippet
ret 4 ; Callee pops return address and adds 4 to SP to remove parameters
  1. A.caller
  2. B.callee
  3. C.caller and callee
  4. D.none of given
Q97
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (SP Register and Stack Instructions)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The Stack Pointer (`SP`) is a dedicated memory pointer register that is manipulated implicitly by a set of stack __________ (such as `PUSH`, `POP`, `CALL`, and `RET`).
๐Ÿ’ป assembly Snippet
push ax ; Implicitly decrements SP by 2
pop bx  ; Implicitly increments SP by 2
  1. A.instructions
  2. B.Pointers
  3. C.Indexes
  4. D.Variables
Q98
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (BP Base Pointer Register Purpose)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In addition to `SP`, which memory pointer register is specifically designed to access parameter data and local variables stored in the stack frame?
๐Ÿ’ป assembly Snippet
mov bp, sp
mov ax, [bp + 4] ; Accesses parameter passed on stack
  1. A.SP
  2. B.BP
  3. C.PB
  4. D.AC
Q99
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL Subroutine Diversion and Reusability)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which x86 assembly instruction allows temporary diversion of execution flow to a subroutine, enabling modularity and reusability of code?
๐Ÿ’ป assembly Snippet
call my_subroutine ; Temporarily diverts execution to subroutine
  1. A.CALL
  2. B.RET
  3. C.AND
  4. D.XOR
Q100
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL Operand/Argument Target Label)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The `CALL` instruction accepts a target subroutine label as its __________ and begins execution from that label address.
๐Ÿ’ป assembly Snippet
call print_string ; 'print_string' label acts as the argument
  1. A.argument
  2. B.Lable
  3. C.TXt
  4. D.Register