📑 CHAPTER PRACTICE

CS401 - Computer Architecture and Assembly Language Programming – Subroutines

Practice 10 verified multiple choice questions per batch with instant answer reveal and comprehensive solutions.

Showing 4150 of 222 Questions
Page 5 of 23
Q41❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
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.'--
Q42❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
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
Q43❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
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
Q44❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
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📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
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
Q46❓ MCQ📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual
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
Q47❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
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
Q48❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
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
Q49❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
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
Q50❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
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