SW500010 Microchip Technology, SW500010 Datasheet - Page 156

HI-TECH C PRO FOR PIC10/12/16

SW500010

Manufacturer Part Number
SW500010
Description
HI-TECH C PRO FOR PIC10/12/16
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC10/12/16r
Datasheets

Specifications of SW500010

Supported Families
PIC10, PIC12, PIC16
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC10/12/16
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC10, PIC12, PIC14, PIC16, PIC16E
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
019P
778-1006
778-1006
Compiled Stack Operation
one parameter as the ANSI standard does not dictate the order in which function parameters must be
evaluated.
The linker indicates in the call graph those functions that may have been called to determine param-
eter values to other functions. See Section
map file.
156
Such a condition is best illustrated by an example, which is shown in the following tutorial.
T
P
For the highlighted statement, the compiler might evaluate and load the first parameter
to the function B, which is the literal, 5. To do this, the value of 5 is loaded to the
locations ?_B and ?_B+1. Now to evaluate the second parameter value to the function
B, the compiler must first call the function A. So A’s parameters are loaded and the call
to function A is made. Code inside the function A, calls the function B. This involves
loading the parameters to B: the contents of the variable b are loaded to ?_B+2 and
?_B+3, and the value 9 is loaded to ?_B and ?_B+1, which corrupts the contents of
these locations which were loaded earlier for the still pending call to function B. Func-
tion A eventually returns normally and the the return value is the loaded to the second
parameter locations for the still pending call to function B, back at the highlighted line
of source. However, the value of 5 previously loaded as the first parameter to B has
been lost. When the call to function B is now made, the parameters will not be correct.
Note that the function B is not actively executing code in more than one instance of the
function at the same time, however the code that loads the parameters to function B is.
UT RIAL
ARAMETERS IMPLEMENTED AS FUNCTION CALLS
int B(int x, int y) {
}
int A(int a, int b) {
}
void main(void) {
}
return x - y;
return a+B(9, b);
B(5, A(6, 7));
// consider this statement
5.10.2.2
for information on how this is displayed in the
Consider the following code.
Linker and Utilities

Related parts for SW500010