SW500010 Microchip Technology, SW500010 Datasheet - Page 92

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
Function Calling Convention
will exit with the following code:
3.6 Function Calling Convention
The baseline PIC devices have a two-level deep hardware stack which is used to store the return
address of a subroutine call. Typically, call instructions are used to transfer control to a C function
when it is called, however where the depth of the stack will be exceeded, HI-TECH C PRO for
the PIC10/12/16 MCU Family will automatically swap to using a method that involves the use of a
lookup table.
address after storing the address of a jump table instruction which will be able to return control
back to the calling function. The address is stored as an object local to the function being called.
The lookup table is accessed after the function called has finished executing. This method allows
functions to be nested without overflowing the stack, however it does come at the expense of memory
and program speed.
assembly instruction and which will be called via the jump table, however this authority can be
taken away from the compiler by disabling the stackcall suboption to the --RUNTIME option.
With this feature turned off all function calls execute via a lookup table unless a function definition
is qualified as fastcall. A fastcall-qualified function will be called via a call instruction.
Extreme care must be used when functions are declared as fastcall, since the each nested fastcall
function call will use one word of available stack space. Check the call graph in the map file to ensure
that the stack will not overflow.
92
When the lookup method is being employed, a function is called by jumping directly to its
By default the compiler will determine which functions are permitted to be called via a call
The function prototype for a baseline fastcall function might look something like:
struct fred
{
} ;
struct fred return_struct(void)
{
}
retlw ??_return_struct+0
fastcall void my_function(int a);
int ace[4];
struct fred wow;
return wow;
C Language Features

Related parts for SW500010