equal
deleted
inserted
replaced
11 * Argument vs parameter. |
11 * Argument vs parameter. |
12 |
12 |
13 From the perspective of the caller the thing which is passed is an argument. |
13 From the perspective of the caller the thing which is passed is an argument. |
14 From the perspective of the routine that receives the call, i.e. the callee, |
14 From the perspective of the routine that receives the call, i.e. the callee, |
15 the thing which is passed is a parameter. |
15 the thing which is passed is a parameter. |
|
16 |
|
17 * Linkage convention. |
|
18 |
|
19 A linkage convention is computing term that means an agreement which is made |
|
20 between a caller and a callee. The agreement describes: |
|
21 |
|
22 - how the caller should pass parameters to the callee |
|
23 |
|
24 - what assumptions the callee is allowed to make about the values in the |
|
25 machine registers at the moment of the call |
|
26 |
|
27 - who should preserve registers which are modified by the callee and/or which |
|
28 are important to the caller so that their original values are available |
|
29 when the caller needs them |
|
30 |
|
31 - how and where registers should be preserved |
|
32 |
|
33 - how the callee knows where to return to when it is ready to return to the |
|
34 caller |
|
35 |
|
36 - how the callee returns a value to the caller if the routine is a function |
|
37 (as opposed to a subroutine which has no return value) |
|
38 |
|
39 - how a debugger will find the information necessary to obtain a stack trace |