(redirected from Subroutines)
Also found in: Dictionary, Thesaurus.


a section of a computer program that is stored only once but can be used when required at several different points in the program, thus saving space
Collins Discovery Encyclopedia, 1st edition © HarperCollins Publishers 2005
The following article is from The Great Soviet Encyclopedia (1979). It might be outdated or ideologically biased.



the part of a computer program that is used to solve similar-type problems. A subroutine usually describes a separate step in the computation process and can be used more than once in one or several different programs. Typical subroutines are used to compute elementary functions, such as sin x, In x, and e-x, to solve systems of equations, and to remove the results of computations in various forms. If it becomes necessary to use the subroutine during the running of the basic program, the subroutine is called at the appropriate place in the program, and after it has been run, control is transferred back to the main program. A subroutine can call on another.

A subroutine should have the following characteristics: it should be subject to standardized access rules that make it possible to call the subroutine from the main program by means of one or more instructions; it should be able to work with a broad range of initial data, for example, independent variables of a function; it should be relocatable, that is, it should be possible to place and run it in various parts of the computer memory. Subroutines are often arranged in subroutine libraries. So-called standard subroutines satisfying rigid conditions are used in automatic programming.

The use of subroutines is one way to save time and effort in writing computer programs. Subroutines form the basis of modular programming.


Lavrov, S. S. Vvedenie v programmirovanie. Moscow, 1973. (Bibliography.)


The Great Soviet Encyclopedia, 3rd Edition (1970-1979). © 2010 The Gale Group, Inc. All rights reserved.


(computer science)
A body of computer instruction (and the associated constants and working-storage areas, if any) designed to be used by other routines to accomplish some particular purpose.
A statement in FORTRAN used to define the beginning of a closed subroutine (first definition).
McGraw-Hill Dictionary of Scientific & Technical Terms, 6E, Copyright © 2003 by The McGraw-Hill Companies, Inc.


(Or "procedure") A sequence of instructions for performing a particular task. Most programming languages, including most machine languages, allow the programmer to define subroutines. This allows the subroutine code to be called from multiple places, even from within itself (in which case it is called recursive). The programming language implementation takes care of returning control to (just after) the calling location, usually with the support of call and return instructions at machine language level.

Most languages also allow arguments to be passed to the subroutine, and one, or occasionally more, return values to be passed back.

A function is often very similar to a subroutine, the main difference being that it is called chiefly for its return value, rather than for any side effects.
This article is provided by FOLDOC - Free Online Dictionary of Computing (


A group of instructions that perform a specific task. A large subroutine might be called a "module" or "procedure." Subroutine is somewhat of a dated term, but it is still quite valid.
Copyright © 1981-2019 by The Computer Language Company Inc. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.
References in periodicals archive ?
We therefore designed additional subroutines around getting toys out and putting them away in order to increase trials for individual target stimuli while maintaining a naturalistic approach.
Fast to the gun, slow as your subroutine checks alignment, and then fast to seat it and continue shooting.
We have used four different available FORTRAN subroutines to generate four programs to run correlations.
(1) Subroutine I is used to confirm the shift schedule of the rear power train system with two-speed gearbox.
Since compilers position subroutines in regular patterns and apply consistent alignment padding, the bytes preceding function entry points can improve recognition accuracy.
The combination of imprinted subroutines we program into the biological microprocessor that rides around on our shoulders produces a desired mechanical result.
program hello include 'mpif.h' integer rank, size, ierr,tag,status(MPI_STATUS_SIZE) call MPIINIT(ierr) call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierr) call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr) print*, 'Hello world from process', rank, 'of ', size call MPIFINALIZE(ierr) end In this code, MPI subroutines will initiate the parallel environment, get the size (Numbers) of parallel computers, assign the numbers to parallel computers starting from 0 for masters and size -1 to workers and then terminates the parallel environment respectively.
The Figure 2 shows that lower computer literacy holds register for the PC to complete the execution of a request and response, respectively, through 03H and 10H function subroutines. They have a common implementation structure.
Programmers, systems administrators and others receive a detailed survey of all Perl's basics from subroutines and expressions to lists, sorting, and smart tools.
Burgess's discussion of the implications of a greater reliance on database subroutines for building web content.