Subroutines

Lecture 13: Subroutines

222 Questions172 MCQs45 Short Questions5 Long Questions
Showing 141150 of 222 Questions
Page 15 of 23
Q141📝 Short Q📑 Lec 5Hard🔁RepeatedHigh-Yield💡Conceptual🌟Starred
Define a local variable in computer programming and explain how local variables are dynamically allocated and deallocated on the assembly stack frame using SP and BP.
💻 assembly Snippet
push bp
mov bp, sp
sub sp, 4
Q142❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
In 8088 architecture, which segment register is the Stack Pointer (SP) associated with by default for memory addressing?
💻 assembly Snippet
push ax
  1. A.SS (Stack Segment)
  2. B.DS (Data Segment)
  3. C.CS (Code Segment)
  4. D.ES (Extra Segment)
Q143❓ MCQ📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual
Executing a Far Return instruction (RETF) pops the saved 16-bit code segment address into which segment register?
💻 assembly Snippet
retf
  1. A.CS (Code Segment) register
  2. B.DS (Data Segment) register
  3. C.SS (Stack Segment) register
  4. D.ES (Extra Segment) register
Q144❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
The system stack in the 8088 architecture operates on element sizes of __________.
💻 assembly Snippet
push ax
  1. A.Word-sized elements
  2. B.Byte-sized elements
  3. C.Doubleword-sized elements
  4. D.Nibble-sized elements
Q145❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
In 8088 real mode architecture, how is the physical memory address of the top of the stack calculated?
💻 assembly Snippet
push ax
  1. A.SS:SI combination
  2. B.SS:SP combination
  3. C.ES:BP combination
  4. D.ES:SP combination
Q146❓ MCQ📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual
When executing a Far Return instruction (RETF), into which register is the 16-bit offset popped first off the stack?
💻 assembly Snippet
retf
  1. A.Base Pointer (BP)
  2. B.Instruction Pointer (IP)
  3. C.Stack Pointer (SP)
  4. D.Source Index (SI)
Q147❓ MCQ📑 Lec 5Hard🔁RepeatedHigh-Yield💡Conceptual
What is the net effect on the Stack Pointer (SP) after executing the instruction 'RET 2' in an 8088 subroutine?
💻 assembly Snippet
ret 2
  1. A.SP is incremented by 2
  2. B.SP is decremented by 2
  3. C.SP is incremented by 4
  4. D.SP is decremented by 4
Q148❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
In the 8088 16-bit architecture, how is the Stack Pointer (SP) updated whenever a PUSH operation is performed?
💻 assembly Snippet
push ax
  1. A.SP is decremented by 1
  2. B.SP is decremented by 2
  3. C.SP is decremented by 3
  4. D.SP is decremented by 4
Q149❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
When a subroutine finishes execution, which instruction retrieves the return address from the stack and transfers control back to that caller address?
💻 assembly Snippet
ret
  1. A.RET instruction
  2. B.CALL instruction
  3. C.POP instruction
  4. D.JMP instruction
Q150❓ MCQ📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
The Stack Pointer (SP) is a memory pointer register that is used indirectly by a set of stack __________.
💻 assembly Snippet
push ax
pop bx
  1. A.instructions
  2. B.pointers
  3. C.indexes
  4. D.variables