# HG changeset patch # User Oleksandr Gavenko # Date 1255287159 -10800 # Node ID 6db1954b50f8019db68e7b0444a9f0c7f62677fa # Parent 4c0c30b9539d37e5a8a6365ecf5b6be8933d66c3# Parent af6fdb4adbf3738746dcdfb03121b61ec932f228 Automated merge with file:///srv/hg/admin-doc diff -r af6fdb4adbf3 -r 6db1954b50f8 binary.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/binary.rst Sun Oct 11 21:52:39 2009 +0300 @@ -0,0 +1,39 @@ +-*- mode: outline; coding: utf-8 -*- + +* Caller vs callee. + +If routine A calls routine B then routine A is the caller and routine B is the +callee. i.e. the caller is the routine which is calling the callee. + +The routine that initiates the call is the caller and the routine that is +being called is is the callee. + +* Argument vs parameter. + +From the perspective of the caller the thing which is passed is an argument. +From the perspective of the routine that receives the call, i.e. the callee, +the thing which is passed is a parameter. + +* Linkage convention. + +A linkage convention is computing term that means an agreement which is made +between a caller and a callee. The agreement describes: + + - how the caller should pass parameters to the callee + + - what assumptions the callee is allowed to make about the values in the + machine registers at the moment of the call + + - who should preserve registers which are modified by the callee and/or which + are important to the caller so that their original values are available + when the caller needs them + + - how and where registers should be preserved + + - how the callee knows where to return to when it is ready to return to the + caller + + - how the callee returns a value to the caller if the routine is a function + (as opposed to a subroutine which has no return value) + + - how a debugger will find the information necessary to obtain a stack trace