हिंदी

How are subroutines called? Explain with an example. - Computer Science 2

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×