-3

A subroutine is a group of instructions that will be used repeatedly in different locations of the program. Rather than repeat the same instructions several times, they can be grouped into a subroutine and than called at different locations... it can exist anywhere in the program even separately from the main program.

Subroutines generally used in microprocessor are:

  1. Multiple ending subroutines
  2. Nested subroutines
  3. Multiple ending subroutine

I know what subroutine is, and I can also make a theory on 'multiple ending subroutine' on the basis of its name... BUT, I need a proper explanation of the same.

If anyone can explain all these three types of subroutines, that'll be great otherwise just explain "MULTIPLE ENDING SUBROUTINE" :)

1 Answers1

1

A google search on "MULTIPLE ENDING SUBROUTINE" would have given you Microprocessor 8085 and Its Interfacing.

It says that a "MULTIPLE ENDING SUBROUTINE" is a subroutine that because of conditions and test has more that one return point:

code...
...
JNC OTHER
...
RET
OTHER: ...
...
RET

You could also use one of the conditional return code of the 8085 (RC, RNC, ...)

Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252