SW500010 Microchip Technology, SW500010 Datasheet - Page 104

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
Mixing C and Assembler Code
3.10.4 Interaction between Assembly and C Code
HI-TECH C PRO for the PIC10/12/16 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.
of absolute 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.
104
The command-line driver ensures that all user-defined assembly files have been processed first,
HI-TECH C PRO for the PIC10/12/16 MCU Family is able to determine the address bounds
#include <htc.h>
void main(void)
{
T
P
be located at address 210h in the data space. The assembly file contains:
PSECT lkuptbl,class=RAM,space=1,abs,ovlrd
ORG 110h
lookup:
ds 20h
When the project is compiled, this file is assembled and the resulting relocatable object
file scanned for absolute psects. As this psect is flagged as being abs and ovlrd, the
bounds and space of the psect will be noted — in this case a memory range from address
110h to 12fh in memory space 1 is being used. This information is passed to the code
UT RIAL
ROCESSING OF ABSOLUTE PSECTS
PORTA = 0x55;
asm("movlw #0xAA");
asm("movwf _PORTA);
An assembly code files defines a table that must
C Language Features
4.3.8.3
for

Related parts for SW500010