Call site


In programming, a call site of a function or subroutine is the location where the function is called. A call site is where zero or more arguments are passed to the function, and zero or more return values are received.

Example

// this is a function definition
function sqr
function foo

Assembler example

IBM/360 or Z/Architecture
* external call.... R13 usually points to a save area for general purpose registers beforehand
* and R1 points to a list of addresses of parameters
LA R1,=A point to variable 'B'
L R15,=A Load pointer to separately compiled/assembled subroutine
BALR R14,R15 Go to subroutine, which returns - usually at zero displacement on R14
* internal call
BAL R14,SQR Go to program label and return
In some occasions, return is an efficient method of indicating success or failure. return may be accomplished by returning at +0 or +4,+8, +12, etc. requiring a small branch table at the return point - to go directly to process the case.
BAL R14,SQR Go to program label and return
B FAIL - SOMETHING WRONG
* - O.K.
Conventionally however, a return code is set in R15 but requiring a separate instruction to test R15 or use directly as a branch index.