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 31 โ€“ 40 of 222 Questions
Page 4 of 23
Q31
๐Ÿ“ Short Q๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (PUSH SP Modification)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When the instruction `PUSH AX` is executed on a standard downward-growing x86 stack, how does the value of the Stack Pointer (`SP`) change?
๐Ÿ’ป assembly Snippet
push ax ; SP = SP - 2, then [SS:SP] = AX
Q32
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (PUSH Execution Mechanics)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
True or False: Executing the instruction `PUSH` increments the Stack Pointer (`SP`) by two before transferring a word to the top of the stack.
๐Ÿ’ป assembly Snippet
push ax ; Decrements SP by 2, writes AX to [SS:SP]
  1. A.True
  2. B.False
Q33
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Stack Pointer SP Function)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The Stack Pointer (SP) is a specialized memory pointer register that implicitly points to the __________.
๐Ÿ’ป assembly Snippet
push ax ; Decrements SP by 2, pointing to new top of stack
  1. A.Top of the stack
  2. B.Bottom of the stack
  3. C.Base of the stack frame
  4. D.Start of code segment
Q34
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (Implicit SP Stack Instructions)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The Stack Pointer register (SP) is a memory pointer that is used implicitly/indirectly by a specific set of __________ (such as `PUSH`, `POP`, `CALL`, and `RET`).
๐Ÿ’ป assembly Snippet
push ax ; SP modified implicitly by PUSH instruction
pop  bx ; SP modified implicitly by POP instruction
  1. A.instructions
  2. B.Pointers
  3. C.Indexes
  4. D.Variables
Q35
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (BP Base Pointer Function)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
__________ is also a stack memory base pointer register containing the address of arguments and local variables inside the stack segment.
๐Ÿ’ป assembly Snippet
mov ax, [bp + 4] ; Accesses parameter passed on stack via BP
  1. A.SP
  2. B.BP
  3. C.PB
  4. D.AC
Q36
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL Instruction Reusability)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The __________ instruction allows temporary control flow diversion to a subroutine, enabling code reusability.
๐Ÿ’ป assembly Snippet
call my_subroutine ; Temporarily diverts control flow to subroutine
  1. A.CALL
  2. B.RET
  3. C.AND
  4. D.XOR
Q37
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL Target Operand Argument)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The `CALL` instruction takes a target memory label as an __________ and begins execution from that target location.
๐Ÿ’ป assembly Snippet
call print_string ; 'print_string' label acts as argument
  1. A.argument
  2. B.Label
  3. C.Text
  4. D.Register
Q38
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (RET Return Instruction)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When the __________ instruction is executed inside a subroutine, it restores execution back to the instruction immediately following the initial `CALL`.
๐Ÿ’ป assembly Snippet
my_subroutine:
    ; subroutine body
    ret ; Pops saved IP and returns
  1. A.CALL
  2. B.RET
  3. C.AND
  4. D.XOR
Q39
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL and RET Subroutine Pairing)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Which pair of instructions are commonly used together to invoke and return from subroutines, despite operating independently at the hardware level?
๐Ÿ’ป assembly Snippet
call my_func
; ...
my_func:
    ret
  1. A.RET and ADC
  2. B.CALL and SBB
  3. C.CALL and RET
  4. D.ADC and SBB
Q40
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 5๐Ÿท๏ธ 5.1. Subroutines and Stack (CALL Register Updating of IP)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The `CALL` instruction alters the normal thread of execution while preserving general-purpose registers, automatically updating which pointer register to the target address?
  1. A.SI
  2. B.IP
  3. C.DI
  4. D.SP