subroutine

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.

Show all research tools

Cite this article
Pick a style below, and copy the text for your bibliography.

  • MLA
  • Chicago
  • APA

JOHN DAINTITH. "subroutine." A Dictionary of Computing. 2004. Encyclopedia.com. 27 May. 2012 <http://www.encyclopedia.com>.

JOHN DAINTITH. "subroutine." A Dictionary of Computing. 2004. Encyclopedia.com. (May 27, 2012). http://www.encyclopedia.com/doc/1O11-subroutine.html

JOHN DAINTITH. "subroutine." A Dictionary of Computing. 2004. Retrieved May 27, 2012 from Encyclopedia.com: http://www.encyclopedia.com/doc/1O11-subroutine.html

Learn more about citation styles

subroutine

sub·rou·tine / ˈsəbroōˌtēn/ • n. Comput. a set of instructions designed to perform a frequently used operation within a program.

Show all research tools

Cite this article
Pick a style below, and copy the text for your bibliography.

  • MLA
  • Chicago
  • APA

"subroutine." The Oxford Pocket Dictionary of Current English. 2009. Encyclopedia.com. 27 May. 2012 <http://www.encyclopedia.com>.

"subroutine." The Oxford Pocket Dictionary of Current English. 2009. Encyclopedia.com. (May 27, 2012). http://www.encyclopedia.com/doc/1O999-subroutine.html

"subroutine." The Oxford Pocket Dictionary of Current English. 2009. Retrieved May 27, 2012 from Encyclopedia.com: http://www.encyclopedia.com/doc/1O999-subroutine.html

Learn more about citation styles

subroutine

subroutine A section of code which executed from another section of code. Once the subroutine has been executed, control is returned to the code that executed it.

Show all research tools

Cite this article
Pick a style below, and copy the text for your bibliography.

  • MLA
  • Chicago
  • APA

DARREL INCE. "subroutine." A Dictionary of the Internet. 2001. Encyclopedia.com. 27 May. 2012 <http://www.encyclopedia.com>.

DARREL INCE. "subroutine." A Dictionary of the Internet. 2001. Encyclopedia.com. (May 27, 2012). http://www.encyclopedia.com/doc/1O12-subroutine.html

DARREL INCE. "subroutine." A Dictionary of the Internet. 2001. Retrieved May 27, 2012 from Encyclopedia.com: http://www.encyclopedia.com/doc/1O12-subroutine.html

Learn more about citation styles

Free newspaper and magazine articles

Facts and information from other sites

Pictures from Google Image Search

Click to see an enlarged picture
Click to see an enlarged picture
Click to see an enlarged picture

See more pictures of subroutine