Q3Microprocessor
Question
Q.3. List the benefits of subroutine.
Answer
Subroutines offer benefits of code reusability, reduced overall program size, easier debugging and maintenance, and improved program modularity.
The benefits of subroutines include: code reusability, since a commonly-needed instruction sequence is written and stored only once, and called (invoked) from multiple points in the main program rather than being duplicated at each point of use; reduced total program memory usage, since duplicated code is avoided; easier debugging, testing, and maintenance, since a subroutine's isolated, well-defined functionality can be verified and modified independently of the rest of the program; and improved overall program structure/modularity, since decomposing a complex task into logically separate, named subroutines significantly improves the readability and manageability of large assembly language programs.