SW500010 Microchip Technology, SW500010 Datasheet - Page 100

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
This feature allows the programmer to write code which is independent of whether the target device
allows re-entrant functions. PRO compilers will have as many duplicates of these routines precom-
piled in the object code libraries as there are interrupt levels. It does not handle cases where functions
are called recursively.
3.9.2.1 Implicit Calls to Library Routines
Evaluation of certain C operators will require the use of C functions that are precompiled into the p-
code library files. The code generator will call these routines as required. These routines are subject
to the same duplication as user-defined routines, described above.
wmul, then an expression in main-line code involving such a multiplication will call wmul; the
same code used in an interrupt function of level 1 will result in a call to the routine i1wmul; in
an interrupt function of level 2 will call i2wmul, etc. These function names will be shown in
the callgraph section of the map file, see Section 5.10.2.2.
3.10 Mixing C and Assembler Code
Assembly language code can be mixed with C code using two different techniques: writing assembly
code and placing it into a separate assembler module, or including it as in-line assembler in a C
module. For the latter, there are two formats in which this can be done.
3.10.1 External Assembly Language Functions
Entire functions may be coded in assembly language as separate .as source files, assembled and
combined into the output image using the linker. This technique allows arguments and return values
to be passed between C and assembler code.
that is callable from C code.
100
For example: if a compiler uses a routine to perform word multiplication, and this is called
The following are guidelines that must be adhered to when writing a routine in assembly code
made to both of these functions as if they were independently written.
select, or define, a suitable psect for the executable assembly code
select a name (label) for the routine so that its corresponding C identifier is valid
ensure that the routine’s label is globally accessible from other modules
select an appropriate equivalent C prototype for the routine on which argument passing can be
modelled
C Language Features

Related parts for SW500010