SW500009 Microchip Technology, SW500009 Datasheet - Page 92
![HI-TECH FOR DSPIC/PIC24](/photos/9/32/93258/sw500009_sml.jpg)
SW500009
Manufacturer Part Number
SW500009
Description
HI-TECH FOR DSPIC/PIC24
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC24 & DsPICr
Datasheet
1.SW500009.pdf
(444 pages)
Specifications of SW500009
Supported Families
PIC24
Core Architecture
PIC, DsPIC
Software Edition
Standard
Kit Contents
Software And Docs
Tool Type
Compiler
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
DSPIC3X/PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
025
778-1003
778-1003
778-1003
778-1003
- Current page: 92 of 444
- Download datasheet (3Mb)
Linking Programs
3.13.2 Signature Checking
The compiler automatically produces signatures for all functions. A signature is a 16-bit value
computed from a combination of the function’s return data type, the number of its parameters and
other information affecting the calling sequence for the function. This signature is output in the
object code of any function referencing or defining the function.
likely to issue a mismatch error from the linker when the routine is either a precompiled object file
or an assembly routine. Other function mismatches are reported by the code generator.
extern declaration. Such assembly language functions should include a signature which is compati-
ble with the C prototype used to call them. The simplest method of determining the correct signature
for a function is to write a dummy C function with the same prototype and compile it to assembly
language using the PICC -S option. For example, suppose you have an assembly language routine
called _widget which takes two int arguments and returns a char value. The prototype used to call
this function from C would be:
arguments and a char return value would be generated. In order to match the correct signature the
source code for widget needs to contain an assembler SIGNAT pseudo-op which defines the same
signature value. To determine the correct value, you would write the following code:
the value 8249 with symbol _widget. The value 8249 is the correct signature for a function with
two int arguments and a char return value. If this line is copied into the .as file where _widget is
defined, it will associate the correct signature with the function and the linker will be able to check
for correct argument passing. For example, if another .c file contains the declaration:
will alert you to the possible existence of incompatible calling conventions.
78
At link time the linker will report any mismatch of signatures. HI-TECH PICC STD is only
It is sometimes necessary to write assembly language routines which are called from C using an
extern char widget(int, int);
Where a call to _widget is made in the C code, the signature for a function with two int
char widget(int arg1, int arg2)
{
}
and compile it to assembler code using
PICC -S x.c
The resultant assembler code includes the following line:
SIGNAT _widget,8249
The SIGNAT pseudo-op tells the assembler to include a record in the .obj file which associates
extern char widget(long);
then a different signature will be generated and the linker will report a signature mis-match which
C Language Features
Related parts for SW500009
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![TC1014-2.7VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1014-5.0VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.5VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.7VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.8VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-4.0VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1186-2.5VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1186-2.85VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet: