SW500011 Microchip Technology, SW500011 Datasheet - Page 91

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
Another example, suppose you have an assembly language function to double an unsigned byte
value:
declares an external function called twice() which has a return value type of char and takes a single
argument of type char. The actual code for twice() will be supplied by an external .as file which
will be separately assembled with ASPIC32 . The full PIC32 assembly code for twice() would be
something like:
The name of the assembly language function is the name declared in C, with an underscore prepended.
The GLOBAL pseudo-op is the assembler equivalent to the C extern keyword and the SIGNAT
pseudo-op is used to enforce link time calling convention checking. Signature checking and the
SIGNAT pseudo-op are discussed in more detail later in this chapter.
place for any arguments passed and must correctly set up any return values. Local variable allocation
(via the FNSIZE directive), argument and return value passing mechanisms are discussed in the
Section
Note that in order for assembly language functions to work properly they must look in the right
{
}
extern __strictcall char twice(char);
PROCESSOR
_twice:
END
4.7
PSECT
GLOBAL
SIGNAT
; parameter passed via a0 register (if using __strictcall)
sll
andi
move
jr
short a, result;
a = read_port();
result = add(5, a);
and should be understood before attempting to write assembly language routines.
a0, 1
a0, (1< < 8 ) -1
v0, a0
ra
32MX360F512L
text32, class=KSEG0_PFM, local, reloc=4, isa=mips32r2
_twice
_twice,1049
Mixing C and Assembly Code
91

Related parts for SW500011