Subroutines

Lecture 13: Subroutines

222 Questions172 MCQs45 Short Questions5 Long Questions
Showing 1120 of 222 Questions
Page 2 of 23
Q11❓ MCQ📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual
Read the following x86 assembly stack framing sequence and determine the final effect on the BP register value: push bp mov bp, sp sub sp, 2 mov sp, bp pop bp
💻 assembly Snippet
push bp
mov bp, sp
sub sp, 2
mov sp, bp
pop bp
  1. A.bp will retain its original value
  2. B.Value of sp will move to bp
  3. C.Value of bp will be less than sp
  4. D.Value of bp will be zero
Q12❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
In computer architecture, a stack is defined as what type of data structure?
💻 assembly Snippet
push ax
pop bx
  1. A.Last In First Out (LIFO)
  2. B.First In First Out (FIFO)
  3. C.First In Last Out (FILO)
  4. D.Random Access Structure
Q13❓ MCQ📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual
What is the maximum number of parameters a subroutine can receive through registers when all general-purpose registers are utilized for parameter passing in 16-bit x86 assembly?
💻 assembly Snippet
mov ax, p1
mov bx, p2
mov cx, p3
mov dx, p4
mov si, p5
mov di, p6
mov bp, p7
call my_subroutine
  1. A.7
  2. B.6
  3. C.4
  4. D.8
Q14❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
During the execution of the STOSB (Store String Byte) instruction, when the Direction Flag (DF) is clear (DF = 0), how is the destination index register DI modified?
💻 assembly Snippet
CLD
STOSB
  1. A.Incremented by 1
  2. B.Decremented by 1
  3. C.Incremented by 2
  4. D.Decremented by 2
Q15❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
During the execution of a repeated string instruction (such as REP STOSW or REP STOSB), after each iteration, the count register CX is ________.
💻 assembly Snippet
MOV CX, 100
REP STOSW
  1. A.Decremented by 1
  2. B.Incremented by 1
  3. C.Decremented by 2
  4. D.Incremented by 2
Q16❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
In x86 string processing instructions, auto-increment mode (incrementing index registers SI and DI after each operation) is active when which flag state is met?
💻 assembly Snippet
CLD
REP MOVSB
  1. A.DF is cleared
  2. B.DF is set
  3. C.CX is set
  4. D.ZF is cleared
Q17❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
Which pair of registers is used as source and destination index pointers to access memory during string operations (e.g., MOVSB, MOVSW)?
💻 assembly Snippet
MOVSB
  1. A.DI and SI
  2. B.DI and BP
  3. C.SI and BP
  4. D.DS and SI
Q18❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
What is the primary function of the MOVS (Move String) instruction family in x86 assembly?
💻 assembly Snippet
MOVSB
  1. A.Move memory to memory
  2. B.Move register to register
  3. C.Move register to a memory location
  4. D.Move a memory location to register
Q19❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
In STOSW (Store String Word) instruction, when the Direction Flag (DF) is clear (DF = 0), the Destination Index (DI) register is ________.
💻 assembly Snippet
CLD
STOSW
  1. A.Incremented by 2
  2. B.Incremented by 1
  3. C.Decremented by 1
  4. D.Decremented by 2
Q20❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
In the STOSB (Store String Byte) instruction, when the Direction Flag (DF) is clear (DF = 0), the Destination Index (DI) register is ________.
💻 assembly Snippet
CLD
STOSB
  1. A.Incremented by 1
  2. B.Incremented by 2
  3. C.Decremented by 1
  4. D.Decremented by 2