In computer science , a subroutine also known as a procedure , function , routine , method , or 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 ... other subroutines, and then branch back return to the next instruction after the call once the subroutine ... Gill are credited with the invention of this concept, which they referred to as a closed subroutine ... is basically a sequence of subroutine calls. Main concepts The content of a subroutine is its body , the piece of program code that is executed when the subroutine is called or invoked . A subroutine ... of the subroutine is purely to compute one or more results whose values are entirely determined by the parameters passed to the subroutine. Examples might include computing the logarithm of a number or the determinant of a Matrix mathematics matrix . However, a subroutine call may also have side effect ... languages. A subroutine can be coded so that it may Recursion computer science call itself recursively ... and conquer algorithms . A subroutine whose purpose is to compute a single boolean valued function ...,any type of function is a subroutine but not main Language support High level programming language ... the subroutine, assigning a identifier name to the subroutine, specifying the names and or type computer ... naming scope for its temporary variable s, identifying variables outside the subroutine that are accessible within it, calling the subroutine, providing values to its parameters, specifying the return ... details from users of the subroutine. improves Traceability Software traceability , i.e. most languages ..., debugging would be impaired severely. Disadvantages The invocation of a subroutine rather than using in line code imposes some computational overhead in the call mechanism itself The subroutine ... register s and return address as a minimum History Language support In the very early assemblers, subroutine ... more details
A leaf subroutine is a subroutine which cannot in turn call another subroutine. Some compilers can apply special program optimizations to leaf subroutines, such as the use of link register s to avoid having to push the return address on the stack. The term leaf refers to their position as leaf node s in the call graph of the program. Category Subroutines compsci stub ... more details
for other uses of the word HSL HSL disambiguation HSL , originally the Harwell Subroutine Library , is a collection of Fortran 77 and 95 codes that address core problems in numerical analysis . It is primarily developed by the Numerical Analysis Group at the Rutherford Appleton Laboratory with contributions from other experts in the field. HSL codes are easily recognizable by the format of their names, consisting of two letters followed by two numbers, dating back to early versions of Fortran s limited subroutine name length. The letters denote a broad classification of the problem they solve, and the numbers serve to distinguish different codes. For example, the well known sparse LU code MA28 superseded by MA48 is a Matrix Algebra code number 28. Fortran 95 codes are differentiated from Fortran 77 codes by the prefix HSL . History Early history Original development of the Harwell Subroutine Library began in 1963 by Mike Powell and Mike Hopper for internal use on an IBM mainframe at Atomic Energy Research Establishment AERE Harwell . Early contributors also included Alan Curtis. With a spreading reputation, the Library was distributed externally for the first time in 1964 upon request. The first library catalog AERE Report M 1748 was released in 1966. Recent history Over the intervening years, HSL has striven to maintain a high standard of reliability and has garnered a worldwide reputation as a prime source of numerical software. It has undergone a number of changes to reflect newly available features of the Fortran language, completing in 1990 the conversion to Fortran 77, and more recently, the entire Library has been made thread safe . Many newer codes are written in Fortran 95. New packages continue to be developed, with a new release issued every two to three years. Many older codes have now been superseded and are available in the HSL Archive. Licensing The current version, HSL 2007 is a commercial product sold by Aspentech, but is also available without charge ... more details
Orphan date September 2010 A stubroutine also known as a stub function , null script , null subroutine , or null function is a scripting language command script or subroutine program subroutine which does nothing but return a constant value. They are used during computer programming program development , where the functional implementation of routines is delayed while other routines are developed. This is also one of the techniques used by the software piracy software pirating community to bypass callback computer science callbacks and software license license checking code the target program is Assembly language disassembled and the appropriate code is substituted for a null subroutine that just returns the value expected by the caller. Category Subroutines Computer stub ... more details
In mathematics, the term generator function may refer to Generator computer science , a special subroutine routine that can be used to control the iteration behaviour of a control flow Loops loop . A stochastic process in probability theory . Disambig ... more details
Port 135 may refer to in computing Distributed Computing Environment DCE , a framework and toolkit for developing client server applications in Internet Remote procedure call RPC , a communication process that allows for executing a subroutine or procedure in another address space disambig ... more details
Wiktionary Caller may refer to Caller telecommunications , a party that originates a call Caller dancing , a person that calls dance figures in round dances and square dances Caller, the Catalan equivalent of Cagliari The Caller , official print publication for Crime Stoppers International A software program or procedure that invokes a subroutine See also Call disambiguation Calling disambiguation disambig ... more details
wiktionary Reentrant or re entrant can refer to Reentrant subroutine in computer programming Reentrant mutex in computer science Reentry neural circuitry in neuroscience Salients, re entrants and pockets in military tactics Reentrant tuning in music Convex and concave polygons Concavity in a polygon See also Reentry Reentrant dysrhythmia , a type of cardiac arrhythmia disambig ... more details
wiktionary routine Routine may refer to Choreographed routine , orchestrated dance involving several performers Comedy routine , comedic act or part of an act Visual routine , visual cognitive means of extracting information from a scene Routine activity theory , sub field of criminology Routine SWT , first of four stories in the second issue of the Star Wars Tales series Routine Irregular , 2002 debut album by the British metal band Fony Routine Valor , 2006 Star Wars comic book by Dark Horse Comics Subroutine , reused piece of computer code Coroutine , generalized reentrant computer subroutine having multiple entry points Ethnomethodology , sociological discipline focused on the methods groups use to create societal order disambig de Routine fr Routine ko ja ... more details
Unreferenced stub auto yes date December 2009 A link register , in many instruction set architecture s such as the PowerPC , ARM architecture ARM , and the PA RISC , is a special purpose processor register register which holds the address to return to when a function programming function call completes. Other architectures such as SPARC have a register with the same purpose but another name in this case, output register 7 . The usage of a link register allows for faster calls to leaf subroutine s. When the subroutine is non leaf, passing the result address in a register still results in generation of more efficient code for thunk s, e.g. for a function whose sole purpose is to call another function with arguments rearranged in some way. Other subroutines can benefit from the use of link register because it can be saved in a batch with other callee used registers e.g. an ARM subroutine pushes registers 4 7 along with the link register, LR, by the single instruction code STMDB SP , R4 R7, LR code pipelining all memory writes required. DEFAULTSORT Link Register Category Central processing unit Compu hardware stub ... more details
by assigning to an identifier that has the same name as the subroutine, a function in Pascal terminology ... value of the subroutine. In Python programming language Python , the value code None code is returned ... to dev null null are returned from the subroutine as elements in an array, or as a single object in the case that only one object has not been captured. In Perl, a return value or values of a subroutine ... t expect any return value at all. A subroutine can check the context using the code wantarray code ... 2011 that one should eschew the use of the explicit return statement except at the textual end of a subroutine ... at the end of a subroutine e.g. a Tracing software trace statement might not be performed in all cases. ironically, of course, GOTO s to the single return point of the subroutine would solve ... more details
Other uses Blind Faith disambiguation unreferenced date January 2010 notability dave December 2010 date December 2010 Unreferenced auto yes date December 2009 In computer programming blind faith also known as blind programming or blind coding is a situation whereby a programmer Software engineering develops a solution or fixes a computer bug and Software deployment deploys it without ever testing their creation. The programmer in this situation has blind faith in their own abilities. Another form of blind faith is when a programmer calls a subroutine without checking the result. E.g. A programmer System call calls a subroutine to save user data on the hard disk without checking whether the operation was successful or not. In this case the programmer has blind faith in the subroutine always performing what the programmer intends to accomplish. Blind faith is an example of an Anti patterns Anti pattern . Other common names for blind faith include God oriented programming and divine orientation . Blind faith programming can also be used as a challenge to test programming skills. The recommended alternative to blind programming is test driven development . DEFAULTSORT Blind Faith Computer Science Category Anti patterns Comp sci stub it Fede cieca ... more details
Unreferenced stub auto yes date December 2009 In programming, a call site of a function programming function subroutine is a line in the code which calls or may call, through dynamic dispatch a function. A call site passes zero or more argument programming arguments to the function, and receives zero or more return value s. Example this is a function definition function sqr x return x x these are two call sites of the function a sqr b c sqr b Assembler example IBM 360 or Z Architecture usually external call.... R13 usually points to a save area for general purpose registers beforehand and R1 points to a list of addresses of parameters if any LA R1, A B point to address of variable B L R15, A SQR Load pointer address constant to separately compiled assembled subroutine BALR R14,R15 Go to subroutine, which returns usually at zero displacement on R14 internal call usually much smaller overhead and possibly known parameters BAL R14,SQR Go to program label and return Sometimes, as an efficient method of indicating success or otherwise, return may be accomplished by returning at 0 or 4, 8 etc. requiring a small branch table at the return point to go directly to process the case as in High level programming language HLL Switch statement . BAL R14,SQR Go to program label and return using offset on R14 as return address B FAIL RET 0 SOMETHING WRONG RET 4 O.K. Conventionally however, a return code is set in R15 0 OK, 4 failure, or similar .. but requiring a separate instruction to test R15 or use directly as a branch index. See also Function inlining subroutine DEFAULTSORT Call Site Compu lang stub Category Subroutines ... more details
Recursive function may refer to Recursion computer science , a procedure or subroutine, implemented in a programming language, whose implementation references itself A total computable function , a function which is defined for all possible inputs See also recursive function , defined from a particular formal model of computable functions using primitive recursion and the operator Recurrence relation , in mathematics, an equation that defines a sequence recursively disambig Category Recursion cs Rekurzivn funkce ru ... more details
Non recursive function might refer to Recursion computer science a procedure or subroutine, implemented in a programming language, whose implementation references itself recursive function , defined from a particular formal model of computable functions using primitive recursion and the operator Computable function , or total recursive function, a function computable by a turing machine Turing machine See also Recursive function disambig cs Rekurzivn funkce ... more details
51 FORTH is an implementation of the Forth programming language Forth programming language for the Intel 8051 microcontroller . It was created in 1989 by Scott Gehmlich of IDACOM Electronics which was acquired by Hewlett Packard in 1990 , and sent to Giovanni Moretti of Massey University , from whom it was propagated widely. The original code 51forth.zip code package is available from many archive sites, along with several other implementations of Forth. This implementation is subroutine threading subroutine threaded , with about 20 words written in assembly language , and the complete system occupying a total of about 8K of RAM. It was cross developed from a VAX to an RTX2000 Forth system connected to dual ported RAM accessible to the microcontroller. The sources and documentation are in the public domain . External links http www.ai.uga.edu mc microcontrollers 8051 UGa site with a copy of 51forth.zip http ftp.funet.fi pub microprocs 8051 signetics bbs FUNet copy Category Forth programming language family ms 51 FORTH sr 51forth ... more details
such as loops, branches and jumps. Although there is no concept of Subroutine procedures in the non ... , subroutines are allowed. Unlike a procedure, a subroutine may have several entry and exit points, and a direct jump into or out of subroutine is theoretically allowed. This flexibility allows ... . This means there is no automatic context refresh when calling a subroutine, so all variables might ... difficult, but some cases of recursion where no subroutine state values are needed after the recursive call are possible if variables dedicated to the recursive subroutine are explicitly cleared or re initialized to their original value on entry to the subroutine. The depth of nesting also may be limited ... more details
XS is an interface through which a Perl program can call a C programming language C or C language subroutine . The letters stand for eXternal Subroutine, or xsub, where external means external to Perl, i.e. written in some other language. It may be desirable for a Perl program to invoke a C subroutine in order to handle very CPU or RAM memory intensive tasks, to interface with computer hardware hardware or low level system facilities, or to make use of existing C subroutine libraries. The Perl interpreter computing interpreter is a C program, so in principle there is no obstacle to calling from Perl to C. However, the XS interface is complex, and using it requires some understanding of the interpreter. The earliest reference on the subject was the http search.cpan.org dist perl pod perlguts.pod perlguts Plain Old Documentation POD , the word guts suggesting the highly technical nature of the material. Subroutine libraries in Perl are called modules , and modules that contain xsubs are called XS modules . Perl provides a framework for developing, packaging, distributing, and installing modules. To create an XS module, h2xs is first used to create an empty module. Next, C subroutines are added, and the calling interfaces to the C subroutines are specified with a specialized glue language also referred to as XS . Finally, the module is compiled, tested, and installed with make. Once an XS module is installed, it can be loaded into a Perl program with a use statement, like an ordinary Perl module . Once the module is loaded, the C subroutines can be called from Perl code, as if they were written in Perl. XS modules are not without drawbacks. They are difficult to write and maintain, and they may only be installed if a C compiler and the headers that the Perl interpreter were compiled against are available. Also, new versions of Perl may break binary compatibility if this happens, all XS modules must be recompiled. It is also possible to write XS modules that wrap C code ... more details
about the active subroutine s of a computer program . This kind of stack is also known as an execution ... to which each active subroutine should return control when it finishes executing. An active subroutine is one that has been called but is yet to complete execution after which control should ... as a special case , hence the stack structure. If, for example, a subroutine code DrawSquare code calls a subroutine code DrawLine code from four different places, code DrawLine code must know where ... pushes the return address onto the stack, and the called subroutine, when it finishes, Pop .... If a called subroutine calls on to yet another subroutine, it will push another return address ... overflow occurs, generally causing the program to Crash computing crash . Adding a subroutine s entry ... purpose of a call stack is Storing the return address When a subroutine is called, the location ... own stack, and thus the subroutine can be Reentrant subroutine reentrant , that is, can be active simultaneously ... be Local data storage A subroutine frequently needs memory space for storing the values of local variable s, the variables that are known only within the active subroutine and do not retain values ... allocation. Note that each separate activation of a subroutine gets its own separate space in the stack ..., especially since each call to a subroutine, which will have differing values for parameters ... with the method to be invoked. Enclosing subroutine context Some programming languages e.g., Pascal ... or software states that need to be restored when a subroutine returns. This might include things like ... . These are machine dependent data structures containing subroutine state information. Each stack frame corresponds to a call to a subroutine which has not yet terminated with a return. For example, if a subroutine named code DrawLine code is currently running, having been called by a subroutine ... from the stack top to values such as the return address would not be known at compile time. If the subroutine ... more details
In computer programming , autoloading is the capability of loading and Linker computing linking portions of a program from mass storage automatically when needed, so that the programmer is not required to define or include those portions of the program explicitly. Many high level programming languages include autoload capabilities, which sacrifice some run time speed for ease of coding and speed of initial compilation linking. Typical autoload systems intercept procedure call s to undefined subroutine s. The autoloader searches through a Path computing path of directories in the computer s file system , to find a file containing source code source or object code object code that defines the subroutine. The autoloader then loads and links the file, and hands control back to the main program so that the subroutine gets executed as if it had already been defined and linked before the call. Many interactive and high level languages operate in this way. For example, IDL includes a primitive path searcher, and Perl allows individual perl module modules to determine how and whether autoloading should occur. The UNIX shell may be said to consist almost entirely of an autoloader program , as its main job is to search a path of directories to load and execute command files. In PHP5 , autoload functionality is triggered when referencing an undefined Class computer programming class . One or more autoload functions implemented as the autoload magic function or any function registered to the Standard PHP Library SPL autoload stack is called and given the opportunity to define the class, usually by loading the file it is defined in. Category programming constructs unreferenced date December 2007 ... more details
Portal Software Testing In software development , a test suite , less commonly known as a validation suite , is a collection of test case s that are intended to be used to test a software program to show that it has some specified set of behaviours. A test suite often contains detailed instructions or goals for each collection of test cases and information on the system configuration to be used during testing. A group of test cases may also contain prerequisite states or steps, and descriptions of the following tests. Collections of test cases are sometimes incorrectly termed a test plan , a test script , or even a test scenario . Types Occasionally, test suites are used to group similar test cases together. A system might have a smoke test suite that consists only of smoke test s or a test suite for some specific functionality in the system. It may also contain all tests and signify if a test should be used as a smoke test or for some specific functionality. An executable test suite is a test suite that can be executed by a program. This usually means that a test harness , which is integrated with the suite, exists. The test suite and the test harness together can work on a sufficiently detailed level to correctly communicate with the system under test SUT . A test suite for a primality testing subroutine might consist of a list of numbers and their primality prime or composite , along with a testing subroutine. The testing subroutine would supply each number in the list to the primality tester, and verify that the result of each test is correct. External links http www.plumhall.com suites.html The Plum Hall Validation Suite for C C and the C Library , a popular executable Test Suite. See also Scenario test Software testing Test case soft eng stub Category Software testing zh ... more details
In computer programming , a parameter is a special kind of Variable programming variable , used in a subroutine to refer to one of the pieces of data provided as input to the subroutine. ref In this article, the term subroutine refers to any subroutine like construct, which have different names and slightly different meanings depending on the programming language being discussed. ref These pieces of data are called arguments . An ordered list of parameters is usually included in the definition of a subroutine, so that, each time the subroutine is called, its arguments for that call can be assigned to the corresponding parameters. Just as in standard mathematical usage, the argument is thus the actual value passed to a function, procedure, or routine such as 37 in log 37 , whereas the parameter is a reference to that value inside the implementation of the function log in this case . See the Parameter computer programming Parameters and arguments Parameters and arguments section for more information. In the most common case, call by value , a parameter acts within the subroutine as a Local ... supplied by the caller can be affected by actions within the called subroutine as discussed ... the subroutine is called at Run time program lifecycle phase run time . When discussing code that is calling into a subroutine, any values or references passed into the subroutine are the arguments ... the code inside the subroutine definition, the variables in the subroutine s parameter list ... above, reserve the term parameter when discussing subroutine definitions. source Many programmers ... . It adds the values passed into the parameters, and returns the result to the subroutine ... void to indicate that the subroutine has no parameters in formal type theory , such functions take ... , and Windows PowerShell allow for a default argument to be explicitly or implicitly given in a subroutine s declaration. This allows the caller to omit that argument when calling the subroutine. If the default ... more details
Refimprove date December 2011 In computer programming , the return type or result type defines and constrains the data type of the value returned from a subroutine or Method computer programming method . ref cite book last1 Kernighan first1 Brian W. author1 link Brian Kernighan last2 Ritchie first2 Dennis M. author2 link Dennis Ritchie title The C Programming Language edition 2nd publisher Prentice Hall year 1988 url http cm.bell labs.com cm cs cbook isbn 0 13 110362 8 ref In many programming languages especially statically typed programming language s such as C programming language C , C , Java programming language Java the return type must be explicitly specified when declaring a function. In the Java example source lang java public int someMethod source the return type is Integer computer science int . The program can therefore rely on the method returning a value of type int . Various mechanisms are used for the case where a subroutine does not return any value, e.g., a return type of Void type void is used in some programming languages source lang java public void returnNothing source References Reflist DEFAULTSORT Return Type Category Subroutines ru ... more details
. Variables Variables can be either local i.e. within the scope of a subroutine or global. Names ..., it will be hidden for the remainder of this subroutine invocation. A code code outside a subroutine ... see the description of the interpreter for more info . Flow Control code SubName code Start of subroutine. The scope of the subroutine extends to the next code code . N.B. All code before the first subroutine is within the global scope. code SubName code Gosub. Subroutine call. code code Gosub. Return from subroutine. code Label code Label definition. Define a label within the current subroutine or within the global scope . code Label code Goto. Go to a label within the current subroutine or within .... If it is not empty, go to code label code within the current subroutine or within the global scope ... more details
consists entirely of calls to subroutine s. The code may be processed by an interpreter computing ... memory by writing each step of such operations once see Don t repeat yourself and placing it in a subroutine .... The top level application in these programs may consist of nothing but subroutine calls. Many of these subroutines, in turn, also consist of nothing but lower level subroutine calls. Mainframes and some early microprocessors such as the RCA 1802 required several instructions to call a subroutine. In the top level application and in many subroutines, that sequence is constantly repeated, only the subroutine ... repeatedly is wasteful. To save space, programmers squeezed that series of subroutine calls into a list ... each subroutine in turn. This is identical to the way other programmers squeezed a series of jumps in a branch ... built. No one variation is best . Development To save space, programmers squeezed the lists of subroutine calls into simple lists of subroutine addresses, and used a small loop to call each subroutine ... threading is faster than subroutine threading see reference below . As example, a stack machine might ... ip 1 sp sp sp &i pushB &A jump ip jump ip &i add i pushB &push &B i add &add pre Subroutine threading So called subroutine threaded code also call threaded code consists of a series of machine language ... . Early compilers for ALGOL , Fortran, Cobol and some Forth systems often produced subroutine threaded ... had well developed compiler theory. Most modern processors have special hardware support for subroutine ... is somewhat diminished. Anton Ertl has stated that, in contrast to popular myths, subroutine threading ... show that subroutine threading is faster than direct threading in 15 out of 25 test cases. Ertl s most ... processors indirect threading is the fastest threading model on Pentium M processors and subroutine ... by measuring the frequency that each subroutine occurs in the code. Frequent calls are given .... Another one exists for passing data between subroutine s words . These are ip or i instruction ... more details