मराठी
महाराष्ट्र राज्य शिक्षण मंडळएचएससी विज्ञान (संगणक विज्ञान) इयत्ता १२ वी

How are subroutines called? Explain with an example.

Advertisements
Advertisements

प्रश्न

How are subroutines called? Explain with an example.

स्पष्ट करा
Advertisements

उत्तर

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)
       RET
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2023-2024 (July) Official Board Paper

APPEARS IN

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×