Advertisements
Advertisements
Question
How are subroutines called? Explain with an example.
Explain
Advertisements
Solution
A subroutine is called using a CALL instruction. CALL saves the return address and jumps to the subroutine; when the subroutine finishes, a RET instruction pops the return address back into the program counter, so execution returns to the caller.
Example:
4004: MOV A, C
4005: ADD B
4006: CALL UPDDT
4009: HLT
UPDDT: (subroutine instructions)
RETshaalaa.com
Is there an error in this question or solution?
2023-2024 (July) Official Board Paper
