Computer Science, asked by rosalish, 1 year ago

how are call and return instructions for a subroutine handled in a computer

Answers

Answered by saurabh87
3
In computer programming, asubroutine is a sequence of program instructions that perform a specific task, packaged as a unit. This unit can then be used in programs wherever that particulartask should be performed. Subprograms may be defined within programs, or separately inlibraries that can be used by multiple programs. In different programming languages, a subroutine may be called aprocedure, a function, a routine, a method, or a subprogram. The generic term callable unitis sometimes used.

The name subprogram suggests a subroutine behaves in much the same way as a computer program that is used as one step in a larger program or another subprogram. A subroutine is often coded so that it can be started (called) several times and from several places during one execution of the program, including from other subroutines, and then branch back (return) to the next instruction after the call, once the subroutine's task is done. Maurice Wilkes, David Wheeler, and Stanley Gill are credited with the invention of this concept, which they termed a closed subroutine,

Similar questions