Subroutines

Lecture 13: Subroutines

222 Questions172 MCQs45 Short Questions5 Long Questions
Showing 131140 of 222 Questions
Page 14 of 23
Q131📝 Short Q📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual
Explain the architecture and Last-In, First-Out (LIFO) operational mechanics of the system stack in 8088 assembly language, detailing the execution steps of PUSH and POP instructions.
💻 assembly Snippet
push ax
pop bx
Q132📝 Short Q📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual
List and describe the six primary 8088 assembly language instructions that utilize the system stack for temporary data storage, control flow redirection, and hardware/software interrupt handling.
💻 assembly Snippet
push ax
call sub1
int 0x21
Q133🧠 Long Problem📑 Lec 5Hard🔁RepeatedHigh-Yield💡Conceptual🌟Starred
Explain why saving and restoring registers on the stack is critical when writing modular subroutines, detailing the required LIFO pushing and popping order to maintain stack hygiene.
💻 assembly Snippet
subroutine:
    push ax
    push bx
    ... 
    pop bx
    pop ax
    ret
Q134📝 Short Q📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual
Why is register preservation necessary when writing subroutines in 8088 assembly language, and how are PUSH and POP instructions used to achieve register transparency for the caller?
💻 assembly Snippet
push ax
push cx
...
pop cx
pop ax
ret
Q135📝 Short Q📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
Explain the internal execution sequence of the PUSH instruction in 8088 assembly language, detailing Stack Pointer (SP) modification and data transfer.
💻 assembly Snippet
push ax
Q136📝 Short Q📑 Lec 5Easy🔁RepeatedHigh-Yield💡Conceptual
Explain the internal execution sequence of the POP instruction in 8088 assembly language, detailing Stack Pointer (SP) modification and data retrieval.
💻 assembly Snippet
pop bx
Q137📝 Short Q📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual
Describe the execution flow and stack pointer manipulations performed during an intra-segment direct CALL instruction in 8088 assembly language.
💻 assembly Snippet
call my_procedure
Q138📝 Short Q📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual🌟Starred
Explain the operation of the RET (Return from Subroutine) instruction in 8088 assembly language, and describe how `RET n` performs callee parameter stack cleanup.
💻 assembly Snippet
ret 4
Q139📝 Short Q📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual
Differentiate between a Near Return (RET) and a Far Return (RETF) instruction in 8088 assembly language in terms of stack popping sequence, register updates, and parameter cleanup (RET n).
💻 assembly Snippet
ret
retf
ret 6
Q140📝 Short Q📑 Lec 5Medium🔁RepeatedHigh-Yield💡Conceptual🌟Starred
Explain how parameters are passed to subroutines through the stack in assembly language, detailing why parameters are pushed in reverse order and how the Base Pointer (BP) accesses them.
💻 assembly Snippet
push word [param2]
push word [param1]
call add_numbers