SW500007 Microchip Technology, SW500007 Datasheet - Page 138

PICC-18 PRO

SW500007

Manufacturer Part Number
SW500007
Description
PICC-18 PRO
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC18r
Datasheets

Specifications of SW500007

Supported Families
PIC18
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC18
Tool Function
Compiler
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
PIC18 Series
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
015P
778-1002
778-1002
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.
124
Such a condition is best illustrated by an example, which is shown in the following tutorial.
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 loca-
tions ?_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 func-
tion 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. Function 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.
T
P
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 SW500007