When a compiler processes a function definition:
int f( int[] A, int a, int b ) { .... } |
When registers are used for parameter passing, the compiler will:
|
Note: the return value is usually returned in register r0 by compilers - we will adopt this.
The information in
the function header is used to:
|
Example: since the parameter a was designated as register r1, a statement using variable a will use register r1
int f( int[] A, int a, int b ) { .... Translated as a = a + 1; ----------------> add r1, r1, #1 .... } |