238 views
0 votes
0 votes
What do we mean by subroutine in c language ? Please explain with the help of example.

1 Answer

0 votes
0 votes

The address to which the CALL instruction takes the flow is called the subroutine

example :

2500 : mov A,B

2502: CALL 8500

2504: ADD A,B

now the instructions from 8500 till it reaches a RET ststement is the subroutine

Once RET is encountered the control goes back to address 2504 which is the main program

IN SHORT - A branching from main program to some other set of instructions(also called functions) happens during CALL 

these set of instructions or functions are called subroutines

No related questions found