SW500009 Microchip Technology, SW500009 Datasheet - Page 80

HI-TECH FOR DSPIC/PIC24

SW500009

Manufacturer Part Number
SW500009
Description
HI-TECH FOR DSPIC/PIC24
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC24 & DsPICr
Datasheet

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
Mixing C and Assembler Code
3.10.1.9 Enabling Interrupts
Two macros are available in <htc.h> which control the masking of all available interrupts. These
macros are ei(), which enable or unmask all interrupts, and di(), which disable or mask all interrupts.
On High-End PIC devices, these macros affect the GLINTD bit in the CPUSTA register; in midrange
PIC devices, they affect the GIE bit in the INTCON register.
required in a program have been enabled. For example:
3.11 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.11.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.
66
These macros should be used once the appropriate interrupt enable bits for the interrupts that are
The following are guidelines that must be adhered to when writing a routine in assembly code
ADIE = 1; // A/D interrupts will be used
PEIE = 1; // all peripheral interrupts are enabled
ei(); // enable all interrupts
di(); // disable all interrupts
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
ensure any symbol used to hold arguments to the routine is globally accessible
ensure any symbol used to hold a return value is globally accessible
optionally, use a signature value to enable type checking when the function is called
C Language Features

Related parts for SW500009