SW500011 Microchip Technology, SW500011 Datasheet - Page 94

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
Mixing C and Assembly Code
3.10.3.1 Accessing special function register names from assembler
If writing separate assembly modules, SFR definitions will not automatically be present. If writing
assembly code from within a C module, SFRs may be accessed by referring to the symbols defined
by the chip-specific C header files. Whenever you include <htc.h> into a C module, all the available
SFRs are defined as absolute C variables. As the contents of this file is C code, it cannot be included
into an assembler module, but assembly code can uses these definitions. To use a SFR in in-line
assembly code from within the same C module that includes <htc.h>, simply use the symbol with
an underscore character prepended to the name. For example:
3.10.4 Interaction between Assembly and C Code
HI-TECH C PRO for the PIC32 MCU Family incorporates several features designed to allow C code
to obey requirements of user-defined assembly code.
before compilation of C source files begin. The driver is able to read and analyse certain information
in the relocatable object files and pass this information to the code generator. This information is
used to ensure the code generator takes into account requirement of the assembly code.
3.10.4.1 Absolute Psects
Some of the information that is extracted from the relocatable objects by the driver relates to absolute
psects, specifically psects defined using the abs and ovrld, PSECT flags, see Section
more information. These are psects have been rarely required in general coding, but do allow for
data to be collated over multiple modules in a specific order.
lute psects to enure that the output of C code does not consume specific resources required by the
assembly code. The code generator will ensure that any memory used by these psects are reserved
and not used by C code. The linker options are also adjusted by the driver to enure that this memory
is not allocated.
94
The command-line driver ensures that all user-defined assembly files have been processed first,
HI-TECH C PRO for the PIC32 MCU Family is able to determine the address bounds of abso-
#include <htc.h>
void main(void)
{
}
PORTA = 0x55FFFFFF;
asm("li a3, 055FFFFFFh");
asm("li a2, _PORTA");
asm("sw a3, 0(a2)");
...
C Language Features
4.3.10.3
for

Related parts for SW500011