📑 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 2130 of 222 Questions
Page 3 of 23
Q21❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
In the STOSB (Store String Byte) instruction, by how many bytes is the index register modified (incremented or decremented depending on the Direction Flag)?
💻 assembly Snippet
STOSB
  1. A.1
  2. B.2
  3. C.3
  4. D.4
Q22❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
When executing string instructions with the repeat prefix (e.g., `REP STOSW`), how is the Count Register (CX) modified after each iteration?
💻 assembly Snippet
REP STOSW
  1. A.Decremented by 1
  2. B.Decremented by 2
  3. C.Incremented by 1
  4. D.Incremented by 2
Q23❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
In string instructions like STOSB, when the Direction Flag (DF) is clear (DF = 0), how is the Destination Index (DI) register modified?
💻 assembly Snippet
CLD
STOSB
  1. A.Incremented by 1
  2. B.Incremented by 2
  3. C.Decremented by 1
  4. D.Decremented by 2
Q24❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
The 20-bit physical memory address of the stack top is computed using which segment and offset register pair?
  1. A.SS:SP combination
  2. B.SS:SI combination
  3. C.ES:BP combination
  4. D.ES:SP combination
Q25❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
What happens to the register `AX` upon executing the assembly instruction `PUSH AX`?
💻 assembly Snippet
push ax ; Decrements SP by 2 and copies contents of AX to [SS:SP]
  1. A.AX register will reside on the stack
  2. B.A copy of AX will go on the stack
  3. C.The value of AX disappears after moving on stack
  4. D.Stack will send an acceptance message
Q26🧠 Long Problem📑 Lec 5HardHigh-Yield💡Conceptual🌟Starred
Explain how local variables (such as 'swapflag' in bubble sort) are created, accessed, and managed on the stack frame during subroutine execution in x86 assembly language.
💻 assembly Snippet
push bp
mov bp, sp
sub sp, 2 ; Allocates 2 bytes (1 word) for local variable 'swapflag'
Q27🧠 Long Problem📑 Lec 5HardHigh-Yield💡Conceptual🌟Starred
Describe the concept, stack implementation, lifecycle, and scope of local variables in assembly language subroutines.
💻 assembly Snippet
push bp
mov bp, sp
sub sp, 4 ; Allocates 4 bytes for local variables
Q28📝 Short Q📑 Lec 5EasyHigh-Yield💡Conceptual
What assembly language instructions are used to perform permanent (unconditional) and temporary (subroutine) program execution diversions?
💻 assembly Snippet
jmp permanent_label ; Permanent diversion
call subroutine_label ; Temporary diversion
Q29❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
When an item is pushed onto a standard downward-growing x86 stack, how does the Stack Pointer (`SP`) operate relative to copying data?
  1. A.First decremented and then element copied on to the stack
  2. B.First incremented and then element copied on to the stack
  3. C.Decremented after the element copied on to the stack
  4. D.Incremented after the element copied on to the stack
Q30📝 Short Q📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
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