SW500011 Microchip Technology, SW500011 Datasheet - Page 81

HI-TECH X PRO FOR PIC32

SW500011

Manufacturer Part Number
SW500011
Description
HI-TECH X PRO FOR PIC32
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC32r
Datasheet

Specifications of SW500011

No. Of User Licenses
1
Supported Families
PIC32
Core Architecture
PIC
Supported Hosts
Windows XP, Vista, Linux, Mac OS X
Software Edition
Professional
Kit Contents
Software And Docs
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC32 Series
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
032
778-1007
778-1007
C Language Features
3.5 Functions
3.5.1 Absolute Functions
The generated code associated with a function can be placed at an absolute address. This can be
accomplished by using an @ address construct in a similar fashion to that used with absolute vari-
ables.
assembly instruction corresponding to the function at address 400h:
saving code that preceeds the code associated with the interrupt function body. Note also that the
address specified will be interpreted as a virtual address and not a physical address.
3.5.2 Function Argument Passing
The method used to pass function arguments depends on the size of the argument or arguments and
the degree of optimisation specified. The compiler is free to choose the most optimal combination of
passing arguments in registers or on the stack. Only argument values of a type equal to or less than 4
bytes are candidates for being passed in a register. Depending on the ISA of a given function, it will
be restricted to a subset of registers in which arguments can be passed to it. mips32r2 functions are
restricted to registers 1-27. mips16e functions are restricted to registers 4-7. Any arguments larger
than 4 bytes will always be passed on the stack in reverse order.
A registers are used for passing parameters. If the strictcalls option and/or qualifier is not used,
the HI-TECH C PRO for the PIC32 MCU Family will dynamically determine which registers to use
for passing parameters.
3.5.3 Function Return Values
Function return values are passed to the calling function as follows:
Return values of a type greater than 4 bytes are passed on the stack. In these cases the function will
reuse as much of the current stack frame as possible to pass the value.
The following example of an absolute function which will place the function label and first
Using this construct with interrupt functions will not alter the position of the interrupt context
If the --STRICTCALLS option (2.6.53) or strictcall qualifier (3.3.10.4) is used, only the first 4
Function return values of a type equal to or less than 4 bytes are returned via register 2 (v0).
int mach_status(int mode) @ 0x400
{
}
/* function body */
Functions
81

Related parts for SW500011