subroutine
subroutine A piece of code that is obeyed “out of line”, i.e. control is transferred to the subroutine, and on its completion control reverts to the instruction following the call. (The instruction code of the CPU usually provides subroutine jump and return instructions to facilitate this operation.) A subroutine saves space since it occurs only once in the program, though it may be called from many different places in the program. It also facilitates the construction of large programs since subroutines can be formed into libraries for general use. (The same concept appears in high-level languages as the procedure.)
In the early days of programming, what is now called a subroutine was known as a closed subroutine. This was in contrast with the open subroutine, which was a piece of code that appeared in several places in a program, and was substituted “in line” by the assembler for each call appearing in the program. The open subroutine was just a convenient shorthand for the programmer: the same facility is now known as a macro.
In the early days of programming, what is now called a subroutine was known as a closed subroutine. This was in contrast with the open subroutine, which was a piece of code that appeared in several places in a program, and was substituted “in line” by the assembler for each call appearing in the program. The open subroutine was just a convenient shorthand for the programmer: the same facility is now known as a macro.
More From encyclopedia.com
Computer Program , pro·gram / ˈprōˌgram; -grəm/ (Brit. pro·gramme) • n. 1. a planned series of future events, items, or performances: a weekly program of films the prog… compiler , compiler •beguiler, compiler, Delilah, filer, Isla, miler, reviler, smiler, styler, tiler, Tyler •idler •stifler, trifler •recycler • Kreisler • prof… Computation , Computation
Older methods
General-purpose digital computer
Error analysis
BIBLIOGRAPHY
In recent years there has occurred enormous technological deve… Programming , Award-winning computer designer and engineer W. Daniel Hillis captured the essence of programming when he said: "The magic of a computer lies in its… machine code , machine code In computing, instructions that the central processing unit (CPU) of a computer can execute, without the need for translation. Machine-c… Programming Language , In order for computers to accept commands from humans and perform tasks vital to productivity and e-commerce, a means of communication must exist. Pr…
About this article
subroutine
All Sources -
You Might Also Like
NEARBY TERMS
subroutine